Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
10129 Lượt xem

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)  

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Yenthe

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
2502
3
thg 2 25
3805
0
thg 5 24
46
1
thg 4 24
3514
4
thg 9 23
5056