mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MIG mrp_bom_add For Odoo 13.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': '12.0.1.1.0',
|
'version': '13.0.1.1.0',
|
||||||
'description':
|
'description':
|
||||||
"""
|
"""
|
||||||
Bill of Materials Mass Component Adder
|
Bill of Materials Mass Component Adder
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class ProgramOutputView(models.TransientModel):
|
|||||||
bom_routing_id = fields.Many2one('mrp.routing', related='bom_id.routing_id')
|
bom_routing_id = fields.Many2one('mrp.routing', related='bom_id.routing_id')
|
||||||
operation_id = fields.Many2one('mrp.routing.workcenter', 'Consume in Operation')
|
operation_id = fields.Many2one('mrp.routing.workcenter', 'Consume in Operation')
|
||||||
|
|
||||||
@api.multi
|
|
||||||
@api.depends('product_tmpl_id', 'limit_possible')
|
@api.depends('product_tmpl_id', 'limit_possible')
|
||||||
def _compute_variant_count(self):
|
def _compute_variant_count(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
@@ -54,9 +53,7 @@ class ProgramOutputView(models.TransientModel):
|
|||||||
values = self._compute_attribute_value_ids()
|
values = self._compute_attribute_value_ids()
|
||||||
products = self.env['product.product']
|
products = self.env['product.product']
|
||||||
for p in self.product_tmpl_id.product_variant_ids:
|
for p in self.product_tmpl_id.product_variant_ids:
|
||||||
if not p.attribute_value_ids.filtered(lambda a: a not in values):
|
products += p
|
||||||
# This product's attribute values are in the values set.
|
|
||||||
products += p
|
|
||||||
return products
|
return products
|
||||||
|
|
||||||
def _compute_existing_line_ids(self):
|
def _compute_existing_line_ids(self):
|
||||||
@@ -78,7 +75,6 @@ class ProgramOutputView(models.TransientModel):
|
|||||||
'product_id': p.id,
|
'product_id': p.id,
|
||||||
'product_qty': self.product_qty,
|
'product_qty': self.product_qty,
|
||||||
'product_uom_id': self.product_uom_id.id,
|
'product_uom_id': self.product_uom_id.id,
|
||||||
'attribute_value_ids': [(4, a.id, 0) for a in p.attribute_value_ids if a in attribute_values],
|
|
||||||
'operation_id': self.operation_id.id,
|
'operation_id': self.operation_id.id,
|
||||||
}))
|
}))
|
||||||
self.bom_id.write({'bom_line_ids': lines})
|
self.bom_id.write({'bom_line_ids': lines})
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
<record id="action_mrp_bom_add" model="ir.actions.act_window">
|
<record id="action_mrp_bom_add" model="ir.actions.act_window">
|
||||||
<field name="name">Add to Bill of Materials</field>
|
<field name="name">Add to Bill of Materials</field>
|
||||||
<field name="res_model">mrp.bom.add</field>
|
<field name="res_model">mrp.bom.add</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_mrp_bom_add_form_view"/>
|
<field name="view_id" ref="view_mrp_bom_add_form_view"/>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user