From f2010d5be38e933dcb6b7c93b14ebe02af94c1ee Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 10 Mar 2011 10:42:38 +0530 Subject: [PATCH] [FIX] Point_of_sale: [trunk] POS: creating invoice for partner with empty address bzr revid: ara@tinyerp.com-20110310051238-cc8uki8qo47045n4 --- addons/point_of_sale/wizard/pos_payment.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 787c13deea3..bda34f11cec 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -149,6 +149,9 @@ class pos_make_payment(osv.osv_memory): order = order_obj.browse(cr, uid, active_id, context=context) amount = order.amount_total - order.amount_paid data = self.read(cr, uid, ids, context=context)[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")) if data['is_acc']: amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price