[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user