Skip to content

Commit 9e28061

Browse files
[MIG] sale_mrp_bom: Migration to 19.0
1 parent 05dbaae commit 9e28061

File tree

11 files changed

+40
-31
lines changed

11 files changed

+40
-31
lines changed

sale_mrp_bom/README.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Sale MRP BOM
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
24-
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_mrp_bom
24+
:target: https://github.com/OCA/sale-workflow/tree/19.0/sale_mrp_bom
2525
:alt: OCA/sale-workflow
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_mrp_bom
27+
:target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_mrp_bom
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -66,8 +66,8 @@ production order will be using the specified Bill Of Materials.
6666

6767
|image2|
6868

69-
.. |image1| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_mrp_bom/static/description/sale_order_1.png
70-
.. |image2| image:: https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_mrp_bom/static/description/manufacturing_order_1.png
69+
.. |image1| image:: https://raw.githubusercontent.com/OCA/sale-workflow/19.0/sale_mrp_bom/static/description/sale_order_1.png
70+
.. |image2| image:: https://raw.githubusercontent.com/OCA/sale-workflow/19.0/sale_mrp_bom/static/description/manufacturing_order_1.png
7171

7272
Known issues / Roadmap
7373
======================
@@ -80,7 +80,7 @@ Bug Tracker
8080
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
8181
In case of trouble, please check there if your issue has already been reported.
8282
If you spotted it first, help us to smash it by providing a detailed and welcomed
83-
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_mrp_bom%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
83+
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_mrp_bom%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
8484

8585
Do not contact contributors directly about support or help with technical issues.
8686

@@ -101,6 +101,8 @@ Trobz:
101101

102102
- Hai Lang <hailn@trobz.com>
103103

104+
- Jasmin Solanki <jasmin.solanki@forgeflow.com>
105+
104106
Other credits
105107
-------------
106108

@@ -120,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
120122
mission is to support the collaborative development of Odoo features and
121123
promote its widespread use.
122124

123-
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_mrp_bom>`_ project on GitHub.
125+
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_mrp_bom>`_ project on GitHub.
124126

125127
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sale_mrp_bom/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"category": "Sale",
66
"license": "AGPL-3",
77
"author": "Akretion, Odoo Community Association (OCA)",
8-
"version": "18.0.1.0.0",
8+
"version": "19.0.1.0.0",
99
"website": "https://github.com/OCA/sale-workflow",
1010
"summary": "Allows define a BOM in the sales lines.",
1111
"depends": ["mrp", "sale_stock"],

sale_mrp_bom/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
22

3-
from . import procurement_group
3+
from . import stock_rule
44
from . import sale_order_line
55
from . import stock_move

sale_mrp_bom/models/sale_order_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2020 Akretion Renato Lima <renato.lima@akretion.com.br>
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

4-
from odoo import _, api, fields, models
4+
from odoo import api, fields, models
55
from odoo.exceptions import ValidationError
66

77

