mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MIG mrp_production_add For Odoo 13.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'MRP Production Add Item',
|
'name': 'MRP Production Add Item',
|
||||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||||
'version': '12.0.1.0.0',
|
'version': '13.0.1.0.0',
|
||||||
'category': 'Manufacturing',
|
'category': 'Manufacturing',
|
||||||
'summary': 'Add Items to an existing Production',
|
'summary': 'Add Items to an existing Production',
|
||||||
'description': """
|
'description': """
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class AddProductionItem(models.TransientModel):
|
|||||||
else:
|
else:
|
||||||
item.product_uom_id = False
|
item.product_uom_id = False
|
||||||
|
|
||||||
@api.multi
|
|
||||||
def add_item(self):
|
def add_item(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
if item.product_qty <= 0:
|
if item.product_qty <= 0:
|
||||||
@@ -42,8 +41,8 @@ class AddProductionItem(models.TransientModel):
|
|||||||
'product_uom_id': item.product_uom_id.id,
|
'product_uom_id': item.product_uom_id.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
move = item.production_id._generate_raw_move(bom_line, {'qty': item.product_qty, 'parent_line': None})
|
move = item.production_id._get_move_raw_values(bom_line, {'qty': item.product_qty, 'parent_line': None})
|
||||||
item.production_id._adjust_procure_method()
|
move = self.env['stock.move'].create(move)
|
||||||
move.write({'unit_factor': 0.0})
|
move.write({'unit_factor': 0.0})
|
||||||
move._action_confirm()
|
move._action_confirm()
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
<record id="action_add_production_item" model="ir.actions.act_window">
|
<record id="action_add_production_item" model="ir.actions.act_window">
|
||||||
<field name="name">Add Item View</field>
|
<field name="name">Add Item View</field>
|
||||||
<field name="res_model">wiz.add.production.item</field>
|
<field name="res_model">wiz.add.production.item</field>
|
||||||
<field name="view_type">form</field>
|
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="view_id" ref="view_create_add_production_item" />
|
<field name="view_id" ref="view_create_add_production_item" />
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user