diff --git a/addons/mrp/__manifest__.py b/addons/mrp/__manifest__.py index 9766a88bf58..d0ce94ee814 100644 --- a/addons/mrp/__manifest__.py +++ b/addons/mrp/__manifest__.py @@ -15,7 +15,6 @@ 'security/mrp_security.xml', 'security/ir.model.access.csv', 'data/mrp_data.xml', - 'data/mrp_data.yml', 'wizard/mrp_product_produce_views.xml', 'wizard/change_production_qty_views.xml', 'wizard/mrp_workcenter_block_view.xml', @@ -44,7 +43,7 @@ ], 'demo': [ 'data/mrp_demo.xml', - 'data/mrp_lot_demo.yml'], + ], 'qweb': ['static/src/xml/mrp.xml'], 'test': [], 'application': True, diff --git a/addons/mrp/data/mrp_data.xml b/addons/mrp/data/mrp_data.xml index 85fffdb3bd9..771c3c3ca46 100644 --- a/addons/mrp/data/mrp_data.xml +++ b/addons/mrp/data/mrp_data.xml @@ -82,5 +82,22 @@ 0 + + + + + + + + stock.picking.type + mrp + picking_type_manufacturing + + diff --git a/addons/mrp/data/mrp_data.yml b/addons/mrp/data/mrp_data.yml deleted file mode 100644 index cc69bbe175b..00000000000 --- a/addons/mrp/data/mrp_data.yml +++ /dev/null @@ -1,13 +0,0 @@ -- - !python {model: ir.model.data, id: False}: | - warehouse = self.env['stock.warehouse'].browse(ref('stock.warehouse0')) - #create xml ids for demo data that are widely used in tests or in other codes, for more convenience - xml_references = [ - {'name':'picking_type_manufacturing','module':'mrp', 'model':'stock.picking.type','res_id': warehouse.manu_type_id.id}, - ] - for xml_record in xml_references: - xml_ids = self.search([('module', '=', xml_record['module']), ('model', '=', xml_record['model']), ('name', '=', xml_record['name'])]).ids - if not xml_ids: - self.create(xml_record) - #avoid the xml id and the associated resource being dropped by the orm by manually making a hit on it - self._update_dummy(xml_record['model'], xml_record['module'], xml_record['name']) \ No newline at end of file diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml index b15716264b4..fcfd0748d4d 100644 --- a/addons/mrp/data/mrp_demo.xml +++ b/addons/mrp/data/mrp_demo.xml @@ -588,7 +588,31 @@ + + + + + + + + + + + + + + + + + + diff --git a/addons/mrp/data/mrp_lot_demo.yml b/addons/mrp/data/mrp_lot_demo.yml deleted file mode 100644 index bb0c54e238e..00000000000 --- a/addons/mrp/data/mrp_lot_demo.yml +++ /dev/null @@ -1,12 +0,0 @@ -- - !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()