Repository navigation
[20.0][MIG] mail - #6087
[20.0][MIG] mail#6087hbrunn wants to merge 80 commits into
Conversation
If we don't include it, /jsonrpc route doesn't work.
If you have a module in previous versions that adds data on a model,
and such model is not loaded in the registry in current version because
the module is absent in it, you can't uninstall such module, getting
this error:
File "odoo/odoo/addons/base/models/ir_model.py", line 1945, in _module_data_uninstall
delete(self.env[model].browse(item[1] for item in items))
File "odoo/odoo/api.py", line 463, in __getitem__
return self.registry[model_name]._browse(self, (), ())
File "odoo/odoo/modules/registry.py", line 177, in __getitem__
return self.models[model_name]
KeyError: 'model'
With this patch, data cleanup of such model is skipped and there's no crash.
…ore ; add links to the new OpenUpgrade website
If corresponding field is None, we need to avoid the "AttributeError: 'NoneType' object has no attribute error.
…rg validate as it is not anymore in odoo 15
…e useless after the input argument validate has been removed
Because we captured the exception in _raise_view_error and archived that
view, so info is None, but it is called to info.get('select') in
NameManager.check, which will raise an exception AttributeError, so we
need to override to not raise an exception
…path does not exist
Co-authored-by: FerDeNetlab <[email protected]>
Co-authored-by: FerDeNetlab <[email protected]>
when installing auto_install modules
|
The following commit authors need to sign the Contributor License Agreement: |
|
/ocabot migration mail |
mauro2306
left a comment
There was a problem hiding this comment.
Tested on a local bench at 96f34e8 (on top of #6068 at a3077e1), with openupgradelib 3.13.7 plus the change of OCA/openupgradelib#468, from a v19 database with tracked changes on partners and invoices. Same procedure as test-migration.yml, with base_setup and web kept installed.
The migration completes and the 4 tests pass. On the mail_tracking side, which I raised in #6077:
mail_trackingandmail_tracking_smsget installed, and all tracking values are kept (onlycurrency_idis deleted, as in the analysis);- the action and the menu keep their ids, and setting
message_type = 'tracking'is a nice touch I had missed; - moving the model's xmlids isn't needed after all: the
mail.*xmlids of the model and its fields are removed at the end, and the records stay, sincemail_trackinggives them its own.
Two suggestions:
-
The two views are deleted and recreated with new ids (see the line comment).
-
There is no test that the tracking values survive. These two pass on this branch, and they have to live in
scripts/mail_tracking/tests, sincemail's own tests run beforemail_trackingis loaded:data_mail_tracking_migration.py: creates a partner, commits, then changes its email and commits again (a change in the creating transaction isn't tracked);test_mail_tracking_migration.py: checks thatmail_trackingis installed and that the email change still has its tracking value, old and new.
Happy to open a PR against your branch with them.
One question: mail_tracking is only installed when there are tracking values. On a database with none, field tracking, which worked in v19, is off after the migration. Is that intended, to match a fresh 20.0 install?
@FerDeNetlab since @hbrunn opened this one, I'm reviewing here rather than opening a second mail PR.
| _renamed_xmlids = [ | ||
| ( | ||
| "mail.action_view_mail_tracking_value", | ||
| "mail_tracking.action_view_mail_tracking_value", | ||
| ), | ||
| ("mail.menu_mail_tracking_value", "mail_tracking.menu_mail_tracking_value"), | ||
| ] |
There was a problem hiding this comment.
The two views move too. Without these, they're deleted and recreated with new ids, which breaks any custom view inheriting them.
| _renamed_xmlids = [ | |
| ( | |
| "mail.action_view_mail_tracking_value", | |
| "mail_tracking.action_view_mail_tracking_value", | |
| ), | |
| ("mail.menu_mail_tracking_value", "mail_tracking.menu_mail_tracking_value"), | |
| ] | |
| _renamed_xmlids = [ | |
| ( | |
| "mail.action_view_mail_tracking_value", | |
| "mail_tracking.action_view_mail_tracking_value", | |
| ), | |
| ("mail.menu_mail_tracking_value", "mail_tracking.menu_mail_tracking_value"), | |
| ( | |
| "mail.view_mail_tracking_value_form", | |
| "mail_tracking.view_mail_tracking_value_form", | |
| ), | |
| ( | |
| "mail.view_mail_tracking_value_tree", | |
| "mail_tracking.view_mail_tracking_value_tree", | |
| ), | |
| ] |
|
@mauro2306 please ask yourself for every paragraph you paste from your bullshit generator if it has value for others to read. I'd say no for most of them. the tests you propose aren't really interesting, we don't test things for its own sake, but when in doubt or when it's likely future changes to migration scripts might affect desired behavior unintentionally. if there's a database without tracking values, it's very likely there was an effort made to make it so, which seems a good indicator such databases shouldn't have mail_tracking installed. |
depends on: