Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
4695 Prikazi

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'

Avatar
Opusti

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

Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
feb. 22
5654
0
maj 15
3171
2
nov. 23
18721
2
jan. 19
4224
1
dec. 17
3703