← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 667237] Re: [6.0RC1] prod_lot handling needs improverment

 

@Olivier
"does not do FIFO/LIFO stock tracking (for the sake of simplicity),"

1) I didn't request FIFO/LIFO

2) For a lot of certifications it is necessary that you not only know
that you have a lot, but in which stock location  it is

3) prod lots and stock_locations  may also have different avg prices -
but that's another story

2 and 3 are solved in 
https://code.launchpad.net/~openerp-commiter/openobject-addons/chricar_price_unit

-- 
[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