From 3d774c0bef26f41d1ca81408dba577dbadb44dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 14 Nov 2011 17:59:24 +0100 Subject: [PATCH] Create property for default account only if value is set issue2259 review174001 --- account.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/account.py b/account.py index 7c5ef16977..c3bc7f4cd7 100644 --- a/account.py +++ b/account.py @@ -1818,12 +1818,13 @@ class CreateChartAccount(Wizard): ]) with Transaction().set_user(0): property_obj.delete(property_ids) - property_obj.create({ - '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({ + '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'), @@ -1836,12 +1837,13 @@ class CreateChartAccount(Wizard): ]) with Transaction().set_user(0): property_obj.delete(property_ids) - property_obj.create({ - '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({ + 'field': account_payable_field_id, + 'value': 'account.account,' + \ + str(datas['form']['account_payable']), + 'company': datas['form']['company'], + }) return {} CreateChartAccount()