[MIG] mrp_bom_add: to 15.0

This commit is contained in:
Jared Kipe
2022-06-01 19:29:57 +00:00
parent fa5f6afa84
commit 9d69ae88a7
5 changed files with 6 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
'name': 'BoM Mass Add',
'author': 'Hibou Corp. <hello@hibou.io>',
'category': 'Hidden',
'version': '13.0.1.1.0',
'version': '15.0.1.0.0',
'description':
"""
Bill of Materials Mass Component Adder
@@ -18,10 +18,10 @@ to allow you to quickly re-configure qty or operation for bulk products.
""",
'depends': [
'mrp',
'sale',
],
'auto_install': False,
'data': [
'security/ir.model.access.csv',
'wizard/mrp_bom_add_views.xml',
],
}

View File

@@ -0,0 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_mrp_bom_add","access mrp.bom.add","mrp_bom_add.model_mrp_bom_add","base.group_user",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_mrp_bom_add access mrp.bom.add mrp_bom_add.model_mrp_bom_add base.group_user 1 1 1 1

View File

@@ -8,7 +8,7 @@ class TestMRPBOMAdd(TransactionCase):
self.attr1 = self.env['product.attribute'].create({
'name': 'Test Attr1',
'create_variant': 'always',
'type': 'radio',
'display_type': 'radio',
})
self.attr1_val1 = self.env['product.attribute.value'].create({
'attribute_id': self.attr1.id,
@@ -22,7 +22,7 @@ class TestMRPBOMAdd(TransactionCase):
self.attr2 = self.env['product.attribute'].create({
'name': 'Test Attr2',
'create_variant': 'always',
'type': 'radio',
'display_type': 'radio',
})
self.attr2_val1 = self.env['product.attribute.value'].create({
'attribute_id': self.attr2.id,

View File

@@ -18,8 +18,6 @@ class ProgramOutputView(models.TransientModel):
compute='_compute_variant_count')
product_qty = fields.Float(string='Quantity to Consume', default=1.0)
product_uom_id = fields.Many2one('uom.uom', string='Consume Unit of Measure')
bom_routing_id = fields.Many2one('mrp.routing', related='bom_id.routing_id')
operation_id = fields.Many2one('mrp.routing.workcenter', 'Consume in Operation')
@api.depends('product_tmpl_id', 'limit_possible')
def _compute_variant_count(self):
@@ -81,6 +79,5 @@ class ProgramOutputView(models.TransientModel):
'product_uom_id': self.product_uom_id.id,
'bom_product_template_attribute_value_ids': [(4, a.id, 0)
for a in bom_product_template_attribute_value_ids],
'operation_id': self.operation_id.id,
}))
self.bom_id.write({'bom_line_ids': lines})

View File

@@ -10,7 +10,6 @@
<group>
<field name="bom_id" invisible="1"/>
<field name="bom_product_tmpl_id" invisible="1"/>
<field name="bom_routing_id" invisible="1"/>
<field name="product_tmpl_id"/>
<field name="limit_possible"/>
<field name="product_variant_count"/>
@@ -20,7 +19,6 @@
<group>
<field name="product_qty"/>
<field name="product_uom_id"/>
<field name="operation_id" domain="[('routing_id', '=', bom_routing_id)]"/>
</group>
</group>
<footer>