跳至内容
菜单
此问题已终结
2 回复
10130 查看

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?

形象
丢弃
相关帖文 回复 查看 活动
2
8月 25
2502
3
2月 25
3805
0
5月 24
46
1
4月 24
3514
4
9月 23
5056