تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
10135 أدوات العرض

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
أغسطس 25
2507
3
فبراير 25
3809
0
مايو 24
46
1
أبريل 24
3516
4
سبتمبر 23
5058