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

My model Autogallery has a function check(self,value) and one2many field car_ids. Inside product_ids there is a float field product_size. I would like to highlight my tree with respect to wheel_size. I cannot  introduce a computed field in Car, because method check() refers to the fields inside Autogallery, so it will return different values for different Autogallery.  Is it possible to call function in expression for colors? If not, what implementation is possible?


a snippet of Autogallery view

<field name="car_ids" widget="one2many_list">
<tree string="R" colors="???self.check('wheel_id')???">
<field name="wheel_size"/>
อวตาร
ละทิ้ง
ผู้เขียน

Correction

Model Car has a float field wheel_size.

instead: Inside product_ids there is a float field product_size.

ผู้เขียน คำตอบที่ดีที่สุด

Shurshilov,

You are recommending to add another field to the model, which I would like to avoid, but looks like it is the only solution. I am still looking for an implementation with direct compute of the color. 

Thanks

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

Hi, see my answer

https://www.odoo.com/forum/help-1/question/odoo-xml-compare-field-with-character-126560#answer-126565

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 24
2400
0
ธ.ค. 19
5570
color code in odoo tree view แก้ไขแล้ว
3
ส.ค. 22
7212
1
ก.พ. 22
9615
4
ก.ค. 16
5060