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

I want to change sale order lines colour based on selction field


py

decoration_color = fields.Selection([('red', 'red'), ('green', 'green'), ('blue', 'blue'), ('purple', 'purple')])


xml code 

expr="//sheet/notebook/page[@name='order_lines']/field[@name='order_line']/tree"
position="attributes">
name="decoration-danger">decoration_color == 'red'
name="decoration-success">decoration_color == 'green'
name="decoration-info">decoration_color == 'blue'
name="decoration-warning">decoration_color == 'purple'

 this is changing colours of description,unit price and subtotal only,all the sale order line fields are not changing

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

In the tree view definition (usually in the XML file), add the decoration attribute to the tree tag and set it to a domain expression that evaluates the decoration_color field. For example:

tree string="Sale Order Lines" decoration="decoration_color == 'red' ? 'red:light' : (decoration_color == 'green' ? 'green:light' : (decoration_color == 'blue' ? 'blue:light' : 'purple:light'))">
!-- Define the tree columns and fields -->
/tree>


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
How to generate line numbers on quotes แก้ไขแล้ว
1
ม.ค. 25
3834
2
ส.ค. 24
6060
6
ธ.ค. 22
9175
1
พ.ค. 25
6619
0
มี.ค. 24
2611