Reputation: 1043
Hy all,
I'm just doing my update from OpenERP 6.1 to Odoo8. I have a self written modul, I adapted the Python Code and everthings seems fine, I can also install the modul, but if i load a view i get the following error:
File "./openerp/models.py", line 1295, in _validate_fields
raise ValidationError('\n'.join(errors))
ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition
Error details:
Element '<xpath expr="//footer">' cannot be located in parent view
Error context:
View `mail.compose.message.form`
[view_id: 248, xml_id: email_template.email_compose_message_wizard_inherit_form, model: mail.compose.message, parent_id: 216]" while parsing /home/gsatter/Dokumente /odoo/odoo/seekda_addons/seekda_mail_extension/wizard/mail_compose_view.xml:4, near
<record model="ir.ui.view" id="mail.email_compose_message_wizard_form">
<field name="name">mail.compose.message.form</field>
<field name="model">mail.compose.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Compose Email">
<group col="6" colspan="4">
<field name="model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="email_from" colspan="4" required="1"/>
<field name="email_to" colspan="4" required="1"/>
<field name="email_cc" colspan="4"/>
<field name="email_bcc" colspan="4"/>
<field name="reply_to" colspan="4"/>
<field name="subject" colspan="4" widget="char" size="512"/>
<field name="references" invisible="1"/>
<field name="message_id" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Body">
<field name="body_text" colspan="4" nolabel="1" height="300" width="300"/>
</page>
<page string="Attachments">
<field name="attachment_file_ids" colspan="4" nolabel="1" string="Files">
<form>
<field name="data" filename="name" colspan="4"/>
<field name="name" colspan="4"/>
</form>
<tree>
<field name="data" filename="name" colspan="4"/>
<field name="name" colspan="4"/>
</tree>
</field>
</page>
</notebook>
<group col="4" colspan="4">
<label string="" name="placeholder" colspan="1"/>
<button icon="gtk-close" special="cancel" string="Cancel"/>
<button icon="gtk-ok" name="send_mail" string="Send" type="object"/>
</group>
</form>
</field>
</record>
Has anybody a idea what is wrong with this wizard? Here is my view (wizard):
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="mail.email_compose_message_wizard_form">
<field name="name">mail.compose.message.form</field>
<field name="model">mail.compose.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Compose Email">
<group col="6" colspan="4">
<field name="model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="email_from" colspan="4" required="1"/>
<field name="email_to" colspan="4" required="1"/>
<field name="email_cc" colspan="4"/>
<field name="email_bcc" colspan="4"/>
<field name="reply_to" colspan="4"/>
<field name="subject" colspan="4" widget="char" size="512"/>
<field name="references" invisible="1"/>
<field name="message_id" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Body">
<field name="body_text" colspan="4" nolabel="1" height="300" width="300"/>
</page>
<page string="Attachments">
<field name="attachment_file_ids" colspan="4" nolabel="1" string="Files">
<form>
<field name="data" filename="name" colspan="4"/>
<field name="name" colspan="4"/>
</form>
<tree>
<field name="data" filename="name" colspan="4"/>
<field name="name" colspan="4"/>
</tree>
</field>
</page>
</notebook>
<group col="4" colspan="4">
<label string="" name="placeholder" colspan="1"/>
<button icon="gtk-close" special="cancel" string="Cancel"/>
<button icon="gtk-ok" name="send_mail" string="Send" type="object"/>
</group>
</form>
</field>
</record>
</data>
Her is a view which inherits the view top (it's located in the addon email_template):
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="email_compose_message_wizard_inherit_form">
<field name="name">mail.compose.message.form</field>
<field name="model">mail.compose.message</field>
<field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
<field name="groups_id" eval="[(4,ref('base.group_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//footer" position="inside">
<group class="oe_right oe_form" col="1">
<div>Use template
<!--FIX: To avoid css issue of many2one field in footer temporary used oe_form (BUG:1152464)-->
<field name="template_id" nolabel="1" class='oe_inline'
options="{'no_create': True}"
on_change="onchange_template_id(template_id, composition_mode, model, res_id, context)" domain="[('model_id.model','=',model)]"
context="{'default_model': model, 'default_body_html': body, 'default_subject': subject}"/>
</div>
<button icon="/email_template/static/src/img/email_template_save.png"
type="object" name="save_as_template" string="Save as new template" class="oe_link"
help="Save as a new template"/>
</group>
</xpath>
</field>
</record>
</data>
Thank You
Upvotes: 2
Views: 2665
Reputation: 21315
The problem is
...
...
<field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
...
...
<xpath expr="//footer" position="inside">
...
...
Your above view inherit mail.email_compose_message_wizard_form
view. And in your view you mention <xpath expr="//footer" position="inside">
add below code inside parent's view's footer
tab. But parent view has no footer
tag and its giving error Element '<xpath expr="//footer">' cannot be located in parent view
You can try
<xpath expr="//notebook" position="inside">
Upvotes: 1