[FIX] stock, product_expiry: fixes of removal fefo and putaway processing
bzr revid: qdp-launchpad@openerp.com-20140414083303-5vwlnakof0vcbtri
This commit is contained in:
parent
2fd72600fa
commit
4987c9d42d
|
@ -78,8 +78,16 @@ class stock_production_lot(osv.osv):
|
||||||
|
|
||||||
class stock_quant(osv.osv):
|
class stock_quant(osv.osv):
|
||||||
_inherit = 'stock.quant'
|
_inherit = 'stock.quant'
|
||||||
_column = {
|
|
||||||
'removal_date': fields.related('lot_id', 'removal_date', type='date', string='Removal Date', store=True),
|
def _get_quants(self, cr, uid, ids, context=None):
|
||||||
|
return self.pool.get('stock.quant').search(cr, uid, [('lot_id', 'in', ids)], context=context)
|
||||||
|
|
||||||
|
_columns = {
|
||||||
|
'removal_date': fields.related('lot_id', 'removal_date', type='datetime', string='Removal Date',
|
||||||
|
store={
|
||||||
|
'stock.quant': (lambda self, cr, uid, ids, ctx: ids, ['lot_id'], 20),
|
||||||
|
'stock.production.lot': (_get_quants, ['removal_date'], 20),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
def apply_removal_strategy(self, cr, uid, location, product, qty, domain, removal_strategy, context=None):
|
def apply_removal_strategy(self, cr, uid, location, product, qty, domain, removal_strategy, context=None):
|
||||||
|
|
|
@ -155,7 +155,7 @@ class stock_location(osv.osv):
|
||||||
loc = location
|
loc = location
|
||||||
while loc:
|
while loc:
|
||||||
if loc.putaway_strategy_id:
|
if loc.putaway_strategy_id:
|
||||||
res = putaway_obj.putaway_strat_apply(cr, uid, loc.putaway_strategy_id, product, context=context)
|
res = putaway_obj.putaway_apply(cr, uid, loc.putaway_strategy_id, product, context=context)
|
||||||
if res:
|
if res:
|
||||||
return res
|
return res
|
||||||
loc = loc.location_id
|
loc = loc.location_id
|
||||||
|
@ -922,13 +922,6 @@ class stock_picking(osv.osv):
|
||||||
self.action_assign(cr, uid, picking_ids, context=context)
|
self.action_assign(cr, uid, picking_ids, context=context)
|
||||||
self.do_prepare_partial(cr, uid, picking_ids, context=context)
|
self.do_prepare_partial(cr, uid, picking_ids, context=context)
|
||||||
|
|
||||||
def _picking_putaway_resolution(self, cr, uid, picking, product, putaway, context=None):
|
|
||||||
if putaway.method == 'fixed':
|
|
||||||
for strat in putaway.fixed_location_ids:
|
|
||||||
if product.categ_id.id == strat.category_id.id:
|
|
||||||
return strat.fixed_location_id.id
|
|
||||||
return False
|
|
||||||
|
|
||||||
def _get_top_level_packages(self, cr, uid, quants_suggested_locations, context=None):
|
def _get_top_level_packages(self, cr, uid, quants_suggested_locations, context=None):
|
||||||
"""This method searches for the higher level packages that can be moved as a single operation, given a list of quants
|
"""This method searches for the higher level packages that can be moved as a single operation, given a list of quants
|
||||||
to move and their suggested destination, and returns the list of matching packages.
|
to move and their suggested destination, and returns the list of matching packages.
|
||||||
|
@ -988,7 +981,6 @@ class stock_picking(osv.osv):
|
||||||
else:
|
else:
|
||||||
location = self.pool.get('stock.location').get_putaway_strategy(cr, uid, picking.location_dest_id, product, context=context)
|
location = self.pool.get('stock.location').get_putaway_strategy(cr, uid, picking.location_dest_id, product, context=context)
|
||||||
product_putaway_strats[product.id] = location
|
product_putaway_strats[product.id] = location
|
||||||
location = self._picking_putaway_resolution(cr, uid, picking, product, putaway_strat, context=context)
|
|
||||||
return location or picking.picking_type_id.default_location_dest_id.id or picking.location_dest_id.id
|
return location or picking.picking_type_id.default_location_dest_id.id or picking.location_dest_id.id
|
||||||
|
|
||||||
pack_obj = self.pool.get("stock.quant.package")
|
pack_obj = self.pool.get("stock.quant.package")
|
||||||
|
|
Loading…
Reference in New Issue