[FIX]account_voucher: while paying the invoice of selected journal in voucher has inactive sequence that will throw the traceback it should raise warning

bzr revid: mma@tinyerp.com-20121101095033-enb2bmc43xox1n6i
This commit is contained in:
Mayur Maheshwari (OpenERP)
2012-11-01 15:20:33 +05:30
parent b006809773
commit e782d6fb3c
@@ -953,6 +953,9 @@ class account_voucher(osv.osv):
if voucher_brw.number:
name = voucher_brw.number
elif voucher_brw.journal_id.sequence_id:
if not voucher_brw.journal_id.sequence_id.active:
raise osv.except_osv(_('Configuration Error !'),
_('Please activate the sequence of selected journal !'))
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
else:
raise osv.except_osv(_('Error!'),