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

Hello, I'm trying to find a way to hide a required field when I can infer it from context. Specifically, suppose I have a many2one field company --> locals, and I want to make it possible to add locals in two different ways:

  1. straight from a menu showing a tree view of the locals
  2. directly from company

I want the first one to show you the option to pick a company to associate the local with (since it doesn't make sense to have a local not associated with any company), and I also want the second option to not show the company at all and infer it from context. To infer it from context, I have successfully added the 'context={'default_company_id':company_id}}', which I copied from some other place that did exactly what I wanted. What I couldn't find though is how to not show the field at all in case the company_id is inferred from context.

Thanks in advance for any solutions or suggestions.

Best regards, Bruno Figares

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 21
2232
fields context no working แก้ไขแล้ว
2
ส.ค. 18
3804
3
พ.ค. 24
7245
0
ส.ค. 18
32473
5
มี.ค. 15
9732