This question has been flagged
1 Reply
5615 Views

i'm new in openerp coding part. i want to add a new field in hr.applicant. how can i use inheritance concept?

Avatar
Discard
Best Answer

first u have to inhert hr.applicant class in py file : 1)

from osv import osv, fields
class hr_applicant(osv.osv):
       _inherit = "hr.applicant"
      _columns = {
          'field1' : fields.char('name', size=246),
      }

and then u have to inherit hr.applicant form / tree view in xml file

2)

 <record model="ir.ui.view" id="crm_case_form_view_job">
        <field name="name">Jobs - Recruitment Form</field>
        <field name="model">hr.applicant</field>
        <field name="arch" type="xml">
          <field name="inherit_id" ref="crm.crm_case_form_view_job"/>
          <form string="Jobs - Recruitment Form" version="7.0">
                     <field name="field1"/>
         </form>
        <field>
 </record>

thanks

Avatar
Discard
Author

is this way to implement as a new module?

Author

if any thing extra i need to add as create a new module for this?

yes u need to create __init__.py file and __openerp__.py file

Author

Thanks for your reply.

if you are satify with answer then plz accept the answer

Author

<field name="inherit_id" ref="crm.crm_case_form_view_job"/> if i inherit another model, what will be the ref of that model? How can i find it?

Author

I create using the above code, but it shows error.