Odoo Help

1

Does field inheritance actually work? Or is it buggy?

By
John Baldwin
on 1/23/15, 4:36 AM 725 views

In one modification I inherited res.partner field "phone" and changed it to required in my python class:

my_res_partner.py
________________________________________
from openerp import models, fields, api
class my_res_partner(models.Model):

    _inherit = 'res.partner'
    phone = fields.Char(required=True, select=True)
__________________________________________

BUT IN ANOTHER IT WILL NOT WORK TO CHANGE THE STRING!
I checked and the string is defined in the crm_lead.py... Why won't this work?

my_crm.py
---------------------------------------------------------------------------
from openerp import models, fields, api
class my_crm(models.Model):

    _inherit = 'crm.lead' 
    contact_name = fields.Char(string="Name")
___________________________________________

If you can answer this please do. Thanks in advance.

 

Odoo is much buggy, we had face many inheritance issues, including generated traceback much horrible.

Zahin
on 8/21/16, 4:02 AM
0

Ivan

--Ivan--
3245
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/23/15, 4:50 AM

The easiest way to test whether your changes have been incorporated is to check from Settings >> Technical >> Database Structure >> Models, search for and open crm.lead and check the Field Label of the field you are refering to.

Now, some possibilities why it is not displayed as per your modification:

  • You have not restarted the server and upgraded your module.  If this is the case you wouldn't see it from the menu as well.
  • The view that uses this field overrides the string, e.g. <field name="contact_name" string="This will be shown regardless the string in your column definition"/>

Do you see anything wrong in my code? Because I have restarted the server and forced my module to load from command line. I will check to see what Models says but it is a very frustrating buggy issue.

John Baldwin
on 1/23/15, 4:59 AM

Checked Settings>>Technical>>Database Structure>>Models and the label is still the original label "Contact Name". Then did a "openerp-server -d app -u all " command line upgrade and restart. Then went to my module inside odoo and di upgrade... still not working.

John Baldwin
on 1/23/15, 5:08 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/23/15, 4:36 AM
Seen: 725 times
Last updated: 8/21/16, 4:01 AM