-
-
Notifications
You must be signed in to change notification settings - Fork 320
rename module from l10n_it_riba to l10n_it_riba_oca #4520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
10e76e9
to
56e941e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... se tento di installare riba_oca mi segnala errore:
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1653, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1680, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1884, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 734, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_install
File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 478, in button_immediate_install
return self._button_immediate_function(self.env.registry[self._name].button_install)
File "/opt/odoo/odoo/addons/base/models/ir_module.py", line 602, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "", line 2, in new
File "/opt/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/odoo/modules/loading.py", line 489, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/odoo/modules/loading.py", line 373, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/odoo/modules/loading.py", line 196, in load_module_graph
getattr(py_module, pre_init)(cr)
File "/mnt/data/odoo-addons-dir/l10n_it_riba_oca/hooks.py", line 73, in pre_absorb_old_module
cr.execute(
File "/opt/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
IndexError: tuple index out of range
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (http://oca-l10n-italy-16-0-pr4520-10e76e965d5e.runboat.odoo-community.org/web/assets/413-c765628/web.assets_backend.min.js:1001:163)
at XMLHttpRequest. (http://oca-l10n-italy-16-0-pr4520-10e76e965d5e.runboat.odoo-community.org/web/assets/413-c765628/web.assets_backend.min.js:1009:13)
56e941e
to
8e05bfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test funzionale: OK
Mancano traduzioni
penso vada rinominato il file .pot @Borruso |
Non è così semplice, andrebbero cambiati anche tutti i riferimenti interni al modulo per ciascuna stringa. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come ho già indicato qui non credo sia opportuno procedere alla modifica del nome di un modulo in una versione stabile già rilasciata. (vedi anche OCA/manufacture#559 (comment)).
- altissimo rischio di spaccare installazioni di produzione esistenti con un semplice update del DB.
- La rinomina corrisponde a:
-
aggiungere un nuovo modulo
l10n_it_riba_oca
-
eliminare il modulo esistente
l10n_riba
Il modulo nuovo non può mantenere la stessa versione del modulo vecchio (dato che sono due moduli diversi), quindi dovrebbe ripartire da
16.0.1.0.0
.
Eliminare un modulo da un repository non mi sembra per nulla una buona idea, data la complessità dei meccanismi automatici che vengono avviati ad ogni modifica. Per esempio cosa succede con i sistemi di CI di OCA? Cosa succede con Weblate?
L'alternativa sarebbe quella di aggiungere un nuovo modulo l10n_it_riba_oca
lasciando anche quello esistente l10_it_riba
.
Questa soluzione in ogni caso non risolverebbe il problema di chi usa la versione Enterprise, perché andrebbe comunque modificato l'ordine dei path delle cartelle (alternativa descritta nella issue).
A questo punto tanto vale lasciare la 16.0 così com'è e cambiare solo l'ordine dei path.
8e05bfd
to
84d9ed8
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
84d9ed8
to
65d43b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In giornata ti propongo una PR per aggiungere lo script di migrazione.
Intanto ho notato queste cose, puoi correggere?
Il concetto di base è che servono per chi migrerà dalla 14.0
a 16.0
dopo che questa PR viene mergiata.
P.S.: la PR è Borruso#35
OLD_MODULE_NAME = "l10n_it_riba" | ||
NEW_MODULE_NAME = "l10n_it_riba_oca" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OLD_MODULE_NAME = "l10n_it_riba" | |
NEW_MODULE_NAME = "l10n_it_riba_oca" | |
OLD_MODULE_NAME = "l10n_it_ricevute_bancarie" | |
NEW_MODULE_NAME = "l10n_it_riba_oca" |
Questo hook serve per chi migra da 14.0
, dove il modulo si chiama l10n_it_ricevute_bancarie
, alla 16.0
dove il modulo, dopo questa PR, si chiamerà l10n_it_riba_oca
.
Quindi anche qui va solo fatta la sostituzione l10n_it_riba
-> l10n_it_riba_oca
.
Per la migrazione dati ti sto proponendo io una PR come abbiamo detto poco fa in chiamata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il titolo del commit non segue https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#71commit-message, puoi correggere?
Ad esempio potrebbe essere
[MOV] l10n_it_riba: Rename to l10n_it_riba_oca
E ricorda di usare git mv
per spostare i file, altrimenti non li vedremo nella commit history del nuovo modulo:
[MOV] for moving files: use git move and do not change content of moved file otherwise Git may loose track and history of the file; also used when moving code from one file to another;
|
||
def migrate(cr, installed_version): | ||
# Used by OpenUpgrade when module is in `apriori` | ||
hooks.migrate_old_module(cr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questo è nuovo, quando dovrebbe essere eseguito?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qui dentro c'è ancora un riferimento a l10n_it_riba
, puoi rinominarlo in l10n_it_riba_oca
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qui dentro ci sono ancora riferimenti a l10n_it_riba
, puoi rinominarli in l10n_it_riba_oca
?
@@ -278,7 +278,7 @@ def test_riba_incasso_all_paid(self): | |||
self.invoice.action_post() | |||
self.assertEqual(self.invoice.state, "posted") | |||
|
|||
to_issue_action = self.env.ref("l10n_it_riba.action_riba_to_issue") | |||
to_issue_action = self.env.ref("l10n_it_riba_oca.action_riba_to_issue") | |||
to_issue_model = self.env[to_issue_action.res_model] | |||
to_issue_domain = safe_eval.safe_eval(to_issue_action.domain) | |||
to_issue_records = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qui sotto (riga 334) c'è ancora un riferimento a l10n_it_riba
, puoi rinominarlo in l10n_it_riba_oca
?
È il motivo per cui stanno fallendo i test.
(da #4520 (review)) Ne abbiamo parlato stamattina in chiamata e le alternative che sono state proposte (moduli fittizi, disattivare il check-license, ...) non reggono il confronto con una rinomina, che permette di lasciare il codice senza soluzioni temporanee. Sappiamo che eventuali moduli custom dipendenti da Se hai alternative da proporre siamo tutt'orecchi, ma per il momento siamo orientati verso la rinomina. |
Sinceramente al momento non mi vengono in mente altre alternative valide. |
Prendo in carico in #4856 |
Issue: #4519