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

Hi,

I need to know how to get only stockable products for a Many2one field.

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

hello

apply the domain on the M2O field

<field name="your_fieldname" domain="[('type', '=', 'product')]"/>

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

Hello Dishan,

pass domain for many2one field.

domain = "[('type','=','product')]"  if you pass this domain on your xml it will filter only stockable products.

if you want only on hand qty available products then add this domain , domain = "[('qty_available','&gt;',0)]"


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ต.ค. 23
19478
5
ต.ค. 20
4111
2
มิ.ย. 20
6713
5
เม.ย. 25
16415
1
ก.ค. 23
4446