[IMP] balance computation line in payment term
bzr revid: shp@tinyerp.com-20121204051530-4sx9r9m0uqmapous
This commit is contained in:
parent
0c375a3d6f
commit
f959595933
|
@ -94,6 +94,20 @@ class account_payment_term(osv.osv):
|
|||
amount -= amt
|
||||
return result
|
||||
|
||||
def _check_balance_line(self, cr, uid, ids, context=None):
|
||||
line_list = []
|
||||
obj = self.browse(cr, uid, ids[0], context=context)
|
||||
for ids in obj.line_ids:
|
||||
if ids.value == 'balance':
|
||||
line_list.append(ids.value)
|
||||
if len(line_list) > 1:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_balance_line, 'A payment term should have one and only one "Balance" computation line.', ['value']),
|
||||
]
|
||||
|
||||
account_payment_term()
|
||||
|
||||
class account_payment_term_line(osv.osv):
|
||||
|
|
Loading…
Reference in New Issue