From d80215ed61d6d6a2ef531331da37682313b2747c Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 16 Mar 2011 15:52:56 +0530 Subject: [PATCH 1/2] [FIX] point_of_sale: point of sale without partner lp bug: https://launchpad.net/bugs/735403 fixed bzr revid: ara@tinyerp.com-20110316102256-e1yks7rziiv1xu8x --- addons/point_of_sale/wizard/pos_payment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 8e60acdcae0..3d5fe6b0578 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -150,10 +150,7 @@ class pos_make_payment(osv.osv_memory): 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 @@ class pos_make_payment(osv.osv_memory): 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): From bdbc6dff223ef69106fc0383ae14aea519df271b Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 16 Mar 2011 15:57:06 +0530 Subject: [PATCH 2/2] [FIX] point_of_sale: point of sale without partner bzr revid: ara@tinyerp.com-20110316102706-fvpstppoyl0n0yh4 --- addons/point_of_sale/wizard/pos_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 3d5fe6b0578..ea5bd2639d7 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -162,7 +162,7 @@ class pos_make_payment(osv.osv_memory): 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...")) + 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):