minor fix
This commit is contained in:
parent
2821d0cc36
commit
b1100ccd92
10
account.py
10
account.py
|
@ -151,6 +151,16 @@ class Account(ModelSQL, ModelView):
|
|||
raise BadOperationError(gettext('account_col.msg_bad_operation'))
|
||||
return super(Account, cls).copy(records, default=default)
|
||||
|
||||
@fields.depends('type')
|
||||
def on_change_with_deferral(self, name=None):
|
||||
return (self.type
|
||||
and self.type.statement in {'balance', 'off-balance', 'income'})
|
||||
|
||||
@fields.depends('code')
|
||||
def on_change_code(self, name=None):
|
||||
if self.type and self.code and self.code[0] in ['4', '5', '6', '7']:
|
||||
self.party_required = True
|
||||
|
||||
@classmethod
|
||||
def validate(cls, accounts):
|
||||
super(Account, cls).validate(accounts)
|
||||
|
|
8
move.py
8
move.py
|
@ -46,6 +46,14 @@ class Move(ModelSQL, ModelView):
|
|||
res += (line.debit or 0) - (line.credit or 0)
|
||||
return res
|
||||
|
||||
# @fields.depends('account')
|
||||
# def on_change_with_party_required(self, name=None):
|
||||
# res = super(Move, self).on_change_with_party_required(name=None)
|
||||
# print(self.account.code[0])
|
||||
# if self.account and self.account.code[0] in ['4', '5', '6', '7']:
|
||||
# res = True
|
||||
# return res
|
||||
|
||||
@classmethod
|
||||
def draft(cls, records_ids):
|
||||
account_move = Table('account_move')
|
||||
|
|
Loading…
Reference in New Issue