-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
[17.0][MIG] partner_contact_sale_info_propagation #3127
base: 17.0
Are you sure you want to change the base?
[17.0][MIG] partner_contact_sale_info_propagation #3127
Conversation
[UPD] Update partner_contact_sale_info_propagation.pot
…hange partner propagation. TT27986
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-16.0/sale-workflow-16.0-partner_contact_sale_info_propagation Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-partner_contact_sale_info_propagation/
Currently translated at 100.0% (1 of 1 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-partner_contact_sale_info_propagation Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-partner_contact_sale_info_propagation/de/
Currently translated at 100.0% (1 of 1 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-partner_contact_sale_info_propagation Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-partner_contact_sale_info_propagation/it/
/ocabot migration partner_contact_sale_info_propagation |
return super().create(vals_list) | ||
|
||
@api.onchange("parent_id") | ||
def onchange_parent_id(self): |
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.
IMHO, this should be changed to use the compute method instead.
See: https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/models/res_partner.py#L370
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.
Yeah you're right, ill work on it.
ca4f9a1
to
d427037
Compare
d427037
to
248a8d9
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.
Hello, thanks a lot for your pull request.
There is one question and one request change.
Great work.
childs = record.mapped("child_ids").filtered( | ||
lambda r: not r.user_id or r.user_id == record.user_id | ||
lambda r, record=record: not r.user_id | ||
or r.user_id == record.user_id | ||
) | ||
if childs: | ||
childs.write({"user_id": vals["user_id"]}) | ||
if "team_id" in vals: | ||
childs = record.mapped("child_ids").filtered( | ||
lambda r: not r.team_id or r.team_id == record.team_id | ||
lambda r, record=record: not r.team_id | ||
or r.team_id == record.team_id |
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.
Hi @Deriman-Alonso ,
Thanks a lot for your pull request.
Why are we keeping record.mapped("child_ids") and not using directly record.child_ids since record contains only one element.
If I read the documentation correctly (Doc mapped) doing record.mapped(child_ids) is equivalent to record.child_ids.
@api.onchange("parent_id") | ||
def onchange_parent_id(self): | ||
def _compute_user_id(self): |
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.
Since this commit user_id is a computed field, so its need an @api.depends and not an @api.onchange
Standart migration.