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

Hi,

    I have a boolean field and a button. I want this boolean field to be true only if the button pressed and mail sends.

my boolean field, mail_send = fields.Boolean('mail send)  

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Shaffaf,

You simply make a button in the XML with a function defined in it like this:

<button name="your_button" string="Send e-mail" type="object" class="btn-primary"/>

Then define a Python function where you set the boolean to true:

@api.multi
def your_button(self):
    self.your_boolean_field = True

Regards,
Yenthe

Awatar
Odrzuć
Autor

Thanks Yenthe

Najlepsza odpowiedź

How would the syntax be if my checkbox is in the model of sale.order and my button in account.move?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sie 25
2502
3
lut 25
3805
0
maj 24
46
1
kwi 24
3514
4
wrz 23
5056