Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
10105 Zobrazení

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)  

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Autor

Thanks Yenthe

Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
srp 25
2495
3
úno 25
3795
0
kvě 24
46
1
dub 24
3512
4
zář 23
5050