Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
10148 Представления

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
2521
3
февр. 25
3826
0
мая 24
46
1
апр. 24
3522
4
сент. 23
5068