Skip to content

[19.0][MIG] purchase_lot: Migration to 19.0#3071

Open
apami0111 wants to merge 22 commits into
OCA:19.0from
apami0111:19.0-mig-purchase_lot
Open

[19.0][MIG] purchase_lot: Migration to 19.0#3071
apami0111 wants to merge 22 commits into
OCA:19.0from
apami0111:19.0-mig-purchase_lot

Conversation

@apami0111

Copy link
Copy Markdown
Contributor

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.

@apami0111 apami0111 force-pushed the 19.0-mig-purchase_lot branch from 902ac77 to 94bc6b5 Compare May 23, 2026 21:15

@Yoana-RB Yoana-RB left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional review LGTM :)

@celm1990 celm1990 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash the administrative commits

Comment thread purchase_lot/tests/test_purchase_lot.py Outdated
Comment on lines +103 to +111
(
0,
0,
{
"product_id": self.large_cabinet.id,
"product_qty": 1.0,
"lot_id": self.lot1.id,
},
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(
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,
},
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@celm1990 Thank you for the feedback! I have squashed the administrative commits
and updated the code to use Command.create as suggested.

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when using BaseCommon, there’s no need to create a res.partner record manually.

Comment thread purchase_lot/tests/test_purchase_lot.py Outdated
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner_id = cls.env["res.partner"].create({"name": "Test Supplier"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cls.partner_id = cls.env["res.partner"].create({"name": "Test Supplier"})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BhaveshHeliconia Thank you for pointing that out! I have removed the manual res.partner
creation and replaced it with self.partner provided by BaseCommon.

florian-dacosta and others added 15 commits June 8, 2026 21:45
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/
@apami0111 apami0111 force-pushed the 19.0-mig-purchase_lot branch from 94bc6b5 to a25d5e6 Compare June 9, 2026 02:48
Fix end of file in test-requirements.txt

Fix test-requirements.txt to use 19.0 branch for stock_restrict_lot

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review LGTM!

Comment on lines +15 to +20
cls.large_cabinet = cls.env["product.product"].create(
{
"name": "Test Product Lot",
"type": "consu",
}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This product must be storable and tracked by lot. Instead of setting these fields below, please define them directly here.

Suggested change
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)]
}
)

Comment on lines +26 to +31
cls.large_cabinet.write(
{
"route_ids": [(4, buy_route.id, 0), (4, mto_route.id, 0)],
"tracking": "lot",
}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cls.large_cabinet.write(
{
"route_ids": [(4, buy_route.id, 0), (4, mto_route.id, 0)],
"tracking": "lot",
}
)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.