Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


analytic account active field impossible to search for

Fabian Semal
on 1/14/14, 11:47 AM 1,873 views


I've added an active field in account.analytic.account. At first it looks like it works like it should do, but when I try to search on Active = False with an advanced filter I get that error :

Server Traceback (most recent call last): File "/home/fabian/Code/openerp/7.0/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/home/fabian/Code/openerp/7.0/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/fabian/Code/openerp/7.0/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/home/fabian/Code/openerp/7.0/server/openerp/addons/audittrail/audittrail.py", line 514, in execute_cr return fct_src(cr, uid, model, method, args, *kw) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/orm.py", line 3623, in read result = self._read_flat(cr, user, select, fields, context, load) File "/home/fabian/Code/openerp/7.0/server/openerp/osv/orm.py", line 3738, in _read_flat if isinstance(res2[record['id']], str): res2[record['id']] = eval(res2[record['id']]) #TOCHECK : why got string instend of dict in python2.6 KeyError: 3024

Anyone familiar with the KeyError 3024 ? ;-)

I post it here as it's due to a (very small) customization and thus I cannot submit it to the support.



Martin Trigaux (mat)

--Martin Trigaux (mat)--
| 6 4 7
Grand Rosiere, Belgium
--Martin Trigaux (mat)--

Community manager: help with the code and translations contributions from the community on GitHub and Transifex.

Developed the gamification module and is also now responsible of the documentation and Point of Sale.

Martin Trigaux (mat)
On 4/10/15, 10:02 AM


It's due to the of the function field _debit_credit_bal_qtty in account/analytic/analytic.py. It does not support the case with an active=False field (the search call removes inactive records). As there is no active field is standard, it explained why we did not consider this case.

Unfortunately, if you want to have an active field you need to

  • redefine the function fields credit, debit, quantity, balance to use your own computation method

  • copy-paste most of the method and just modify the search part to include also inactive records

Martin, This customization helped me.

on 10/13/15, 3:15 AM

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 1/20/14, 12:30 PM


This is a valid error!

I will check and tell you the fix!


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 1/14/14, 11:47 AM
Seen: 1873 times
Last updated: 10/13/15, 3:14 AM