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.

2

Error in view: Invalid XML for View Architecture

By
sridhar
on 4/25/13, 5:22 AM 3,105 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

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.

Martin
on 4/25/13, 9:32 AM
5

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/25/13, 5:33 AM

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.

sridhar
on 4/25/13, 6:20 AM

You must correct it in your view file, too!

Francesco OpenCode
on 4/25/13, 6:21 AM

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

sridhar
on 4/25/13, 6:26 AM

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

sridhar
on 4/25/13, 6:31 AM

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

Francesco OpenCode
on 4/25/13, 6:43 AM

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

sridhar
on 4/25/13, 6:53 AM

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

sridhar
on 4/25/13, 6:54 AM

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

sridhar
on 4/25/13, 6:56 AM

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

Francesco OpenCode
on 4/25/13, 6:58 AM

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

sridhar
on 4/25/13, 7:02 AM

One moment. Recorrect python code. Try now.

Francesco OpenCode
on 4/25/13, 7:05 AM

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

sridhar
on 4/25/13, 7:17 AM

Which version of openerp are you using?

Francesco OpenCode
on 4/25/13, 7:20 AM

OpenERP 7 sir,

sridhar
on 4/25/13, 7:25 AM

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.

Francesco OpenCode
on 4/25/13, 7:34 AM

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.

sridhar
on 4/25/13, 7:43 AM

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

Francesco OpenCode
on 4/25/13, 7:48 AM

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

sridhar
on 4/25/13, 7:53 AM

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

Francesco OpenCode
on 4/25/13, 7:55 AM

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

sridhar
on 4/25/13, 8:01 AM

xml and python update again. Try now.

Francesco OpenCode
on 4/25/13, 8:04 AM

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

sridhar
on 4/25/13, 8:10 AM

send me a face book id friend...

sridhar
on 4/25/13, 8:11 AM

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.

Francesco OpenCode
on 4/25/13, 8:11 AM

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

Francesco OpenCode
on 4/25/13, 8:12 AM

linked in id...

sridhar
on 4/25/13, 8:13 AM

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

Francesco OpenCode
on 4/25/13, 8:15 AM

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

sridhar
on 4/25/13, 8:20 AM

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.

Francesco OpenCode
on 4/25/13, 8:22 AM

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

sridhar
on 4/26/13, 1:43 AM

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

sridhar
on 4/26/13, 2:08 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: 4/25/13, 5:22 AM
Seen: 3105 times
Last updated: 3/16/15, 8:10 AM