Odoo Help

Welcome!

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

0

I want to add a new field in hr.applicant, how can i add using inheritance?

By
rosey
on 8/31/13, 5:33 AM 1,442 views

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

0
Ali Ravani
On 8/31/13, 6:42 AM

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

is this way to implement as a new module?

rosey
on 8/31/13, 7:37 AM

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

rosey
on 8/31/13, 7:39 AM

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

Ali Ravani
on 8/31/13, 8:25 AM

Thanks for your reply.

rosey
on 8/31/13, 11:10 AM

if you are satify with answer then plz accept the answer

Ali Ravani
on 9/11/13, 8:47 AM

<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?

rosey
on 9/13/13, 2:11 AM

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

rosey
on 11/7/13, 4:21 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 8/31/13, 5:33 AM
Seen: 1442 times
Last updated: 3/16/15, 8:10 AM