Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
162 มุมมอง

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
3359
0
เม.ย. 24
1644
0
มี.ค. 24
1432
One lot number bind with two products แก้ไขแล้ว
1
ธ.ค. 23
1943
0
ต.ค. 23
1504