c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #01534
[Bug 667237] Re: [6.0RC1] prod_lot handling needs improverment
Hello again Ferdinand,
I'm not sure I completely understand your question.
The warning you are apparently referring to is not related to a specific location, it is a general check on the total quantity of a given production lot that is currently in you whole warehouse (i.e total_incoming_qty - total_outgoing_qty). If you trigger it you are simply trying to use production lots that are not available anymore (all shipped out or scrapped or consumed by production orders, etc.)
As OpenERP does not do FIFO/LIFO stock tracking (for the sake of simplicity), it cannot enforce the presence of the correct number of production lots in a specific location (for example production lots are not tracked for automatically processed internal moves..)
The idea is only to track incoming and outgoing lot numbers, to know at any point where they came from and where they went (or how they were transformed by production orders).
As a result, you are free to specify production lots on any stock move
irregardless of the source/destination location.
If your goal is to find out exactly where a certain production lot is
available in your warehouse you can open the production lot list and
look at its availability, but remember that this is not meant for
precise tracking *inside* the company. And this should not be used to
alter the source location of a specific stock move, as there is no point
in doing so anyway.
I hope my explanation is clear...
** Changed in: openobject-addons
Status: New => Invalid
--
[6.0RC1] prod_lot handling needs improverment
https://bugs.launchpad.net/bugs/667237
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Addons Modules: Invalid
Bug description:
currently the users often does not know how much of a production lot
is available in each stock location
the client has multiple locations with the same product (products must be traced due to certification requirements)
IMHO it would be great not only to check if enough qty is available on the selected stock location
but to supply the possibility to choose the lot first and automatically copy the selected stock location (and take the goods from there)
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False,
loc_id=False, product_id=False, context=None):
""" On change of production lot gives a warning message.
@param prodlot_id: Changed production lot id
@param product_qty: Quantity of product
@param loc_id: Location id
@param product_id: Product id
@return: Warning message
"""
if not prodlot_id or not loc_id:
return {}
ctx = context and context.copy() or {}
ctx['location_id'] = loc_id
prodlot = self.pool.get('stock.production.lot').browse(cr, uid, prodlot_id, ctx)
location = self.pool.get('stock.location').browse(cr, uid, loc_id)
warning = {}
if (location.usage == 'internal') and (product_qty > (prodlot.stock_available or 0.0)):
warning = {
'title': _('Bad Lot Assignation !'),
'message': _('You are moving %.2f products but only %.2f available in this lot.') % (product_qty, prodlot.stock_available or 0.0)
}
return {'warning': warning}
References