[FIX] 327394 : Corrected Payment Term Line notification on supplier invioce(ref:GPA)
authorJay (Open ERP) <jvo@tinyerp.com>
Tue, 17 Mar 2009 13:28:02 +0000 (18:58 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Tue, 17 Mar 2009 13:28:02 +0000 (18:58 +0530)
bzr revid: jvo@tinyerp.com-20090317132802-dv317a771oi1y8w7

addons/account/invoice.py

index 9ce5f2a..f9d53f2 100644 (file)
@@ -382,13 +382,14 @@ class account_invoice(osv.osv):
         if not date_invoice :
             date_invoice = time.strftime('%Y-%m-%d')
 
-        pterm_list= pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
+        pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
 
         if pterm_list:
             pterm_list = [line[0] for line in pterm_list]
             pterm_list.sort()
             res= {'value':{'date_due': pterm_list[-1]}}
-
+        else:
+             raise osv.except_osv(_('Data Insufficient !'), _('The Payment Term of Supplier does not have Payment Term Lines(Computation) defined !'))
         return res
 
     def onchange_invoice_line(self, cr, uid, ids, lines):