'quantity': lambda *x: 1
}
- def track_lines(self, cr, uid, ids, context={}):
+ def track_lines(self, cr, uid, ids, context=None):
""" To track stock moves lines
@param self: The object pointer.
@param cr: A database cursor
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
- return {}
+ return {'type': 'ir.actions.act_window_close'}
stock_move_track()
@param context: A standard dictionary
@return: default values of fields
"""
+ if context is None:
+ context = {}
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
if 'product_id' in fields:
return res
- def do_move_consume(self, cr, uid, ids, context={}):
+ def do_move_consume(self, cr, uid, ids, context=None):
""" To move consumed products
@param self: The object pointer.
@param cr: A database cursor
@param context: A standard dictionary
@return:
"""
+ if context is None:
+ context = {}
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
move_obj.action_consume(cr, uid, move_ids,
data['product_qty'], data['location_id'],
context=context)
- return {}
+ return {'type': 'ir.actions.act_window_close'}
stock_move_consume()
@param context: A standard dictionary
@return: default values of fields
"""
+ if context is None:
+ context = {}
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
location_obj = self.pool.get('stock.location')
return res
- def move_scrap(self, cr, uid, ids, context={}):
+ def move_scrap(self, cr, uid, ids, context=None):
""" To move scrapped products
@param self: The object pointer.
@param cr: A database cursor
@param context: A standard dictionary
@return:
"""
+ if context is None:
+ context = {}
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
move_obj.action_scrap(cr, uid, move_ids,
data['product_qty'], data['location_id'],
context=context)
- return {}
+ return {'type': 'ir.actions.act_window_close'}
stock_move_scrap()
@param context: A standard dictionary
@return: Default values of fields
"""
+ if context is None:
+ context = {}
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
if context.get('active_id'):
@param context: A standard dictionary
@return:
"""
+ if context is None:
+ context = {}
self.split(cr, uid, ids, context.get('active_ids'), context=context)
- return {}
+ return {'type': 'ir.actions.act_window_close'}
def split(self, cr, uid, ids, move_ids, context=None):
""" To split stock moves into production lot
move_obj = self.pool.get('stock.move')
new_move = []
for data in self.browse(cr, uid, ids, context=context):
- for move in move_obj.browse(cr, uid, move_ids):
+ for move in move_obj.browse(cr, uid, move_ids, context=context):
move_qty = move.product_qty
quantity_rest = move.product_qty
uos_qty_rest = move.product_uos_qty