[FIX] Point_of_sale: [trunk] POS: creating invoice for partner with empty address

bzr revid: ara@tinyerp.com-20110310051238-cc8uki8qo47045n4
This commit is contained in:
ARA (OpenERP)
2011-03-10 10:42:38 +05:30
parent 96415dbeb7
commit f2010d5be3
@@ -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