diff --git a/stock_move_location/stock_view.xml b/stock_move_location/stock_view.xml index 04e25ae61..89ad954f3 100755 --- a/stock_move_location/stock_view.xml +++ b/stock_move_location/stock_view.xml @@ -41,7 +41,7 @@ - {'full':'1', 'type':'normal'} + {'full':'1', 'type':'normal', 'default_type': 'normal'} [('type', '=', 'normal')] @@ -55,7 +55,7 @@ stock.inventory form - {'full':'1', 'type':'move'} + {'full':'1', 'type':'move', 'default_type': 'move'} [('type', '=', 'move')] You can use this to move a stock from a location to an other one. diff --git a/stock_tracking_extended/stock_tracking.py b/stock_tracking_extended/stock_tracking.py index 20f3d21df..2f4154870 100644 --- a/stock_tracking_extended/stock_tracking.py +++ b/stock_tracking_extended/stock_tracking.py @@ -100,6 +100,7 @@ class stock_tracking(osv.osv): _defaults = { 'state': 'open', + 'location_id': lambda x, y, z, c: c and c.get('location_id') or False, } def reset_open(self, cr, uid, ids, context=None): @@ -292,7 +293,7 @@ class stock_move(osv.osv): state = self.browse(cr, uid, id, context).state move_ori_id = self.browse(cr, uid, id, context).move_ori_id if state == 'done' and move_ori_id: - self.write(cr, uid, [move_ori_id], {'state':'done'}, context) + self.write(cr, uid, [move_ori_id.id], {'state':'done'}, context) return result def create(self, cr, uid, vals, context=None):