Skip to content
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

Fix multicompany style for 13.0 #37

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions odoo_module_migrate/migration_scripts/migrate_120_130.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@
r"\.sudo\((?P<user>[^/)]+?)\)": r".with_user(\g<user>)",
r"\.suspend_security": ".sudo",
r"\"base_suspend_security\",\n": "",
r"self.env.user.company_id": r"self.env.company"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be done in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In two separate PRs? It wouldn't make much sense to pass one without the other. The multi-company style requires both changes. This is so unless you have not understood something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that this part of the change is easier to check and merge.

Basically, all migration scripts have to be applied at the same time, but that doesn't mean that we can add all the scripts in a single PR.
I understand when we have two changes in py and xml and one doesn't work without another. But it seems not the case. Both changes are about multi-company, but they don't depend on each other

},
".xml": {
r"( |\t)*<field name=('|\")view_type('|\")>.*</field>\n": "",
r"src_model": "binding_model",
r"( |\t)*<field name=('|\")domain_force('|\")>"
r".*company_id.*child_of.*</field>\n":
r"\t\t<field name=\2domain_force\2>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't force people to use \t for indent

r"['|',('company_id','=',False),"
r"('company_id', 'in', company_ids)]</field>\n"
}
}