From 1bf25fc018a49bce36c1c19d424e3e2f2800e81c Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 6 Mar 2018 09:32:34 +0100 Subject: [PATCH] [FIX] stock_account: no creating 2 def ir.property property_stock_account_input_categ_id, property_stock_account_output_categ_id, property_stock_valuation_account_id ir.property default values on product.category could be duplicated eg. if l10n_generic_coa was installed before stock_account. This did not happen in enterprise but happened in enterprise breaking the test added in odoo/odoo@6bcf9ac2e. --- .../data/stock_account_data_post_install.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/stock_account/data/stock_account_data_post_install.yml b/addons/stock_account/data/stock_account_data_post_install.yml index 332c995f708..d8d867b2080 100644 --- a/addons/stock_account/data/stock_account_data_post_install.yml +++ b/addons/stock_account/data/stock_account_data_post_install.yml @@ -56,7 +56,10 @@ 'value': value, 'res_id': 'product.category,'+str(ref('product.product_category_all')), } - properties = PropertyObj.search([('name', '=', record), ('company_id', '=', company.id), ('value_reference', '!=', False)]) - if not properties: - #create the property + properties = PropertyObj.search([('name', '=', record), ('company_id', '=', company.id)]) + if properties: + # the property exist: modify it + properties.write(vals) + else: + # create the property PropertyObj.create(vals)