Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
10118 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

Thanks Yenthe

Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Aug. 25
2496
3
Feb. 25
3803
0
Mai 24
46
1
Apr. 24
3512
4
Sept. 23
5055