mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] mrp_bom_add: to 15.0
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
'name': 'BoM Mass Add',
|
'name': 'BoM Mass Add',
|
||||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||||
'category': 'Hidden',
|
'category': 'Hidden',
|
||||||
'version': '13.0.1.1.0',
|
'version': '15.0.1.0.0',
|
||||||
'description':
|
'description':
|
||||||
"""
|
"""
|
||||||
Bill of Materials Mass Component Adder
|
Bill of Materials Mass Component Adder
|
||||||
@@ -18,10 +18,10 @@ to allow you to quickly re-configure qty or operation for bulk products.
|
|||||||
""",
|
""",
|
||||||
'depends': [
|
'depends': [
|
||||||
'mrp',
|
'mrp',
|
||||||
'sale',
|
|
||||||
],
|
],
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
'data': [
|
'data': [
|
||||||
|
'security/ir.model.access.csv',
|
||||||
'wizard/mrp_bom_add_views.xml',
|
'wizard/mrp_bom_add_views.xml',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
2
mrp_bom_add/security/ir.model.access.csv
Normal file
2
mrp_bom_add/security/ir.model.access.csv
Normal 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
|
||||||
|
@@ -8,7 +8,7 @@ class TestMRPBOMAdd(TransactionCase):
|
|||||||
self.attr1 = self.env['product.attribute'].create({
|
self.attr1 = self.env['product.attribute'].create({
|
||||||
'name': 'Test Attr1',
|
'name': 'Test Attr1',
|
||||||
'create_variant': 'always',
|
'create_variant': 'always',
|
||||||
'type': 'radio',
|
'display_type': 'radio',
|
||||||
})
|
})
|
||||||
self.attr1_val1 = self.env['product.attribute.value'].create({
|
self.attr1_val1 = self.env['product.attribute.value'].create({
|
||||||
'attribute_id': self.attr1.id,
|
'attribute_id': self.attr1.id,
|
||||||
@@ -22,7 +22,7 @@ class TestMRPBOMAdd(TransactionCase):
|
|||||||
self.attr2 = self.env['product.attribute'].create({
|
self.attr2 = self.env['product.attribute'].create({
|
||||||
'name': 'Test Attr2',
|
'name': 'Test Attr2',
|
||||||
'create_variant': 'always',
|
'create_variant': 'always',
|
||||||
'type': 'radio',
|
'display_type': 'radio',
|
||||||
})
|
})
|
||||||
self.attr2_val1 = self.env['product.attribute.value'].create({
|
self.attr2_val1 = self.env['product.attribute.value'].create({
|
||||||
'attribute_id': self.attr2.id,
|
'attribute_id': self.attr2.id,
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ class ProgramOutputView(models.TransientModel):
|
|||||||
compute='_compute_variant_count')
|
compute='_compute_variant_count')
|
||||||
product_qty = fields.Float(string='Quantity to Consume', default=1.0)
|
product_qty = fields.Float(string='Quantity to Consume', default=1.0)
|
||||||
product_uom_id = fields.Many2one('uom.uom', string='Consume Unit of Measure')
|
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')
|
@api.depends('product_tmpl_id', 'limit_possible')
|
||||||
def _compute_variant_count(self):
|
def _compute_variant_count(self):
|
||||||
@@ -81,6 +79,5 @@ class ProgramOutputView(models.TransientModel):
|
|||||||
'product_uom_id': self.product_uom_id.id,
|
'product_uom_id': self.product_uom_id.id,
|
||||||
'bom_product_template_attribute_value_ids': [(4, a.id, 0)
|
'bom_product_template_attribute_value_ids': [(4, a.id, 0)
|
||||||
for a in bom_product_template_attribute_value_ids],
|
for a in bom_product_template_attribute_value_ids],
|
||||||
'operation_id': self.operation_id.id,
|
|
||||||
}))
|
}))
|
||||||
self.bom_id.write({'bom_line_ids': lines})
|
self.bom_id.write({'bom_line_ids': lines})
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="bom_id" invisible="1"/>
|
<field name="bom_id" invisible="1"/>
|
||||||
<field name="bom_product_tmpl_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="product_tmpl_id"/>
|
||||||
<field name="limit_possible"/>
|
<field name="limit_possible"/>
|
||||||
<field name="product_variant_count"/>
|
<field name="product_variant_count"/>
|
||||||
@@ -20,7 +19,6 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="product_qty"/>
|
<field name="product_qty"/>
|
||||||
<field name="product_uom_id"/>
|
<field name="product_uom_id"/>
|
||||||
<field name="operation_id" domain="[('routing_id', '=', bom_routing_id)]"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user