← Back to team overview

openerp-dev-web team mailing list archive

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

 

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

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #735403 in OpenERP Addons: "point of sale without partner"
  https://bugs.launchpad.net/openobject-addons/+bug/735403

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

Hello,

Fix the bug: point_of_sale- point of sale without partner
https://bugs.launchpad.net/openobject-addons/+bug/735403

Thanks,
ara
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-735403-ara/+merge/53598
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-735403-ara.
=== modified file 'point_of_sale/wizard/pos_payment.py'
--- point_of_sale/wizard/pos_payment.py	2011-03-14 10:27:42 +0000
+++ point_of_sale/wizard/pos_payment.py	2011-03-16 10:25:55 +0000
@@ -150,10 +150,7 @@
         amount = order.amount_total - order.amount_paid
         data =  self.read(cr, uid, ids, context=context)[0]
         for m2o_field in ['product_id','pricelist_id','partner_id']:
-            data[m2o_field] = data[m2o_field][0]
-        partner = obj_partner.browse(cr, uid, data['partner_id'], context=context)
-        if not partner.address:
-            raise osv.except_osv(_('Error!'),_("Customer doesn't have an address to make the invoice"))
+            data[m2o_field] = data.get(m2o_field, False) and data[m2o_field][0] or False
         if data['is_acc']:
             amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price
 
@@ -163,6 +160,9 @@
 
         if order_obj.test_paid(cr, uid, [active_id]):
             if data['partner_id'] and data['invoice_wanted']:
+                partner = obj_partner.browse(cr, uid, data['partner_id'], context=context)
+                if not partner.address:
+                    raise osv.except_osv(_('Error!'),_("Customer doesn't have an address to make the invoice..."))
                 order_obj.action_invoice(cr, uid, [active_id], context=context)
                 order_obj.create_picking(cr, uid, [active_id], context=context)
                 if context.get('return', False):


Follow ups