From 8f43d299d08b7c3b00921b6ce5b1e6d47b700276 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 4 Feb 2011 17:02:47 +0530 Subject: [PATCH] [FIX] POS: Lots in POS => Add product lot on pos order line for validate pos order for product which has tracking outgoing set to true lp bug: https://launchpad.net/bugs/710561 fixed bzr revid: mra@mra-laptop-20110204113247-732fgockzszz7n6k --- addons/point_of_sale/i18n/point_of_sale.pot | 5 +++++ addons/point_of_sale/point_of_sale.py | 5 +++-- addons/point_of_sale/point_of_sale_view.xml | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index e4dcfccbe50..3a67697cf51 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -1428,6 +1428,11 @@ msgstr "" msgid "Person who uses the the cash register. It could be a reliever, a student or an interim employee." msgstr "" +#. module: point_of_sale +#: help:pos.order.line, prodlot_id:0 +msgid "You can specify Production lot for stock move created when you validate the pos order" +msgstr "" + #. module: point_of_sale #: field:report.transaction.pos,invoice_id:0 msgid "Nbr Invoice" diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 846c9e44514..58e83a7e89e 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -423,7 +423,7 @@ class pos_order(osv.osv): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking') property_obj = self.pool.get("ir.property") - move_obj=self.pool.get('stock.move') + move_obj = self.pool.get('stock.move') pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') orders = self.browse(cr, uid, ids, context=context) for order in orders: @@ -464,7 +464,6 @@ class pos_order(osv.osv): stock_dest_id = val.id if line.qty < 0: location_id, stock_dest_id = stock_dest_id, location_id - move_obj.create(cr, uid, { 'name': '(POS %d)' % (order.id, ), 'product_uom': line.product_id.uom_id.id, @@ -478,6 +477,7 @@ class pos_order(osv.osv): 'state': 'waiting', 'location_id': location_id, 'location_dest_id': stock_dest_id, + 'prodlot_id': line.prodlot_id and line.prodlot_id.id or False }, context=context) wf_service = netsvc.LocalService("workflow") @@ -1147,6 +1147,7 @@ class pos_order_line(osv.osv): 'discount': fields.float('Discount (%)', digits=(16, 2)), 'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'), 'create_date': fields.datetime('Creation Date', readonly=True), + 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="You can specify Production lot for stock move created when you validate the pos order"), } _defaults = { diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 50108d26dad..acc0a72ff3b 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -41,6 +41,7 @@ +