minor fix write account

This commit is contained in:
wilson gomez 2021-08-19 17:02:21 -05:00
parent 4532ccf69b
commit 8b2d4734bb
1 changed files with 2 additions and 2 deletions

View File

@ -165,9 +165,9 @@ class Account(ModelSQL, ModelView):
@classmethod
def write(cls, records, vlist):
if vlist['type'] and vlist['code'] and vlist['code'][0] in ['4', '5', '6', '7']:
if vlist.get('type') and vlist.get('code') and vlist['code'][0] in ['4', '5', '6', '7']:
vlist['party_required'] = True
if not vlist['type']:
if not vlist.get('type'):
vlist['party_required'] = False
return super(Account, cls).write(records, vlist)