← Back to team overview

openerp-india team mailing list archive

[Bug 671748] Re: [6rc1][server] key error 'price accuracy'

 

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
    res[line.id]['price_subtotal']= round(res[line.id]['price_subtotal'], int(config['price_accuracy']))
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/tools/config.py", line 507, in __getitem__
    return self.options[key]
KeyError: 'price_accuracy'

-- 
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/671748

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

Status in OpenERP Server:
  Invalid

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 = {

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/671748/+subscriptions