Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
1255 มุมมอง
Hi guys, I'm trying to make Customer Reference required when say Customer Tags will be "Online"
Tried with Toggle Studio to put condition on required but it's giving error:
[["partner_id.category_id","=","Online"]]

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

Hi, if anyone can help me on this question:
I'm trying to set customer reference required only if say customer tag "Online"

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

Hi Bek:

Add a custom computed boolean field to the Contacts model and use it in the domain like so.

Custom computed field:


Domain in conditional expression for Ref: 

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด
Hi, I have tried same way as you have suggested but error still same:
Error while validating view near:


            
Invalid composed field partner_id.category_id.name in attrs ({"required": [["partner_id.category_id.name","=","Online"]]})

อวตาร
ละทิ้ง

It's better to use this condition using custom module code instead of Odoo Studio

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

Hi,

Here you are comparing a Many2one field with a String. This will surely give an error. You can either provide the tag id of "Online" OR you can change the condition to [["partner_id.category_id.name","=","Online"]].

อวตาร
ละทิ้ง