Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
10119 Переглядів

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)  

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор

Thanks Yenthe

Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
серп. 25
2497
3
лют. 25
3803
0
трав. 24
46
1
квіт. 24
3514
4
вер. 23
5055