Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2503 Widoki

Hello everyone,

Can anyone give me some help or clarification?
Well, that's how it is, I created a button that makes a connection between receipts and subcontracting within stock.picking, now I need this button to have the color according to the status of that shipment, for example it can appear in the reception as ready, but in the subcontracting as done, so I wanted this button to appear in green already inside the receipts, it turns out that I created the method below, as you can see but it is not working, I don't know what is missing or what is wrong. The colors would be done=green, cancel=red and the other states yellow.
Thanks in advance for help. Thanks.
My XML


And my file.py


Awatar
Odrzuć
Autor

Thank you very much, it was really only in this way that it worked... :)

Najlepsza odpowiedź

A quick workaround for what you could do it to add multiple buttons and make them visible for the current state:

[button name="action_button_open_reception" 
string="My Button"
type="object"
class="btn_class_green"
attrs="{'invisible': [('state_color', '!=', 2)]}" /]

[button name="action_button_open_reception"
string="My Button"
type="object"
class="btn_class_red"
attrs="{'invisible': [('state_color', '!=', 1)]}" /]

[button name="action_button_open_reception"
string="My Button"
type="object"
class="btn_class_blue"
attrs="{'invisible': [('state_color', '!=', 0)]}" /]

I hope this helps

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 23
1983
1
lip 23
1400
1
cze 23
1305
2
sie 23
1771
1
cze 23
1934