summaryrefslogtreecommitdiff
path: root/addons/mrp/data/mrp_data.xml
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2017-11-22 12:22:05 +0100
committerYannick Tivisse <yti@odoo.com>2017-11-22 12:28:05 +0100
commit491faac5e9f47e4d0573a1eba9579aca44b16752 (patch)
tree6b81239c65ba5e37295ed1bf74e496a48bfa0704 /addons/mrp/data/mrp_data.xml
parenteb90eb42ce5ddbdbc1f64218feb70b1921d5a9a3 (diff)
[FIX] stock,mrp: Create ir.model.data with _update, not create
Purpose ======= As the 'function' tag is re-evaluated on the module update (even when noupdate="1"), the ir.model.data will be created a second time with the function 'create'. This leads to the record deletion after the update when calling '_process_end'. Specification ============= Use '_update' instead of 'create' and '_update_dummy'. - _update won't create another ir.model.data if it already exists. - _update already calls _update_dummy to avoid the record deletion.
Diffstat (limited to 'addons/mrp/data/mrp_data.xml')
-rw-r--r--addons/mrp/data/mrp_data.xml18
1 files changed, 7 insertions, 11 deletions
diff --git a/addons/mrp/data/mrp_data.xml b/addons/mrp/data/mrp_data.xml
index 771c3c3ca46..e83ce484a8e 100644
--- a/addons/mrp/data/mrp_data.xml
+++ b/addons/mrp/data/mrp_data.xml
@@ -83,21 +83,17 @@
<field name="sequence">0</field>
</record>
- <function model="ir.model.data" name="create">
- <value model="stock.warehouse" eval="{
- 'name': 'picking_type_manufacturing',
- 'module':'mrp',
- 'model': 'stock.picking.type',
- 'res_id': obj().env.ref('stock.warehouse0').manu_type_id.id,
- }"/>
- </function>
-
- <!-- avoid the xml id and the associated resource being dropped by the orm by manually making a hit on it -->
- <function model="ir.model.data" name="_update_dummy">
+ <function model="ir.model.data" name="_update">
<value>stock.picking.type</value>
<value>mrp</value>
+ <value eval="{}"/>
<value>picking_type_manufacturing</value>
+ <value eval="True"/>
+ <value eval="True"/>
+ <value>init</value>
+ <value model="stock.warehouse" eval="obj().env.ref('stock.warehouse0').manu_type_id.id"/>
</function>
+
</data>
</odoo>