コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4689 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
2月 22
5652
0
5月 15
3166
2
11月 23
18716
2
1月 19
4223
1
12月 17
3700