Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

api.onchange v8 doesnt work

By
zilvinas
on 9/2/15, 5:38 AM 547 views

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.

zilvinas
on 9/2/15, 7:36 AM
1
Andre de Kock
On 9/2/15, 6:41 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/2/15, 5:38 AM
Seen: 547 times
Last updated: 9/2/15, 7:40 AM