flectra/addons/mrp/data/mrp_lot_demo.yml
flectra-admin 769eafb483 [INIT] Inception of Flectra from Odoo
Flectra is Forked from Odoo v11 commit : (6135e82d73)
2018-01-16 11:45:59 +05:30

13 lines
594 B
YAML

-
!python {model: mrp.production, id: mrp_production_laptop_cust}: |
if self.state != 'done':
self.action_assign()
wiz_obj = self.env['mrp.product.produce']
ctx = dict(self.env.context, active_id=self.id)
produce_wiz = wiz_obj.with_context(ctx).create({'product_qty': self.product_qty, 'lot_id': ref('lot_product_27_0')})
produce_wiz.produce_line_ids.write({'qty_done': produce_wiz.product_qty})
#Produce Product,Post Inventory and Set MO Done.
produce_wiz.do_produce()
self.post_inventory()
self.button_mark_done()