Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
10144 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

Thanks Yenthe

Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
elok. 25
2518
3
helmik. 25
3819
0
toukok. 24
46
1
huhtik. 24
3519
4
syysk. 23
5064