Skip to content

Commit f08439b

Browse files
committed
[MIG] mrp_subcontracting_bom_dual_use: Migration to 17.0
TT52274
1 parent a75c954 commit f08439b

File tree

5 files changed

+16
-33
lines changed

5 files changed

+16
-33
lines changed

mrp_subcontracting_bom_dual_use/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33
{
44
"name": "Mrp subcontracting bom dual use",
5-
"version": "16.0.1.0.0",
5+
"version": "17.0.1.0.0",
66
"category": "Manufacturing",
77
"website": "https://github.com/OCA/manufacture",
88
"author": "Tecnativa, Odoo Community Association (OCA)",

mrp_subcontracting_bom_dual_use/i18n/es.po

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,3 @@ msgstr ""
4141
#: model:ir.model,name:mrp_subcontracting_bom_dual_use.model_mrp_production
4242
msgid "Production Order"
4343
msgstr "Orden de producción"
44-
45-
#~ msgid "Display Name"
46-
#~ msgstr "Nombre mostrado"
47-
48-
#~ msgid "ID"
49-
#~ msgstr "ID"
50-
51-
#~ msgid "Last Modified on"
52-
#~ msgstr "Última modificación el"

mrp_subcontracting_bom_dual_use/i18n/it.po

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,3 @@ msgstr ""
4040
#: model:ir.model,name:mrp_subcontracting_bom_dual_use.model_mrp_production
4141
msgid "Production Order"
4242
msgstr "Ordine di produzione"
43-
44-
#~ msgid "Display Name"
45-
#~ msgstr "Nome visualizzato"
46-
47-
#~ msgid "ID"
48-
#~ msgstr "ID"
49-
50-
#~ msgid "Last Modified on"
51-
#~ msgstr "Ultima modifica il"

mrp_subcontracting_bom_dual_use/tests/test_mrp_subcontracting_bom_dual_use.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ def setUpClass(cls):
2828
groups="mrp.group_mrp_routings,mrp.group_mrp_manager",
2929
)
3030

31-
def _create_bom(self, bom_type):
32-
mrp_bom_form = Form(self.env["mrp.bom"])
33-
mrp_bom_form.product_tmpl_id = self.product.product_tmpl_id
31+
@classmethod
32+
def _create_bom(cls, bom_type):
33+
mrp_bom_form = Form(cls.env["mrp.bom"])
34+
mrp_bom_form.product_tmpl_id = cls.product.product_tmpl_id
3435
mrp_bom_form.type = bom_type
3536
if bom_type == "subcontract":
36-
mrp_bom_form.subcontractor_ids.add(self.partner)
37+
mrp_bom_form.subcontractor_ids.add(cls.partner)
3738
mrp_bom_form.allow_in_regular_production = True
38-
mrp_bom_form.product_tmpl_id = self.product.product_tmpl_id
39+
mrp_bom_form.product_tmpl_id = cls.product.product_tmpl_id
3940
with mrp_bom_form.bom_line_ids.new() as line_form:
40-
line_form.product_id = self.component_a
41+
line_form.product_id = cls.component_a
4142
line_form.product_qty = 1
4243
return mrp_bom_form.save()
4344

@@ -59,9 +60,10 @@ def test_mrp_production_misc_bom_subcontract(self):
5960
self.assertEqual(mrp_production_form.bom_id, bom)
6061
self.assertTrue(mrp_production_form.move_raw_ids)
6162

62-
def _product_replenish(self, product, qty):
63+
@classmethod
64+
def _product_replenish(cls, product, qty):
6365
replenish_form = Form(
64-
self.env["product.replenish"].with_context(default_product_id=product.id)
66+
cls.env["product.replenish"].with_context(default_product_id=product.id)
6567
)
6668
replenish_form.quantity = qty
6769
replenish = replenish_form.save()
@@ -75,7 +77,6 @@ def test_product_replenish(self):
7577
mrp_bom_form = Form(bom)
7678
with mrp_bom_form.operation_ids.new() as operation_form:
7779
operation_form.name = "Test operation"
78-
operation_form.bom_id = bom
7980
operation_form.workcenter_id = self.workcenter
8081
bom = mrp_bom_form.save()
8182
self._product_replenish(self.product, 1)

mrp_subcontracting_bom_dual_use/views/mrp_bom_view.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
<field name="consumption" position="after">
88
<field
99
name="allow_in_regular_production"
10-
attrs="{'invisible': [('type','!=','subcontract')]}"
10+
invisible="type!='subcontract'"
1111
/>
1212
</field>
1313
<page name="operations" position="attributes">
1414
<attribute
15-
name="attrs"
16-
>{'invisible': [('type', '=', 'subcontract'),('allow_in_regular_production','=',False)]}</attribute>
15+
name="invisible"
16+
>type!='subcontract' and not allow_in_regular_production</attribute>
1717
</page>
1818
<field name="operation_ids" position="attributes">
1919
<attribute
20-
name="attrs"
21-
>{'invisible': [('type', '=', 'subcontract'),('allow_in_regular_production','=',False)]}</attribute>
20+
name="invisible"
21+
>type=='subcontract' and not allow_in_regular_production</attribute>
2222
</field>
2323
</field>
2424
</record>

0 commit comments

Comments
 (0)