account_voucher: Can pay Sales Receipt multiple times

bzr revid: ara@tinyerp.com-20110404091724-jfccyesfnuregi7b
This commit is contained in:
ARA (OpenERP)
2011-04-04 14:47:24 +05:30
parent 0f76f46675
commit b9f4b52051
+8 -6
View File
@@ -149,13 +149,15 @@ class account_voucher(osv.osv):
return res
def test_paid(self, cr, uid, ids, context):
recs = []
paid = False
ok = False
for voucher in self.browse(cr, uid, ids, context=context):
for line in voucher.move_ids:
if (line.account_id.type, 'in', ('receivable', 'payable')) and line.reconcile_id:
paid = True
return paid
if voucher.pay_now == 'pay_later':
for line in voucher.move_ids:
if (line.account_id.type, 'in', ('receivable', 'payable')) and line.reconcile_id:
ok = True
elif voucher.pay_now == 'pay_now' and voucher.state == 'posted':
ok = True
return ok
def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
debit = credit = 0.0