Create property for default account only if value is set
issue2259 review174001 (transplanted from 2475a84195d25ba0b6c72637604fa2bfbac03959)
This commit is contained in:
1 parent
61816b1053
commit
91ee6715c8
1 file changed
+16
-14
+16
-14
@@ -1815,13 +1815,14 @@ class CreateChartAccount(Wizard):
|
||||
])
|
||||
with Transaction().set_user(0):
|
||||
property_obj.delete(property_ids)
|
||||
property_obj.create({
|
||||
'name': 'account_receivable',
|
||||
'field': account_receivable_field_id,
|
||||
'value': 'account.account,' + \
|
||||
str(datas['form']['account_receivable']),
|
||||
'company': datas['form']['company'],
|
||||
})
|
||||
if datas['form']['account_receivable']:
|
||||
property_obj.create({
|
||||
'name': 'account_receivable',
|
||||
'field': account_receivable_field_id,
|
||||
'value': 'account.account,' + \
|
||||
str(datas['form']['account_receivable']),
|
||||
'company': datas['form']['company'],
|
||||
})
|
||||
|
||||
account_payable_field_id = model_field_obj.search([
|
||||
('model.model', '=', 'party.party'),
|
||||
@@ -1834,13 +1835,14 @@ class CreateChartAccount(Wizard):
|
||||
])
|
||||
with Transaction().set_user(0):
|
||||
property_obj.delete(property_ids)
|
||||
property_obj.create({
|
||||
'name': 'account_payable',
|
||||
'field': account_payable_field_id,
|
||||
'value': 'account.account,' + \
|
||||
str(datas['form']['account_payable']),
|
||||
'company': datas['form']['company'],
|
||||
})
|
||||
if datas['form']['account_payable']:
|
||||
property_obj.create({
|
||||
'name': 'account_payable',
|
||||
'field': account_payable_field_id,
|
||||
'value': 'account.account,' + \
|
||||
str(datas['form']['account_payable']),
|
||||
'company': datas['form']['company'],
|
||||
})
|
||||
return {}
|
||||
|
||||
CreateChartAccount()
|
||||
|
||||
Reference in new issue
Block a user