@@ -29,7 +29,7 @@ def _check_match_product_variant_ids(self):
2929
if not bom_product and bom_product_tmpl == line.product_template_id:
3030
continue
3131
raise ValidationError(
32-
_(
32+
self.env._(
3333
"Please select a BoM that matches the product %(product)s",
3434
product=line.product_id.display_name,
3535
)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Copyright 2025 360ERP (<https://www.360erp.com>)
2-
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
1+
# Copyright 2026 ForgeFlow, S.L.
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

44
from odoo import api, models
55

66

7-
class ProcurementGroup(models.Model):
8-
_inherit = "procurement.group"
7+
class StockRule(models.Model):
8+
_inherit = "stock.rule"
99

1010
@api.model
1111
def run(self, procurements, raise_user_error=True):
@@ -79,7 +79,7 @@ def run(self, procurements, raise_user_error=True):
7979
)
8080
)
8181
procurements_without_kit.append(
82-
self.env["procurement.group"].Procurement(
82+
self.env["stock.rule"].Procurement(
8383
bom_line.product_id,
8484
component_qty,
8585
procurement_uom,

sale_mrp_bom/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
Trobz:
44

55
- Hai Lang \<<hailn@trobz.com>\>
6+
7+
- Jasmin Solanki \<<jasmin.solanki@forgeflow.com>\>

sale_mrp_bom/security/security.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
<odoo noupdate="1">
33
<record id="sale_mrp_bom_group" model="res.groups">
44
<field name="name">Allows to define a BOM on sale order lines</field>
5-
<field name="category_id" ref="base.module_category_hidden" />
65
</record>
76
</odoo>

sale_mrp_bom/static/description/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Sale MRP BOM</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:63cc33af1668c7019325079317e92367d731d9ccd088c6df0049d6c5c100f4fc
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_mrp_bom"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_mrp_bom"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/19.0/sale_mrp_bom"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_mrp_bom"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This modules allows to specify a Bill Of Materials directly inside a
379379
sale order line. It is specially useful to select alternative
380380
manufacturing and sub-contracting routings.</p>
@@ -408,10 +408,10 @@ <h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
408408
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
409409
<p>When adding a new sale order line, you can eventually select a specific
410410
Bill Of Materials.</p>
411-
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_mrp_bom/static/description/sale_order_1.png" /></p>
411+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/sale-workflow/19.0/sale_mrp_bom/static/description/sale_order_1.png" /></p>
412412
<p>When confirming the sale order, if the routing is manufacturing then the
413413
production order will be using the specified Bill Of Materials.</p>
414-
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/sale-workflow/18.0/sale_mrp_bom/static/description/manufacturing_order_1.png" /></p>
414+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/sale-workflow/19.0/sale_mrp_bom/static/description/manufacturing_order_1.png" /></p>
415415
</div>
416416
<div class="section" id="known-issues-roadmap">
417417
<h2><a class="toc-backref" href="#toc-entry-4">Known issues / Roadmap</a></h2>
@@ -421,7 +421,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h2>
421421
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
422422
In case of trouble, please check there if your issue has already been reported.
423423
If you spotted it first, help us to smash it by providing a detailed and welcomed
424-
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_mrp_bom%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
424+
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_mrp_bom%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
425425
<p>Do not contact contributors directly about support or help with technical issues.</p>
426426
</div>
427427
<div class="section" id="credits">
@@ -440,6 +440,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Contributors</a></h3>
440440
<p>Trobz:</p>
441441
<ul class="simple">
442442
<li>Hai Lang &lt;<a class="reference external" href="mailto:hailn&#64;trobz.com">hailn&#64;trobz.com</a>&gt;</li>
443+
<li>Jasmin Solanki &lt;<a class="reference external" href="mailto:jasmin.solanki&#64;forgeflow.com">jasmin.solanki&#64;forgeflow.com</a>&gt;</li>
443444
</ul>
444445
</div>
445446
<div class="section" id="other-credits">
@@ -456,7 +457,7 @@ <h3><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h3>
456457
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
457458
mission is to support the collaborative development of Odoo features and
458459
promote its widespread use.</p>
459-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_mrp_bom">OCA/sale-workflow</a> project on GitHub.</p>
460+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/19.0/sale_mrp_bom">OCA/sale-workflow</a> project on GitHub.</p>
460461
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
461462
</div>
462463
</div>

sale_mrp_bom/tests/test_sale_mrp_bom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class TestSaleMrpLink(TransactionCase):
99
@classmethod
1010
def setUpClass(cls):
1111
super().setUpClass()
12-
cls.partner = cls.env.ref("base.res_partner_2")
12+
cls.partner = cls.env["res.partner"].create(
13+
{"name": "Test Customer"}
14+
) # Customer
1315
cls.warehouse = cls.env.ref("stock.warehouse0")
1416
route_manufacture = cls.warehouse.manufacture_pull_id.route_id.id
1517
route_mto = cls.warehouse.mto_pull_id.route_id.id

sale_mrp_bom/tests/test_sale_mrp_bom_multi_line.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright 2025 360ERP (https://www.360erp.com)
2-
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

44
from odoo.tests.common import TransactionCase
55

@@ -29,8 +29,8 @@ def setUpClass(cls):
2929
cls.company = cls.env.company
3030

3131
# Required groups
32-
cls.env.user.groups_id += cls.env.ref("stock.group_adv_location")
33-
cls.env.user.groups_id += cls.env.ref("sale_mrp_bom.sale_mrp_bom_group")
32+
cls.env.user.group_ids += cls.env.ref("stock.group_adv_location")
33+
cls.env.user.group_ids += cls.env.ref("sale_mrp_bom.sale_mrp_bom_group")
3434

3535
# Ensure MTO Route is Active
3636
cls.mto_route = cls.env.ref(
@@ -40,13 +40,14 @@ def setUpClass(cls):
4040
cls.mto_route.action_unarchive()
4141

4242
# Products
43+
cls.categ = cls.env["product.category"].create({"name": "Test Category"})
4344
cls.product_mtokit = cls.env["product.product"].create(
4445
[
4546
{
4647
"name": "MTOKIT",
4748
"type": "consu",
4849
"route_ids": [(6, 0, [cls.mto_route.id])],
49-
"categ_id": cls.env.ref("product.product_category_all").id,
50+
"categ_id": cls.categ.id,
5051
}
5152
]
5253
)
@@ -56,7 +57,7 @@ def setUpClass(cls):
5657
"name": "MTOCOMP",
5758
"type": "consu",
5859
"route_ids": [],
59-
"categ_id": cls.env.ref("product.product_category_all").id,
60+
"categ_id": cls.categ.id,
6061
}
6162
]
6263
)
@@ -103,7 +104,9 @@ def setUpClass(cls):
103104
]
104105
)
105106

106-
cls.partner = cls.env.ref("base.res_partner_2") # Customer
107+
cls.partner = cls.env["res.partner"].create(
108+
{"name": "Test Customer"}
109+
) # Customer
107110
cls.warehouse = cls.env.ref("stock.warehouse0")
108111

109112
def _create_sale_order(self, partner):
@@ -126,7 +129,7 @@ def _create_sale_order_line(self, sale_order, product, qty, bom):
126129
"product_id": product.id,
127130
"product_uom_qty": qty,
128131
"bom_id": bom.id,
129-
"product_uom": product.uom_id.id,
132+
"product_uom_id": product.uom_id.id,
130133
"price_unit": 1,
131134
}
132135
]

0 commit comments

Comments
 (0)