コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
4021 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
3
4月 24
2400
0
12月 19
5533
3
8月 22
7139
1
2月 22
9546
4
7月 16
5028