summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMantavya Gajjar <mga@tinyerp.com>2010-07-29 21:26:28 +0530
committerMantavya Gajjar <mga@tinyerp.com>2010-07-29 21:26:28 +0530
commit51eac4e4ece769021af734ed9bb33bfcce41d245 (patch)
tree72c5a2a8fc9e7dc6c693dff9f3bf82982b6eef31
parent6b7a7edd25712388b1d8d4b1f70a0b79f1a531d7 (diff)
[FIX]: further improvement in selection invoice in voucher
bzr revid: mga@tinyerp.com-20100729155628-ek5eyvsycwg3y31r
-rw-r--r--addons/account_voucher/voucher.py2
-rwxr-xr-xaddons/account_voucher_payment/account_voucher_payment.py10
2 files changed, 8 insertions, 4 deletions
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index 0b1b9b01b23..e1005512127 100644
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -203,7 +203,7 @@ class account_voucher(osv.osv):
}
self.write(cr, uid, ids, res)
else:
- raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !')
+ raise osv.except_osv(_('Invalid action !'), _('You can not post to Pro-Forma a voucher with Total amount = 0 !'))
return True
def proforma_voucher(self, cr, uid, ids, context={}):
diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py
index dca7eebc977..2bae0e6f75a 100755
--- a/addons/account_voucher_payment/account_voucher_payment.py
+++ b/addons/account_voucher_payment/account_voucher_payment.py
@@ -45,7 +45,10 @@ class account_invoice(osv.osv):
args += [('type','in', ['out_invoice', 'in_refund'])]
elif ttype and ttype in ('pay_voucher', 'bank_pay_voucher'):
args += [('type','in', ['in_invoice', 'out_refund'])]
-
+ elif ttype and ttype in('journal_sale_vou', 'journal_pur_voucher', 'journal_voucher'):
+ raise osv.except_osv(_('Invalid action !'), _('You can not reconcile sales, purchase, or journal entry with invoice !'))
+ args += [('type','=', 'do_not_allow_search')]
+
res = super(account_invoice, self).search(cr, user, args, offset, limit, order, context, count)
return res
@@ -187,11 +190,12 @@ class account_voucher(osv.osv):
move_line_id = move_line_pool.create(cr, uid, move_line)
line_ids += [move_line_id]
- if line.invoice_id:
+ if line.invoice_id and inv.type in ('pay_voucher', 'bank_pay_voucher', 'rec_voucher', 'bank_rec_voucher'):
rec_ids += [move_line_id]
for move_line in line.invoice_id.move_id.line_id:
if line.account_id.id == move_line.account_id.id:
- rec_ids += [move_line.id]
+ rec_ids += [move_line.id]
+
if rec_ids:
move_line_pool.reconcile_partial(cr, uid, rec_ids)