-
-
Notifications
You must be signed in to change notification settings - Fork 702
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
[16.0][FIX] product_supplierinfo_stock_picking_type: rename on change picking type method #1777
base: 16.0
Are you sure you want to change the base?
[16.0][FIX] product_supplierinfo_stock_picking_type: rename on change picking type method #1777
Conversation
Hi @victoralmau, |
5c9f2eb
to
7e35f92
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.
makes sense 👍🏿
… picking type method
7e35f92
to
476055a
Compare
def onchange_picking_type_id(self): | ||
def onchange_picking_type_id_onchange_product(self): | ||
# Method name is to avoid conflicts with mrp_subcontracting_dropshipping | ||
# that have an onchange method named onchange_picking_type_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.
I think you can keep the same method but call the super if the method exists.
if hasattr(super(), "onchange_picking_type_id"):
getattr(super(), "onchange_picking_type_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 @victoralmau !
No, as I already mentioned, the Odoo function is overriding the method, so in the module hierarchy, product_supplierinfo_stock_picking_type comes before mrp_subcontracting_dropshipping. For this reason, the method is being overridden. To implement your solution, we would need to add it to Odoo's method.
If module mrp_subcontracting_dropshipping, form Odoo, is installed in our system, there are conflicts between onchange methods, mrp_subcontracting_dropshipping method https://github.com/odoo/odoo/blob/16.0/addons/mrp_subcontracting_dropshipping/models/purchase.py#L23 is overriding the onchange method previously defined in this module. So I suggest renaming the onchange method.