Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
4635 Представления

i can`t determine why api.onchange wont work on my custom module. it does nothing when i change value of field phone

my code:

from openerp import models, fields, api, _

class crm_lead(models.Model):

_inherit = 'crm.lead'

 ************ my other inheritet or created methods ********

api.onchange('phone')

def onchange_make_change(self):

self.email_from = 'email@email.email'

Аватар
Отменить

Andre thanks for answer. My bad, was missing @ befor api.

Лучший ответ

I don't see anything wrong with your code per se.

Could you just verify that:

  1. The name of the field is in fact "phone"

  2. The email field's name is in fact "email_from"

  3. Your Python file is imported in the "__init__.py" file

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
февр. 22
5586
0
мая 15
3119
2
нояб. 23
18669
2
янв. 19
4165
1
дек. 17
3655