[16.0][MIG] sale_mrp_link: Migration to 16.0 (from 12.0)#3339
[16.0][MIG] sale_mrp_link: Migration to 16.0 (from 12.0)#3339legalsylvain wants to merge 28 commits intoOCA:16.0from
Conversation
|
/ocabot migration sale_mrp_link |
| if "origin" in values: | ||
| # Checking first if this comes from a 'sale.order' | ||
| sale_id = self.env["sale.order"].search( | ||
| [("name", "=", values["origin"])], limit=1 | ||
| ) | ||
| if sale_id: | ||
| values["sale_order_id"] = sale_id.id | ||
| if sale_id.client_order_ref: | ||
| values["origin"] = sale_id.client_order_ref | ||
| else: | ||
| # Checking if this production comes from a route | ||
| production_id = self.env["mrp.production"].search( | ||
| [("name", "=", values["origin"])] | ||
| ) | ||
| # If so, use the 'sale_order_id' from the parent production | ||
| values["sale_order_id"] = production_id.sale_order_id.id | ||
|
|
There was a problem hiding this comment.
sale_order_id should not be overridden if already set (by third-party module)
Maybe add a check before:
if "origin" in values and not values.get("sale_order_id"):
Or browse the sale_id first and keep existing code:
if "origin" in values:
# Checking first if this comes from a 'sale.order'
sale_id = self.env["sale.order"].browse(values.get("sale_order_id"))
if not sale_id:
sale_id = self.env["sale.order"].search(
[("name", "=", values["origin"])], limit=1
)
|
@legalsylvain What's the status of this ? |
|
Not sure to know how to finish this work. I didn't developped the module at the beginning, and I'm not sure to know how to address @ypapouin remark, as it is about code I didn't written. feel free to finish ! |
|
@legalsylvain , just replacing |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
… with sale_mrp_link
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/
As mrp.production already has a Many2one field pointing to sale.order it makes sense to have a One2many on the "other side". This adds multiple benefits: - Easier to open linked production with the smart button action - Simpler production count computing (also now can store the result) - Dependent modules can use the One2many field for other purposes
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/
Currently translated at 100.0% (5 of 5 strings) Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/fr/
Currently translated at 100.0% (5 of 5 strings) Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/es/
Currently translated at 100.0% (5 of 5 strings) Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/ca/
Currently translated at 100.0% (5 of 5 strings) Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/tr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-12.0/sale-workflow-12.0-sale_mrp_link Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_mrp_link/
…third-party module
f07d426 to
7f928a4
Compare
|
Hi @ypapouin and @rousseldenis. Sorry for the late. PR finished and rebased. Could you finish your review ? Updated : tests are failing. no need to review for the time being. thanks ! |
|
In fact, the feature is now native. closing. odoo/odoo#43366 you can review This OpenUpgrade PR : OCA/OpenUpgrade#5562 |
No description provided.