Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
10140 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

Thanks Yenthe

Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
ago 25
2508
3
feb 25
3811
0
mag 24
46
1
apr 24
3516
4
set 23
5059