From 2ae556a213d8fd005a8351e5b8bedd2497cf7d05 Mon Sep 17 00:00:00 2001 From: vth Date: Tue, 19 Oct 2010 18:41:09 +0530 Subject: [PATCH] [FIX] account: add exception if no lines found in account.voucher object bzr revid: vth@tinyerp.com-20101019131109-wrosvxj31ihkc1ya --- addons/account_voucher/account_voucher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 1760978b8c2..169a489bfa2 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -574,6 +574,8 @@ class account_voucher(osv.osv): currency_pool = self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') for inv in self.browse(cr, uid, ids): + if not inv.line_ids: + raise osv.except_osv(_('No Lines !'), _('Please create some lines')) if inv.move_id: continue if inv.number: