Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7955 มุมมอง

Hello ,

How to call method on button using v8 codding standard?

Here i have state selection field on my model, i have button when i click on that button than state should be change via button . 

What i need to do?

need help.

thanks.

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Prince,

Here you go!

**In xml file**

<button name="your_method_name" string="Button label" type="object" class="oe_hightlight"/>

** In py file**

from openerp import models,fields,api

class your_class_name(models.Model)

    _name = 'model.model'  #your model name

   #here is your method defination which you have called from xml file.

   @api.multi

    def your_method_name(self)

        #body of your method

        #here in this method you can direct access any field value for current record using self

        return True  #return True/False or as per your requrement.

  

Hope This will Help

Regards,

Anil.

 

 

 

 

 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 22
5460
0
ก.ย. 15
5764
0
มี.ค. 25
1148
0
ม.ค. 25
3192
1
ส.ค. 23
14458