Error setting company Accounting Options after installing localized Accounting Charts on OpenERP 6 to 7 migrated database

Bug #1329817 reported by Ion Cebotari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenUpgrade Addons
New
Undecided
Unassigned

Bug Description

After upgrading my database from OpenERP 6.1 to 7, I needed to install an additional accounting module localization. I selected the Romanian Accounting Charts module, installed it. After the module installation is finished, a form opens, that requires me to introduce the accounting options: VAT type and quantity, the company it applies to, and so on.
But the problem is that while opening the form and trying to select the company for which the accounting chart is to be used, I get the following error:

OpenERP Server Error

Client Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1128, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 42, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 103, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 191, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 200, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/addons/audittrail/audittrail.py", line 532, in execute_cr
    return fct_src(cr, uid, model, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
AttributeError: 'wizard.multi.charts.accounts' object has no attribute 'onchange_company_id'

The field for the company is empty, and everytime I try to switch it, I am getting the error above.

I've checked the views of the upgraded database and a demo OpenERP7 database. Here they are:
The Demo OpenERP 7 piece of the view, regarding companies:
 <field name="company_id" widget="selection"/>
The upgraded database piece of the view for the companies:
<field name="company_id" widget="selection" on_change="onchange_company_id(company_id)" />

I've tried deleting the part "on_change="onchange_company_id(company_id)"" from the view from the upgraded database, but in the end only the error disappears, and I cannot select my company and I get an integrity error, if I click on the "Apply" button.

I've tried to add another company in the settings, and it is shown in the "Accounting Options" frame, while the upgraded one does not show.

Tell me please, how can I further check what is wrong with the companies from the upgraded database?

Thank you very much

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

The 7.0 view is correct. In 7.0, the wizard model has this method but in 6.1 it does not. It appears therefore that you are running your migrated 7.0 database on a (partially?) 6.1 version of OpenERP. I would call the global /usr/lib/pymodules/python2.7/openerp/addons path suspect in this matter.

Revision history for this message
Ion Cebotari (anathemizatu) wrote :

The wizard.multi.charts.accounts object is stored in the file /usr/lib/pymodules/python2.7/openerp/addons/account/account.py, and it doesn't have the onchange_company_id, nor it doesn't inherit it from any other method, from what I've seen. Please correct me if I'm wrong, I'm only beggining to work seriously with OpenERP

Also, I was able to select my company in the accounting options form by changing its default currency from Euro to the local currency.
Thank you very much for your help.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

You are right. This method has been removed from 7.0 here: http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/revision/9434#account/account_view.xml. That totally violates the stable policy of OpenERP BTW.

Anyway, the solution is clear now: you should simply repeat the --update all on your 7.0 production instance. I can recommend it after every database upgrade using this project, but I'm guessing I have not documented it because I'm too stuck in my routine to even distinguish it as a part of the whole process.

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.