[19.0][MIG] purchase_lot: Migration to 19.0#3071
Conversation
902ac77 to
94bc6b5
Compare
celm1990
left a comment
There was a problem hiding this comment.
Please squash the administrative commits
| ( | ||
| 0, | ||
| 0, | ||
| { | ||
| "product_id": self.large_cabinet.id, | ||
| "product_qty": 1.0, | ||
| "lot_id": self.lot1.id, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
| ( | |
| 0, | |
| 0, | |
| { | |
| "product_id": self.large_cabinet.id, | |
| "product_qty": 1.0, | |
| "lot_id": self.lot1.id, | |
| }, | |
| ) | |
| Command.create( | |
| { | |
| "product_id": self.large_cabinet.id, | |
| "product_qty": 1.0, | |
| "lot_id": self.lot1.id, | |
| }, | |
| ) |
There was a problem hiding this comment.
@celm1990 Thank you for the feedback! I have squashed the administrative commits
and updated the code to use Command.create as suggested.
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
when using BaseCommon, there’s no need to create a res.partner record manually.
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.partner_id = cls.env["res.partner"].create({"name": "Test Supplier"}) |
There was a problem hiding this comment.
| cls.partner_id = cls.env["res.partner"].create({"name": "Test Supplier"}) |
There was a problem hiding this comment.
@BhaveshHeliconia Thank you for pointing that out! I have removed the manual res.partner
creation and replaced it with self.partner provided by BaseCommon.
Translated using Weblate (Spanish) Currently translated at 100.0% (3 of 3 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_lot Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_lot/es/
Translated using Weblate (Italian) Currently translated at 100.0% (3 of 3 strings) Translation: purchase-workflow-16.0/purchase-workflow-16.0-purchase_lot Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_lot/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_lot Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_lot/
Currently translated at 100.0% (5 of 5 strings) Translation: purchase-workflow-17.0/purchase-workflow-17.0-purchase_lot Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-17-0/purchase-workflow-17-0-purchase_lot/it/
Currently translated at 80.0% (4 of 5 strings) Translation: purchase-workflow-18.0/purchase-workflow-18.0-purchase_lot Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_lot/hr/
94bc6b5 to
a25d5e6
Compare
Fix end of file in test-requirements.txt Fix test-requirements.txt to use 19.0 branch for stock_restrict_lot
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
Code review LGTM!
| cls.large_cabinet = cls.env["product.product"].create( | ||
| { | ||
| "name": "Test Product Lot", | ||
| "type": "consu", | ||
| } | ||
| ) |
There was a problem hiding this comment.
This product must be storable and tracked by lot. Instead of setting these fields below, please define them directly here.
| cls.large_cabinet = cls.env["product.product"].create( | |
| { | |
| "name": "Test Product Lot", | |
| "type": "consu", | |
| } | |
| ) | |
| cls.large_cabinet = cls.env["product.product"].create( | |
| { | |
| "name": "Test Product Lot", | |
| "type": "consu", | |
| "is_storable": True, | |
| "tracking": "lot", | |
| "route_ids": [Command.link(buy_route.id), Command.link(mto_route.id)] | |
| } | |
| ) |
| cls.large_cabinet.write( | ||
| { | ||
| "route_ids": [(4, buy_route.id, 0), (4, mto_route.id, 0)], | ||
| "tracking": "lot", | ||
| } | ||
| ) |
There was a problem hiding this comment.
| cls.large_cabinet.write( | |
| { | |
| "route_ids": [(4, buy_route.id, 0), (4, mto_route.id, 0)], | |
| "tracking": "lot", | |
| } | |
| ) |
Migrates purchase_lot from 18.0 to 19.0.
The models and views required no changes.
Tests were updated to reflect Odoo 19.0 API changes in stock models
and to remove dependencies on demo data.