跳至内容
菜单
此问题已终结
1 回复
8136 查看
{
    '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

形象
丢弃

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.

最佳答案

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>
形象
丢弃
编写者

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

You must correct it in your view file, too!

编写者

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

编写者

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

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

编写者

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

编写者

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

编写者

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.

编写者

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

One moment. Recorrect python code. Try now.

编写者

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?

编写者

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.

编写者

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.

编写者

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

编写者

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.

编写者

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

编写者

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....:)

编写者

linked in id...

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

编写者

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.

编写者

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

编写者

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

相关帖文 回复 查看 活动
1
3月 15
4648
2
3月 15
10250
6
9月 17
7873
1
4月 15
4555
1
3月 15
4178