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

Hello,

At the moment I filer fields by using id in xml file, by using ID:

['|', ('picking_type_id', '=', 8), ('picking_type_id', '=', 9)]


Is it possible somehow to have link in xml dynamically, like it's possible in python code?

id= self.env.ref('model.item").id


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

Hi,

The best solution is to attribute an xml_id to your picking type in order to call it with reference: self.env.ref(..)

To do that you have to create a ir_model_data record related to the picking type ( it's better and advanced as you need to add it in migrations folder.. change version in manifest to trigger it ...)

you can also try to export the list of picking types and odoo will automatically attribute an xml_id like '__export__.some_text_here' 
then use it in your reference and see if it's going to work.

Hope this helps.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 25
2542
1
ก.ย. 25
2539
3
ก.ค. 25
3991
1
พ.ค. 25
2108
4
พ.ค. 25
3431