[7.0] XML replace fails on a new update
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
OpenERP Publisher's Warranty Team |
Bug Description
Hello,
I have a strange issue. I'm currently removing the default contact form in res_partner view form.
Using:
<record id="view_
<field name="name"
<field name="model"
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.
<field name="arch" type="xml">
<form string="Contact" position="replace">
</form>
</field>
</record>
Fisrt time I update my module everythings go fine.
However, while I'm developping this module if I do some changes in my xml file on other inherit on the res_partner_view, this change fails and raise the following error on module update.
Can't render view test.view_
Traceback (most recent call last):
File ".../server/
fvg = self.pool.
File ".../server/
res = super(res_
File ".../server/
xarch, xfields = self.__
File ".../server/
model = res[0][1]
IndexError: list index out of range
2013-01-31 10:36:11,872 12143 ERROR openerp_test openerp.
<record id="view_
<field name="name"
<field name="model"
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.
<field name="arch" type="xml">
</record>
Traceback (most recent call last):
File ".../server/
self.
File ".../server/
id = self.pool.
File ".../server/
model_
File ".../server/
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/
self.
File ".../server/
raise except_
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2013-01-31 10:36:11,873 12143 ERROR openerp_test openerp: Failed to initialize database `openerp_test`.
Traceback (most recent call last):
File ".../server/
db, registry = openerp.
File ".../server/
registry = RegistryManager
File ".../server/
update_module)
File ".../server/
openerp.
File ".../server/
processed = load_marked_
File ".../server/
loaded, processed = load_module_
File ".../server/
load_
File ".../server/
load_update_xml = lambda *args: _load_data(cr, *args, kind='update_xml')
File ".../server/
tools.
File ".../server/
obj.
File ".../server/
self.
File ".../server/
id = self.pool.
File ".../server/
model_
File ".../server/
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/
self.
File ".../server/
raise except_
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
I assume the form string="Contact" is somehow already deleted and it tries to delete it a second time...
To resolve I can
1. remove view_partner_
2. update the module.
3. add again view_partner_
4. update the module.
And there I have what I need. But this is quite anoying...
revision-ids
server: <email address hidden>
webclient: <email address hidden>
addons: <email address hidden>
description: | updated |
Changed in openobject-server: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Please, try:
<record id="view_ partner_ form_usedefault _form_for_ contacts" >res.partner. form</field> >res.partner< /field> view_partner_ form"/>
<//xpath expr="/ /field[ @name=' Contact' ]" position="replace" />
model="ir.ui.view">
<field name="name"
<field name="model"
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.
<field name="arch" type="xml">
</field>
</record>
The tag form name="Contact" does not make sense. Eventually, you could try
with field tag, but in this case you will wipe out all attributes, but the
field will still be in the view
Best regards
2013/1/31 Yannick Vaucher @ Camptocamp <email address hidden>
> ** Description changed: partner_ form_usedefault _form_for_ contacts" >res.partner. form</field> >res.partner< /field> view_partner_ form"/> partner_ form_usedefault _form_for_ contacts" >res.partner. form</field> >res.partner< /field> view_partner_ form"/> partner_ form_usedefault _form_for_ contacts openerp/ addons/ base/ir/ ir_ui_view. py", line 125, in get(view. model). fields_ view_get( cr, uid, view_id= view.type, context=context) openerp/ addons/ base/res/ res_partner. py", line 291, in partner, self).fields_ view_get( cr, user, view_id, openerp/ osv/orm. py", line 2262, in fields_view_get view_look_ dom_arch( cr, user, result['arch'], openerp/ osv/orm. py", line 1934, in look_dom_ arch openerp/ addons/ base/ir/ ir_ui_view. py", line 125, in
>
> Hello,
>
> I have a strange issue. I'm currently removing the default contact form
> in res_partner view form.
>
> Using:
>
> - <record id="view_
> model="ir.ui.view">
> - <field name="name"
> - <field name="model"
> - <field eval="1" name="priority"/>
> - <field name="inherit_id" ref="base.
> - <field name="arch" type="xml">
> - <form string="Contact" position="replace">
> - <form string="Contact">
> - </form>
> - </form>
> - </field>
> - </record>
> -
> + <record id="view_
> model="ir.ui.view">
> + <field name="name"
> + <field name="model"
> + <field eval="1" name="priority"/>
> + <field name="inherit_id" ref="base.
> + <field name="arch" type="xml">
> + <form string="Contact" position="replace">
> + <form string="Contact">
> + </form>
> + </form>
> + </field>
> + </record>
>
> Fisrt time I update my module everythings go fine.
>
> However, while I'm developping this module if I do some changes in my
> xml file on other inherit on the res_partner_view, this change fails and
> raise the following error on module update.
>
> Can't render view test.view_
> for model: res.partner
> Traceback (most recent call last):
> - File ".../server/
> _check_render_view
> - fvg = self.pool.
> view.id, view_type=
> - File ".../server/
> fields_view_get
> - res = super(res_
> view_type, context, toolbar=toolbar, submenu=submenu)
> - File ".../server/
> - xarch, xfields = self.__
> view_id, context=ctx)
> - File ".../server/
> __view_
> - model = res[0][1]
> + File ".../server/
> _ch...