콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3278 화면

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.