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

I have these routes:


WH/OUT/00025

WH/PACK/00010

WH/PICK/00012


I manage to display button to PICK and PACK by adding 


attrs="{ 'invisible': ['|', ('state', '!=', 'done'), ('picking_type_code', '!=', 'internal')]}"


How can I limit it only to PICK?

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

Hi, 

There are 2 options: 

1- add a domain pointing at picking_type_code == "internal" And picking_type_id.sequence_code == 'PICK'

2- Add compute field, is_pick for example, which will be True if conditions writtten in 1 are OK or you can even check the locations of the picking_type_id: if movement is from A to B , then you consider it a PICK operation => ('default_location_src_id', '=', REF TO A), ('default_location_dest_id', '=', REF TO B)

if your process is normal pick pack ship, i would recommand option 1. it's simpler and faster.

But if you work on multi company or you have different pick locations with code that can change.. i'd recommand option 2.

hope this helps.

อวตาร
ละทิ้ง
ผู้เขียน

Sorry for a late reply, but when I add:
attrs="{ 'invisible': ['|', ('state', '!=', 'done'), ('picking_type_id.sequence_code ', '!=', 'PICK')]}"/>
It trows an error, for some reason I cant access attribute of picking_type_id, any idea why?

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 24
1132
1
ก.พ. 24
474
1
ต.ค. 22
2255
1
ก.ค. 25
497