openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #22671
[Bug 1111340] [NEW] [7.0] XML replace fails on a new update
Public bug reported:
Hello,
I have a strange issue. I'm currently removing the default contact form
in res_partner view form.
Using:
<record id="view_partner_form_usedefault_form_for_contacts" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<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_partner_form_usedefault_form_for_contacts for model: res.partner
Traceback (most recent call last):
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 125, in _check_render_view
fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
File ".../server/openerp/addons/base/res/res_partner.py", line 291, in fields_view_get
res = super(res_partner,self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
File ".../server/openerp/osv/orm.py", line 2262, in fields_view_get
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
File ".../server/openerp/osv/orm.py", line 1934, in __view_look_dom_arch
model = res[0][1]
IndexError: list index out of range
2013-01-31 10:36:11,872 12143 ERROR openerp_test openerp.tools.convert: Parse error in .../specific-addons/test/res_partner_view.xml:149:
<record id="view_partner_form_usedefault_form_for_contacts" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<form string="Contact" position="replace">
<form string="Contact">
</form>
</form>
</field>
</record>
Traceback (most recent call last):
File ".../server/openerp/tools/convert.py", line 847, in parse
self._tags[rec.tag](self.cr, rec, n)
File ".../server/openerp/tools/convert.py", line 814, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File ".../server/openerp/addons/base/ir/ir_model.py", line 929, in _update
model_obj.write(cr, uid, [res_id], values, context=context)
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/openerp/osv/orm.py", line 4203, in write
self._validate(cr, user, ids, context)
File ".../server/openerp/osv/orm.py", line 1546, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
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/openerp/cli/server.py", line 98, in preload_registry
db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
File ".../server/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module)
File ".../server/openerp/modules/registry.py", line 192, in get
update_module)
File ".../server/openerp/modules/registry.py", line 214, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File ".../server/openerp/modules/loading.py", line 343, in load_modules
processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
File ".../server/openerp/modules/loading.py", line 258, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File ".../server/openerp/modules/loading.py", line 189, in load_module_graph
load_update_xml(module_name, idref, mode)
File ".../server/openerp/modules/loading.py", line 73, in <lambda>
load_update_xml = lambda *args: _load_data(cr, *args, kind='update_xml')
File ".../server/openerp/modules/loading.py", line 126, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File ".../server/openerp/tools/convert.py", line 954, in convert_xml_import
obj.parse(doc.getroot())
File ".../server/openerp/tools/convert.py", line 847, in parse
self._tags[rec.tag](self.cr, rec, n)
File ".../server/openerp/tools/convert.py", line 814, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File ".../server/openerp/addons/base/ir/ir_model.py", line 929, in _update
model_obj.write(cr, uid, [res_id], values, context=context)
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/openerp/osv/orm.py", line 4203, in write
self._validate(cr, user, ids, context)
File ".../server/openerp/osv/orm.py", line 1546, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
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_form_usedefault_form_for_contacts from my from XML file
2. update the module.
3. add again view_partner_form_usedefault_form_for_contacts
4. update the module.
And there I have what I need. But this is quite anoying...
Everything is ok. But, next time
** Affects: openobject-server
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1111340
Title:
[7.0] XML replace fails on a new update
Status in OpenERP Server:
New
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_partner_form_usedefault_form_for_contacts" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<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_partner_form_usedefault_form_for_contacts for model: res.partner
Traceback (most recent call last):
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 125, in _check_render_view
fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
File ".../server/openerp/addons/base/res/res_partner.py", line 291, in fields_view_get
res = super(res_partner,self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
File ".../server/openerp/osv/orm.py", line 2262, in fields_view_get
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
File ".../server/openerp/osv/orm.py", line 1934, in __view_look_dom_arch
model = res[0][1]
IndexError: list index out of range
2013-01-31 10:36:11,872 12143 ERROR openerp_test openerp.tools.convert: Parse error in .../specific-addons/test/res_partner_view.xml:149:
<record id="view_partner_form_usedefault_form_for_contacts" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<form string="Contact" position="replace">
<form string="Contact">
</form>
</form>
</field>
</record>
Traceback (most recent call last):
File ".../server/openerp/tools/convert.py", line 847, in parse
self._tags[rec.tag](self.cr, rec, n)
File ".../server/openerp/tools/convert.py", line 814, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File ".../server/openerp/addons/base/ir/ir_model.py", line 929, in _update
model_obj.write(cr, uid, [res_id], values, context=context)
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/openerp/osv/orm.py", line 4203, in write
self._validate(cr, user, ids, context)
File ".../server/openerp/osv/orm.py", line 1546, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
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/openerp/cli/server.py", line 98, in preload_registry
db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
File ".../server/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module)
File ".../server/openerp/modules/registry.py", line 192, in get
update_module)
File ".../server/openerp/modules/registry.py", line 214, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File ".../server/openerp/modules/loading.py", line 343, in load_modules
processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
File ".../server/openerp/modules/loading.py", line 258, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File ".../server/openerp/modules/loading.py", line 189, in load_module_graph
load_update_xml(module_name, idref, mode)
File ".../server/openerp/modules/loading.py", line 73, in <lambda>
load_update_xml = lambda *args: _load_data(cr, *args, kind='update_xml')
File ".../server/openerp/modules/loading.py", line 126, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File ".../server/openerp/tools/convert.py", line 954, in convert_xml_import
obj.parse(doc.getroot())
File ".../server/openerp/tools/convert.py", line 847, in parse
self._tags[rec.tag](self.cr, rec, n)
File ".../server/openerp/tools/convert.py", line 814, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File ".../server/openerp/addons/base/ir/ir_model.py", line 929, in _update
model_obj.write(cr, uid, [res_id], values, context=context)
File ".../server/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
return super(view, self).write(cr, uid, ids, vals, context)
File ".../server/openerp/osv/orm.py", line 4203, in write
self._validate(cr, user, ids, context)
File ".../server/openerp/osv/orm.py", line 1546, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
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_form_usedefault_form_for_contacts from my from XML file
2. update the module.
3. add again view_partner_form_usedefault_form_for_contacts
4. update the module.
And there I have what I need. But this is quite anoying...
Everything is ok. But, next time
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1111340/+subscriptions
Follow ups
References