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

Odoo by default shows all the lot/serial numbers while preparing delivery order/ Warehouse Out.

This is very difficult to check which serial is already used and which is not. Further ODOO by default doesn't filter serials sequence wise.

Is there anyone who knows/has coding to hide the serials which are already used and to sequence the serials FIFO wise (we use date wise in and out for eg. 26.12.2019 - 1A,   26.12.2019 - 2A likewise )


อวตาร
ละทิ้ง

Hi
I have now set my domain to [["quant_ids.on_hand","=",True]].
By doing so only the Serial Numbers that are in stock is shown in the list.

คำตอบที่ดีที่สุด


    @api.onchange("product_id")
def _onchange_product_id_set_lot_domain(self):
available_lot_ids = []
if self.product_id:
quants = self.env["stock.quant"].read_group(
[
("product_id", "=", self.product_id.id),
("location_id", "child_of", self.location_id.id),
("quantity", ">", 0),
("lot_id", "!=", False),
],
["lot_id"],
"lot_id",
)
available_lot_ids = [quant["lot_id"][0] for quant in quants]
self.lot_id = False
return {"domain": {"lot_id": [("id", "in", available_lot_ids)]}}


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

If you keep removal strategy as FIFO then it picks and reserves the proper lot number automatically so you don't need to bother about available/not reserved lots.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi

Did you find any solution to this request? Please share if you did.

Regards,
Rickard

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

That is a standard feature. YOu can deactivate that in Inventory > Configuration There is an option "Display Lots & Serial Numbers"

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 17
3988
0
ก.ย. 23
1474
2
ม.ค. 20
10309
1
ก.พ. 25
2013
3
ก.ค. 22
5716