Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3228 Переглядів

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.

Найкраща відповідь

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.

Автор

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.