flectra/addons/mrp/data/mrp_data.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
830 B
YAML

-
!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'])