From 5eb316c8819d84f0197bb0bd985b6f9bf514dde8 Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 2 Jun 2011 18:08:26 +0530 Subject: [PATCH 1/2] [FIX] stock : Warning message during move split, if the lot quantity available is less than specified quantity (Case:6001) lp bug: https://launchpad.net/bugs/771377 fixed bzr revid: vro@tinyerp.com-20110602123826-ou2ndsaesi6viswz --- addons/stock/wizard/stock_move.py | 11 +++++++++++ addons/stock/wizard/stock_move_view.xml | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py index fad31d774ce..0d6b03fc3bd 100644 --- a/addons/stock/wizard/stock_move.py +++ b/addons/stock/wizard/stock_move.py @@ -20,6 +20,7 @@ ############################################################################## from osv import fields, osv +from tools.translate import _ import decimal_precision as dp @@ -197,6 +198,8 @@ class split_in_production_lot(osv.osv_memory): res.update({'qty': move.product_qty}) if 'use_exist' in fields: res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False}) + if 'location_id' in fields: + res.update({'location_id': move.location_id.id}) return res _columns = { @@ -206,6 +209,7 @@ class split_in_production_lot(osv.osv_memory): 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Production Lots'), 'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Production Lots'), 'use_exist' : fields.boolean('Existing Lots', help="Check this option to select existing lots in the list below, otherwise you should enter new ones line by line."), + 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True), } def split_lot(self, cr, uid, ids, context=None): @@ -307,6 +311,13 @@ class stock_move_split_lines_exist(osv.osv_memory): 'quantity': lambda *x: 1.00, } + def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False, + loc_id=False, product_id=False, uom_id=False, context=None): + stock_move_obj = self.pool.get('stock.move') + res = stock_move_obj.onchange_lot_id(cr, uid, ids, prodlot_id, product_qty, + loc_id, product_id, uom_id, context=context) + return res + stock_move_split_lines_exist() class stock_move_split_lines(osv.osv_memory): diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml index baaa581b4f3..5f4bc1f71c5 100644 --- a/addons/stock/wizard/stock_move_view.xml +++ b/addons/stock/wizard/stock_move_view.xml @@ -118,6 +118,7 @@ + @@ -134,12 +135,12 @@ - - + +
- - + +
From 46d7d78ec115199daa9db8119a4a0f3c0014c639 Mon Sep 17 00:00:00 2001 From: vro Date: Thu, 16 Jun 2011 14:27:51 +0530 Subject: [PATCH 2/2] [FIX] stock : Warning message during move split, if the lot quantity available is less than specified quantity (Case:6001) lp bug: https://launchpad.net/bugs/771377 fixed bzr revid: vro@tinyerp.com-20110616085751-ih1usqzt13o9h7jz --- addons/stock/wizard/stock_move.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py index a8126d2738c..92c9297e986 100644 --- a/addons/stock/wizard/stock_move.py +++ b/addons/stock/wizard/stock_move.py @@ -207,7 +207,7 @@ class split_in_production_lot(osv.osv_memory): 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Production Lots'), 'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Production Lots'), 'use_exist' : fields.boolean('Existing Lots', help="Check this option to select existing lots in the list below, otherwise you should enter new ones line by line."), - 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True) + 'location_id': fields.many2one('stock.location', 'Source Location') } def split_lot(self, cr, uid, ids, context=None): @@ -310,10 +310,10 @@ class stock_move_split_lines_exist(osv.osv_memory): } def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False, - loc_id=False, product_id=False, uom_id=False, context=None): + loc_id=False, product_id=False, uom_id=False): - return self.pool.get('stock.move').onchange_lot_id(cr, uid, ids, prodlot_id, product_qty, - loc_id, product_id, uom_id, context=context) + return self.pool.get('stock.move').onchange_lot_id(cr, uid, [], prodlot_id, product_qty, + loc_id, product_id, uom_id) stock_move_split_lines_exist()