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

[17.0][MIG] partner_contact_sale_info_propagation #3127

Open
wants to merge 20 commits into
base: 17.0
Choose a base branch
from

Conversation

Deriman-Alonso
Copy link
Member

Standart migration.

ernestotejeda and others added 19 commits May 8, 2024 13:38
[UPD] Update partner_contact_sale_info_propagation.pot
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/
@Deriman-Alonso Deriman-Alonso mentioned this pull request May 8, 2024
67 tasks
@pedrobaeza
Copy link
Member

/ocabot migration partner_contact_sale_info_propagation

return super().create(vals_list)

@api.onchange("parent_id")
def onchange_parent_id(self):
Copy link
Sponsor Contributor

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

Copy link
Member Author

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.

@Deriman-Alonso Deriman-Alonso force-pushed the 17.0-mig-partner_contact_sale_info_propagation branch 2 times, most recently from ca4f9a1 to d427037 Compare May 14, 2024 19:56
@Deriman-Alonso Deriman-Alonso force-pushed the 17.0-mig-partner_contact_sale_info_propagation branch from d427037 to 248a8d9 Compare May 14, 2024 20:09
Copy link
Member

@FrancoMaxime FrancoMaxime left a 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.

Comment on lines 27 to 36
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
Copy link
Member

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.

Comment on lines 54 to 55
@api.onchange("parent_id")
def onchange_parent_id(self):
def _compute_user_id(self):
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet