From 78e94187179b1a62c2699b8f14b6369de10759c6 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 28 Mar 2013 16:55:49 +0100 Subject: [PATCH] [FIX] Write all lines at once to the move instead of creating move lines separately bzr revid: jco@openerp.com-20130328155549-pdqg0fgk1timzgfb --- addons/point_of_sale/point_of_sale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index cd3dea7cb66..253fdea02ef 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1094,9 +1094,12 @@ class pos_order(osv.osv): order.write({'state':'done', 'account_move': move_id}) + all_lines = [] for group_key, group_data in grouped_data.iteritems(): for value in group_data: - account_move_line_obj.create(cr, uid, value, context=context) + all_lines.append((0, 0, value),) + if move_id: #In case no order was changed + self.pool.get("account.move").write(cr, uid, [move_id], {'line_id':all_lines}, context=context) return True