From cae96ed4543abc9f05dbc4398a1832a1468639c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 29 Mar 2013 12:00:48 +0100 Subject: [PATCH] [FIX] point_of_sale: correctly set the customer on the order bzr revid: fva@openerp.com-20130329110048-1cx2sr4hp98cue0f --- addons/point_of_sale/point_of_sale.py | 3 ++- addons/point_of_sale/static/src/js/models.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 44139f7a499..9ee5b944718 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -489,7 +489,8 @@ class pos_order(osv.osv): 'user_id': order['user_id'] or False, 'session_id': order['pos_session_id'], 'lines': order['lines'], - 'pos_reference':order['name'] + 'pos_reference':order['name'], + 'partner_id': order['partner_id'] or False }, context) for payments in order['statement_ids']: diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 6a9d54ce608..426bea9a9b7 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -330,7 +330,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal //we try to send the order. shadow prevents a spinner if it takes too long. var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: true, timeout: 2000}); - + rpc.fail(function(unused,event){ //prevent an error popup creation by the rpc failure event.preventDefault(); @@ -863,7 +863,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal lines: orderLines, statement_ids: paymentLines, pos_session_id: this.pos.get('pos_session').id, - partner_id: this.pos.get('client') ? this.pos.get('client').id : undefined, + partner_id: this.get_client() ? this.get_client().id : false, user_id: this.pos.get('cashier') ? this.pos.get('cashier').id : this.pos.get('user').id, }; },