This question has been flagged
1 Reply
6881 Views
{
    'name': 'HR Recruitment Extensionssss',
    'version': '1.1',
    'category': 'Generic Modules',
    'description': """
    After Applicantis hired it will automatically fetch value from Applicants to Employee master
       """,
    'author': 'Sridhar',
    'depends': ['base','hr','hr_recruitment'],
    'update_xml': ['hr_reqiurement_ext_view.xml'],
    'installable': True,
    'active': False,
}
__openerp__.py

class hr_recruitment_ext(osv.osv):
    _name = 'hr.recruitment.ext'
    _description = 'Extension of the Reqirement process'
    _inherit = 'hr.applicant'
    _columns ={
        'doj':fields.date('Date of Birth'),
        'presentsal':fields.integer('Present Salary', size=16),
    }
hr_recruitment_ext()

hr_recruitment_ext.py

<?xml version="1.0"?>
<openerp>
    <data>
    <record model="ir.ui.view" id ="hr_recruitment_ext_form">
        <field name = "name"> hr.applicant</field>
        <field name = "model"> hr.applicant</field>
        <field name = "type">form</field>
        <field name = "inherit_id" ref ="hr_recruitment.crm_case_form_view_job"/>
        <field name = "arch" type ="xml">
            <notebook position="inside">
                      <page string="Relations">
                    <!--  <field name="relation_ids" colspan="4" nolabel="1"/>-->
             <field name = "doj"/>
                  <field name = "presentsal"/>
        </page>
           </notebook>

        </field>
    </record>
    </data>
</openerp>

hr_requrement_ext_view.xml

I thing every thing is done perfectly but it is not working please help for this problem. this error is occurred. except_orm: (u'ValidateError', u'The value " form" for the field "ir_ui_view.type" is not in the selection')

thanks and regards sridharan G Chennai

Avatar
Discard

If you find that someone has helped you sincerely you should credit them by clicking the up arrow beside their answer. If you find that someone has provided you with a correct answer to your question you should alert all future readers that the answer is correct using the check mark beside their answer.

Best Answer

This line:

<field name = "type"> form</field>

Must be

<field name = "type">form</field>

The error is the space before the word form

And correct the view with this:

Python code:

class hr_applicant(osv.osv):
    _inherit = 'hr.applicant'
    _columns = {
        'doj':fields.date('Date of Birth'),
        'presentsal':fields.integer('Present Salary'),
    }
hr_applicant()

View Code

<?xml version="1.0"?>
<openerp>
    <data>
    <record model="ir.ui.view" id="hr_recruitment_ext_form">
        <field name="name">hr.applicant</field>
        <field name="model">hr.applicant</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="hr_recruitment.crm_case_form_view_job"/>
        <field name="arch" type="xml">
            <field name="partner_id" position="before">
                   <field name="doj"/>
                   <field name="presentsal"/>
           </field>
        </field>
    </record>
    </data>
</openerp>
Avatar
Discard
Author

thanks for your answer after i solving the error i got this error.

You must correct it in your view file, too!

Author

Now this error raise.... "except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')"

Author

Help me mr.Francesco Apruzzese i spend lot of time for this problem...

I've updated my answer with new python and xml code

Author

ok tel me a positive answer... i'm waiting for your answer...

Author

ok i will check and tell it is work or not...

Author

same error... what can i do every thing i correct but it is not not working in openerp 7.

I've re-updated my answer. The xml code is the some but the python code is changed. Please, try it.

Author

No sir it is not working... i will try another database....

One moment. Recorrect python code. Try now.

Author

Fresh database it is installed but fields cant view, AttributeError: View definition error for inherited view 'hr_recruitment_ext.hr_recruitment_ext_form' on model 'hr.applicant': Element '<notebook>' not found in parent view 'hr_recruitment.crm_case_form_view_job'.]

Which version of openerp are you using?

Author

OpenERP 7 sir,

The error is you are trying to insert a page in a notebook that not exist. If you see the original view you can see that in your view there isn't a notebook. I've updated my xml code in the answer...try it, please.

Author

again this error will come after restarting the server this error will come "except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')" Again i creating new data base means only this problem solve.

I've update xml and python again. Try now.

Author

TypeError: The model "hr.recruitment" specifies an unexisting parent class "hr.recruitment" You may need to add a dependency on the parent class' module.

go in the _openerp_.py fiel and add hr_recruitment in the dependences

Author

i already added not woking... { 'name': 'HR Recruitment Extensionssss', 'version': '1.1', 'category': 'Generic Modules', 'description': """ After Applicantis hired it will automatically fetch value from Applicants to Employee master """, 'author': 'Sridhar', 'depends': ['base','hr','hr_recruitment'], 'update_xml': ['hr_reqiurement_ext_view.xml'], 'installable': True, 'active': False, }

xml and python update again. Try now.

Author

yes it is working perfectly thank you so much...

Author

send me a face book id friend...

Oh, good news!!!! :D Now you can set this answer as correct to help future user and if you want you can give me a +1 clicking on up arrow.

I've not a facebook account, I'm sorry....:)

Author

linked in id...

You can find it in my profile bio...;)

Author

i'm new for OpenERP if i having doubt means i easyily contact you that why i asking sir... any have thank u so much...

The best way to solve the problem is to use this site so also other user ca found solution to their problem. P.S. Rember to set my answer as correct to close the answer and help future user search.

Author

sir again i adding i two field means i facing same problem why this coming... reason???

Author

sir, same code work on the Demo DB only other DB it is not working, error is same "except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')" it is OpenERP 7 problem or my side problem... please help me sir, it is very confusion for me...