[6rc1][server] key error 'price accuracy'

Bug #671748 reported by Eric Caudal - www.elico-corp.com
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

When I try to update the modules after a server upgrade, I get the following error:
(/usr/local/bin/openerp-server -d demo6 -u all)

[2010-11-06 14:50:44,323][demo6] CRITICAL:init:price_accuracy
Traceback (most recent call last):
  File "./openerp-server.py", line 121, in <module>
    db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/pooler.py", line 39, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/__init__.py", line 853, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/__init__.py", line 698, in load_module_graph
    register_class(package.name)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/__init__.py", line 441, in register_class
    imp.load_module(m, *fm)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/account/__init__.py", line 26, in <module>
    import invoice
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/account/invoice.py", line 45, in <module>
    class account_invoice(osv.osv):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/addons/account/invoice.py", line 273, in account_invoice
    'amount_untaxed': fields.function(_amount_all, method=True, digits=(16, int(config['price_accuracy'])),string='Untaxed',
  File "/usr/local/lib/python2.6/dist-packages/openerp-server_9920/tools/config.py", line 475, in __getitem__
    return self.options[key]
KeyError: 'price_accuracy'

I added
            'price_accuracy': 2,
in the config.py file
        self.options = {

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Eric,

The 'price_accuracy' is no more an option on version 6.
Kindly make sure you are using the modules from trunk(I guess any module with stable-compatible characteristic uses price_accuracy in code and makes the traceback possible).

Thanks.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

The traceback clearly suggests me that the 'Account' module is from Stable(5.0.x).
Thanks.

Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote : Re: [Bug 671748] Re: [6rc1][server] key error 'price accuracy'

Hi Jay,
Thanks for the feedback!
I will double check it :)

--
Eric

On dim., 2010-11-07 at 13:17 +0000, Jay (OpenERP) wrote:

> The traceback clearly suggests me that the 'Account' module is from Stable(5.0.x).
> Thanks.
>

Revision history for this message
Roger Zeng (roger-cora) wrote :
Download full text (3.3 KiB)

I got the same error trying to install the product_variant_multi module in V6.0.1 on Ubuntu 10.10.

Are we talking about the same issue or is the product_variant_multi module not compatible with V.6.0.1?

The error message is as the following:

------------
Reinstall the system with Ubuntu 10.10 and OpenERP 6.0.1.

Same error but somewhat different error message. See below.

What might be different in my system environment that is keep trigger the "price_accuracy" error?

-----------------------------------

Environment Information :
System : Linux-2.6.35-24-generic-i686-with-Ubuntu-10.10-maverick
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick
Operating System Release : 2.6.35-24-generic
Operating System Version : #42-Ubuntu SMP Thu Dec 2 01:41:57 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.6
OpenERP-Client Version : 6.0.1
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/share/pyshared/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/share/pyshared/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/share/pyshared/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/share/pyshared/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/share/pyshared/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/share/pyshared/openerp-server/addons/base/module/wizard/base_module_upgrade.py", line 98, in upgrade_module
    _db, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/usr/share/pyshared/openerp-server/pooler.py", line 60, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/usr/share/pyshared/openerp-server/pooler.py", line 39, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/share/pyshared/openerp-server/addons/__init__.py", line 883, in load_modules
    processed_modules.extend(load_module_graph(cr, graph, status, report=report, skip_modules=processed_modules))
  File "/usr/share/pyshared/openerp-server/addons/__init__.py", line 716, in load_module_graph
    register_class(package.name)
  File "/usr/share/pyshared/openerp-server/addons/__init__.py", line 450, in register_class
    imp.load_module(m, *fm)
  File "/usr/share/pyshared/openerp-server/addons/product_variant_multi/__init__.py", line 23, in <module>
    import product_variant
  File "/usr/share/pyshared/openerp-server/addons/product_variant_multi/product_variant.py", line 53, in <module>
    class product_variant_dimension_value(osv.osv):
  File "/usr/share/pyshared/openerp-server/addons/product_variant_multi/product_variant.py", line 67, in product_variant_dimension_value
    'price_extra' : fields.float('Price Extra', digits=(16, int(config['price_accuracy']))),
  File...

Read more...

Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote :

Make sure you have the newest config files.
--
Eric

Revision history for this message
Maarten Verhavert (maarten-hyp3) wrote :

Sorry for the newbie question:

Where can i find the latest config files. I used the files i got from the website download page.

Revision history for this message
swapnil (swapnil1486) wrote :
Download full text (5.1 KiB)

i also got the same error
while installing the module purchase_indent module in v6 on Ubuntu 10.04

Please guide me what to do?

[28/Mar/2011:15:32:37] HTTP Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/openobject/tools/_expose.py", line 182, in func_wrapper
    res = func(*args, **kw)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/openobject/controllers/_root.py", line 87, in default
    return request.handler()
  File "/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/controllers/utils.py", line 112, in wrapper
    return fn(*args, **kw)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/openobject/tools/_expose.py", line 182, in func_wrapper
    res = func(*args, **kw)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/openobject/tools/_validate.py", line 88, in func_wrapper
    return func(*args, **kw)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/openobject/tools/_validate.py", line 105, in func_wrapper
    return func(*args, **kw)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/controllers/form.py", line 419, in save
    res = self.button_action(params)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/controllers/form.py", line 559, in button_action
    return self.BUTTON_ACTIONS_BY_BTYPE[btype](self, button_name, params)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/controllers/form.py", line 505, in button_action_object
    res = rpc.session.execute('object', 'execute', model, name, ids, ctx)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/utils/rpc.py", line 357, in execute
    return self.gateway.execute(obj, method, *args)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/utils/rpc.py", line 147, in execute
    return self.__execute(obj, method, args)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/utils/rpc.py", line 133, in __execute
    common.error(_('Application Error'), err.backtrace)
  File "/home/ptsadmin/openerp6.0.1/openerp-web-6.0.1/addons/openerp/utils/common.py", line 66, in error
    raise TinyError(message=msg, title=title or _("Error"))
TinyError: Traceback (most recent call last):
  File "/home/ptsadmin/openerp6.0.1/openerp-server-6.0.1/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/ptsadmin/openerp6.0.1/openerp-server-6.0.1/bin/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/home/ptsadmin/openerp6.0.1/openerp-server-6.0.1/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **k...

Read more...

Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote :

Price Accuracy is not needed anymore in V6.
You should start your config file from scratch based on new V6
standards.

--
Eric

Revision history for this message
Sukmaya (soekmo) wrote :
Download full text (3.4 KiB)

the error KeyError: 'price_accuracy' also happens while you compute the taxes under menu : purchase>invoice control>supplier invoices to receive

Environment Information :
System : Linux-2.6.32-39-generic-x86_64-with-Ubuntu-10.04-lucid
OS Name : posix
Description: Ubuntu 10.04.4 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-39-generic
Operating System Version : #86-Ubuntu SMP Mon Feb 13 21:50:08 UTC 2012
Operating System Architecture : 64bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 6.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/audittrail/audittrail.py", line 518, in execute
    res = my_fct(db, uid, model, method, *args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/audittrail/audittrail.py", line 502, in my_fct
    return fct_src(db, uid_orig, model, method, *args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 3436, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/fields.py", line 505, in set
    obj.write(cr, user, [act[1]], act[2], context=context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/sale_margin/sale_margin.py", line 109, in write
    return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/account_invoice_layout/account_invoice_layout.py", line 125, in write
    return super(account_invoice_line, self).write(cr, user, ids, vals, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 3522, in write
    self.pool.get(object)._store_set_values(cr, user, todo, fields_to_recompute, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 3790, in _store_set_values
    result = self._columns[val[0]].get(cr, self, ids, val, 1, context=context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/fields.py", line 800, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/account_tax_include/invoice_tax_incl.py", line 103, in _amount_line2
  ...

Read more...

Revision history for this message
Sukmaya (soekmo) wrote :

and more problem is that the tax calculation doesn't go to the tax field under the untaxed field.

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.