7.0 account_parallel_currency: uses undefined account.account field 'centralized'

Bug #1296740 reported by Alexandre Fayolle - camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Account - Consolidation
Fix Released
High
Lorenzo Battistini

Bug Description

Trying to install account_consolidation in 7.0 database with account_parallel_currency resulted in the following crash:

2014-03-24 13:35:05,112 26461 INFO test_ocb_oca70 openerp.modules.loading: module account_consolidation: loading demo/consolidation_demo.xml
2014-03-24 13:35:06,094 26461 WARNING test_ocb_oca70 openerp.osv.orm.browse_record.account.account: Field 'centralized' does not exist in object 'browse_record(account.account, 73)'
2014-03-24 13:35:06,094 26461 ERROR test_ocb_oca70 openerp.tools.convert: Parse error in /home/afayolle/work/oca/account-consolidation/7.0/account_consolidation/demo/consolidation_demo.xml:26:
<record id="chart0_consolidation" model="account.account">
            <field name="code">CONSO</field>
            <field name="name">Consolidation Account</field>
            <field ref="account.chart0" name="parent_id"/>
            <field name="type">view</field>
            <field name="user_type" ref="account.data_account_type_view"/>
            <field name="company_id" ref="base.main_company"/>
        </record>
Traceback (most recent call last):
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/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 "/home/afayolle/work/oerp/server/ocb-7.0/openerp/addons/base/ir/ir_model.py", line 969, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/afayolle/work/oca/account-consolidation/7.0/account_parallel_currency/account.py", line 163, in create
    self.create_parallel_accounts(cr, uid, [res], context=None)
  File "/home/afayolle/work/oca/account-consolidation/7.0/account_parallel_currency/account.py", line 115, in create_parallel_accounts
    'centralized': account.centralized,
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/osv/orm.py", line 499, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'centralized' does not exist in object 'browse_record(account.account, 73)'"
Traceback (most recent call last):
  File "bin/openerp_command", line 65, in <module>
    openerpcommand.main.run()
  File "/home/afayolle/work/oerp/testbox-ocb+oca/openerp-command/openerpcommand/main.py", line 7, in run
    args.run(args)
  File "/home/afayolle/work/oerp/testbox-ocb+oca/openerp-command/openerpcommand/initialize.py", line 74, in run
    registry = install_openerp(args.database, not args.no_create, module_names, not config['without_demo'])
  File "/home/afayolle/work/oerp/testbox-ocb+oca/openerp-command/openerpcommand/initialize.py", line 24, in install_openerp
    database_name, update_module=True, force_demo=install_demo_data)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/registry.py", line 203, in get
    update_module)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/registry.py", line 233, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/loading.py", line 354, in load_modules
    loaded_modules, update_module)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/loading.py", line 256, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/loading.py", line 191, in load_module_graph
    load_demo_xml(module_name, idref, mode)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/loading.py", line 75, in <lambda>
    load_demo_xml = lambda *args: _load_data(cr, *args, kind='demo_xml')
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/modules/loading.py", line 124, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/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 "/home/afayolle/work/oerp/server/ocb-7.0/openerp/addons/base/ir/ir_model.py", line 969, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/home/afayolle/work/oca/account-consolidation/7.0/account_parallel_currency/account.py", line 163, in create
    self.create_parallel_accounts(cr, uid, [res], context=None)
  File "/home/afayolle/work/oca/account-consolidation/7.0/account_parallel_currency/account.py", line 115, in create_parallel_accounts
    'centralized': account.centralized,
  File "/home/afayolle/work/oerp/openobject-server/ocb-7.0/openerp/osv/orm.py", line 499, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'centralized' does not exist in object 'browse_record(account.account, 73)'"

I think this is a bug in account_parallel_currency, because a quick grep showed no definition of the 'centralized' column in the module or in the 7.0 official addons.

Related branches

Changed in account-consolidation:
importance: Undecided → High
status: New → Invalid
importance: High → Undecided
summary: - 7.0 account_consolidation: does not install
+ 7.0 account_parallel_currency: uses undefined account.account field
+ 'centralized'
description: updated
Changed in account-consolidation:
status: Invalid → Confirmed
importance: Undecided → High
Changed in account-consolidation:
assignee: nobody → Lorenzo Battistini - Agile BG (elbati)
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Thanks Alexandre,
actually I don't remember where the centralized field came from...

Just proposed a fix

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

centralized is defined in account-financial-report/account_financial_report_webkit/account.py

Changed in account-consolidation:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.