[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.
This commit is contained in:
Nicolas Lempereur
2018-03-06 10:25:24 +01:00
parent 38ae172c3b
commit 1bf25fc018
@@ -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)