Help

2

Error in view: Invalid XML for View Architecture

Avatar
sridhar
{
    '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

1 备注
头像
丢弃
Avatar
Martin
-

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.

1 答案
5
Avatar
Francesco OpenCode
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>
31 注释
头像
丢弃
Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

You must correct it in your view file, too!

Avatar
sridhar
-

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

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

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

Avatar
sridhar
-

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

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

One moment. Recorrect python code. Try now.

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

Which version of openerp are you using?

Avatar
sridhar
-

OpenERP 7 sir,

Avatar
Francesco OpenCode
-

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.

Avatar
sridhar
-

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.

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

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, }

Avatar
Francesco OpenCode
-

xml and python update again. Try now.

Avatar
sridhar
-

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

Avatar
sridhar
-

send me a face book id friend...

Avatar
Francesco OpenCode
-

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.

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

linked in id...

Avatar
Francesco OpenCode
-

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

Avatar
sridhar
-

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

Avatar
Francesco OpenCode
-

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.

Avatar
sridhar
-

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

Avatar
sridhar
-

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