diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index 8d8a6f8465a..553c7d50be7 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -142,12 +142,16 @@ class pos_make_payment(osv.osv_memory): 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) 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