[7.0] analytic_multicurrency - incompatibity between views with module hr_timesheet_invoice

Bug #1190680 reported by Yannick Vaucher @ Camptocamp on 2013-06-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Account - Analytic Accounting
Undecided
Unassigned

Bug Description

When updating modules, when you tries to update hr_timesheet_invoice, on updating the view view_account_analytic_line_form_inherit you will get the following error:

 │2013-06-13 16:54:23,362 28059 ERROR openerp_qa_geste openerp.osv.orm: Can't find field 'aa_amount_currency' in the foll
 │owing view parts composing the view of object model 'account.analytic.line':
 │ * account.analytic.line.form
 │
 │Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data
 │ model
 │2013-06-13 16:54:23,364 28059 ERROR openerp_qa_geste openerp.addons.base.ir.ir_ui_view: Can't render view hr_timesheet_
 │invoice.view_account_analytic_line_form_inherit for model: account.analytic.line
 │Traceback (most recent call last):
 │ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/addons/base/ir/ir_ui_view.py", line 126, 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 "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 2260, in fields_view_get
 │ xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
 │ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 1937, in __view_look_dom_arch
 │ raise except_orm('View error', msg)
 │except_orm: ('View error', u"Can't find field 'aa_amount_currency' in the following view parts composing the view of ob
 │ject model 'account.analytic.line':\n * account.analytic.line.form\n\nEither you wrongly customized this view, or some
 │modules bringing those views are not compatible with your current data model")
 │2013-06-13 16:54:23,368 28059 ERROR openerp_qa_geste openerp.tools.convert: Parse error in /srv/openerp/instances/opene
 │rp_qa_geste/parts/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml:118:
 │<record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
 │ <field name="name">account.analytic.line.form.to_invoice</field>

│ <field name="model">account.analytic.line</field>
│ <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
│ <field name="arch" type="xml">
│ <field name="amount" position="before">
│ <field name="to_invoice"/>
│ <field name="invoice_id"/>
│ </field>
│ </field>
│ </record>
│Traceback (most recent call last):
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/tools/convert.py", line 847, in parse
│ self._tags[rec.tag](self.cr, rec, n)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/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.is
│noupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/addons/base/ir/ir_model.py", line 936, in _update
│ model_obj.write(cr, uid, [res_id], values, context=context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/addons/base/ir/ir_ui_view.py", line 208, in write
│ return super(view, self).write(cr, uid, ids, vals, context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 4202, in write
│ self._validate(cr, user, ids, context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 1544, 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-06-13 16:54:23,369 28059 ERROR openerp_qa_geste openerp: Failed to initialize database `openerp_qa_geste`.
│Traceback (most recent call last):
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/cli/server.py", line 98, in preload_registry
│ db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/pooler.py", line 33, in get_db_and_pool
│ registry = RegistryManager.get(db_name, force_demo, status, update_module)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/registry.py", line 192, in get
│ update_module)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/registry.py", line 218, in new
odules.load_modules(registry.db, force_demo, status, update_module)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/loading.py", line 344, in load_modules
│ processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/loading.py", line 259, in load_marked_modu
│les
│ loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_
│checks=perform_checks)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/loading.py", line 191, in load_module_grap
│h
│ load_data(module_name, idref, mode)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/loading.py", line 76, in <lambda>
│ load_data = lambda *args: _load_data(cr, *args, kind='data')
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/modules/loading.py", line 127, in _load_data
│ tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/tools/convert.py", line 954, in convert_xml_import
│ obj.parse(doc.getroot())
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/tools/convert.py", line 847, in parse
│ self._tags[rec.tag](self.cr, rec, n)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/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.is
│noupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/addons/base/ir/ir_model.py", line 936, in _update
│ model_obj.write(cr, uid, [res_id], values, context=context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/addons/base/ir/ir_ui_view.py", line 208, in write
│ return super(view, self).write(cr, uid, ids, vals, context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 4202, in write
│ self._validate(cr, user, ids, context)
│ File "/srv/openerp/instances/openerp_qa_geste/parts/server/openerp/osv/orm.py", line 1544, 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!')

This is due because the module analytic_mutlicurrency override completely the view account.view_account_analytic_line_form and hr_timesheet_invoice is trying to read it. But as it is loaded before analytic_multicurrency, the model doesn't contain the function field at that time and crash.

It would be needed to make sure analytic_multicurrency is loaded before hr_timesheet_invoice

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Refactoring of views in porting should solve this issue

Changed in account-analytic:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers