Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
147 Переглядів

Hi Odooers

We receive stock that gets a lot number assigned on receipt. This lot has samples taken by the quality department. Due to space constraints, we put the stock (lots) in to the warehouse, into their available / usual sub-locations. The quality check has not yet been completed, as we are sometimes waiting a few days for test results to come back.

We need to be able to prevent these lots from being transacted on until the quality department receives the test results and releases the lots. However, we need to know where to find these lots in the warehouse, so a general 'Quality' location will not be suitable.

Any suggestions or ideas on how to tackle this?

Аватар
Відмінити
Найкраща відповідь

Hi,

Please refer to the code:

from odoo import models, fields, api

from odoo.exceptions import ValidationError


class StockProductionLot(models.Model):

    _inherit = 'stock.production.lot'


    quality_hold = fields.Boolean(string="Quality Hold", default=True)


class StockMoveLine(models.Model):

    _inherit = 'stock.move.line'


    @api.constrains('lot_id')

    def _check_quality_hold(self):

        for line in self:

            if line.lot_id and line.lot_id.quality_hold:

                raise ValidationError(

                    f"Lot {line.lot_id.name} is on quality hold and cannot be transacted."

                )


-All new lots are by default on quality_hold = True.

-Warehouse staff can locate them in their normal bin/location.

-Picking, delivery, and manufacturing consumption will be blocked until quality_hold is unchecked by Quality Control.

-Reporting: you can filter stock.production.lot by quality_hold to see all lots under QC.



Hope it helps.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 21
3358
0
квіт. 24
1642
0
бер. 24
1432
1
груд. 23
1942
0
жовт. 23
1504