Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4786 Visualizzazioni

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
Abbandona

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
feb 22
5704
0
mag 15
3248
2
nov 23
18818
2
gen 19
4282
1
dic 17
3763