← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-731787-ara into lp:openobject-addons

 

Ashvin Rathod (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-731787-ara into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #731787 [trunk] POS: creating invoice for partner with empty address
  https://bugs.launchpad.net/bugs/731787

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-731787-ara/+merge/52681

Hello,

fixed: [trunk] POS: creating invoice for partner with empty address
https://bugs.launchpad.net/openobject-addons/+bug/731787

Thanks,
ara
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-731787-ara/+merge/52681
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-731787-ara.
=== modified file 'point_of_sale/wizard/pos_payment.py'
--- point_of_sale/wizard/pos_payment.py	2011-01-24 16:13:46 +0000
+++ point_of_sale/wizard/pos_payment.py	2011-03-09 13:48:07 +0000
@@ -142,6 +142,7 @@
         if the order is paid print invoice (if wanted) or ticket.
         """
         order_obj = self.pool.get('pos.order')
+        obj_partner = self.pool.get('res.partner')
         if context is None:
             context = {}
         active_id = context and context.get('active_id', False)
@@ -156,6 +157,9 @@
             order_obj.add_payment(cr, uid, active_id, data, context=context)
 
         if order_obj.test_paid(cr, uid, [active_id]):
+            partner = obj_partner.browse(cr, uid, data['partner_id'], context=context)
+            if not partner.address:
+                raise osv.except_osv(_('Error!'),_("Partner doesn't have an address to make the invoice."))
             if data['partner_id'] and data['invoice_wanted']:
                 order_obj.action_invoice(cr, uid, [active_id], context=context)
                 order_obj.create_picking(cr, uid, [active_id], context=context)


Follow ups