문제

I am using openerp 6.1.1 and trying to create an applicant from thunderbird addon.

I have created a custom module to add some extra fields to the hr_applicant model.

The thunderbird OpenERP addon does not show the option to create an Applicant.

When I remove the custom module, I am able to see the option in the thunderibird add on.

I am not clear what am I doing wrong in the custom module:

class hr_applicant_custom (osv.osv):
  _name = 'hr.applicant'
  _inherit = 'hr.applicant'
  _columns = {
    'year_passing': fields.integer('Passing Year', help='Year of passing'),
    'experience': fields.float('Experience', digits=(3,1)),    
  }
hr_applicant_custom()

Please advice. Thanks in advance.

도움이 되었습니까?

해결책

In Thunderbird, module you can see the model which are inheriting the model mail.thread for this behavior reposnsible method is message_capable_models, Which will filter model which are inheriting the model mail.thread

In your case if you see closely in code of the module hr_recruitment you will find hr.applicant model is inheriting the mail.thread, so you will see it under TB Push Mai list, now in your module what you are doing is modifying the _inherit attribute of the model hr.applicant so due to python MRO this will be change to new class and now this model is not eligible for creating new record.

Solution : you should try multiple model in _inherit like inherit = ['mail.thread', 'hr.applicant']

Hope this will help.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top