From f840ea4937ec95328e843546ddb45c99066ca933 Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 7 Jul 2011 16:01:06 +0530 Subject: [PATCH] [FIX] pos:-increments the sequence and does not copy the productlot while duplicating the POS order lp bug: https://launchpad.net/bugs/805932 fixed bzr revid: mtr@mtr-20110707103106-q9pc6h2mbbov2asa --- addons/point_of_sale/point_of_sale.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 90bfa975a76..707fd3eb534 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -209,7 +209,8 @@ class pos_order(osv.osv): 'picking_id': False, 'statement_ids': [], 'nb_print': 0, - 'pickings': [] + 'pickings': [], + 'name': self.pool.get('ir.sequence').get(cr, uid, 'pos.order'), }) return super(pos_order, self).copy(cr, uid, id, default, context=context) @@ -1170,6 +1171,15 @@ class pos_order_line(osv.osv): if 'product_id' in values and not values['product_id']: return False return super(pos_order_line, self).write(cr, user, ids, values, context=context) + + def copy_data(self, cr, uid, id, default=None, context=None): + if not default: + default = {} + default.update({ + 'prodlot_id': False, + 'name': self.pool.get('ir.sequence').get(cr, uid, 'pos.order.line') + }) + return super(pos_order_line, self).copy_data(cr, uid, id, default, context=context) def _scan_product(self, cr, uid, ean, qty, order): # search pricelist_id