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)