← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 667237] [NEW] [6.0RC1] prod_lot handling needs improverment

 

Public bug reported:

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}

** Affects: openobject-addons
     Importance: Undecided
         Status: New

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

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}





Follow ups

References