From 491faac5e9f47e4d0573a1eba9579aca44b16752 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 22 Nov 2017 12:22:05 +0100 Subject: [PATCH] [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. --- addons/mrp/data/mrp_data.xml | 18 ++--- addons/stock/data/stock_data.xml | 107 ++++++++++++------------------ addons/stock/data/stock_demo2.xml | 50 ++++++-------- 3 files changed, 68 insertions(+), 107 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 @@ 0 - - - - - - + stock.picking.type mrp + picking_type_manufacturing + + + init + + diff --git a/addons/stock/data/stock_data.xml b/addons/stock/data/stock_data.xml index c1eb6a36d1a..70fe78291f1 100644 --- a/addons/stock/data/stock_data.xml +++ b/addons/stock/data/stock_data.xml @@ -149,98 +149,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - + stock.location stock + stock_location_stock + + + init + - + stock.location stock + stock_location_company + + + init + - + stock.location stock + stock_location_output + + + init + - + stock.location stock + location_pack_zone + + + init + - + stock.picking.type stock + picking_type_internal + + + init + - + stock.picking.type stock + picking_type_in + + + init + - + stock.picking.type stock + picking_type_out + + + init + diff --git a/addons/stock/data/stock_demo2.xml b/addons/stock/data/stock_demo2.xml index 2bbec1279dd..5f9275399c6 100644 --- a/addons/stock/data/stock_demo2.xml +++ b/addons/stock/data/stock_demo2.xml @@ -1,47 +1,35 @@ - - - - - - - - - - - - - + stock.picking.type stock + chi_picking_type_in + + + init + - + stock.picking.type stock + chi_picking_type_out + + + init + - - stock.location + + stock.picking.type stock + stock_location_shop0 + + + init +