Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
7654 Представления

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
5193
0
сент. 15
5489
0
мар. 25
461
0
янв. 25
2671
1
авг. 23
13574