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.


"worked_days.Unpaid.number_of_days" not working

on 2/27/15, 8:57 AM 1,024 views


When I use : worked_days.Unpaid.number_of_days I obtain an error because code python is wrong.

I need an extra module or the variable is wrong?

Where I can find the variables?

Thanks in advance,




Hi,, Can you please add more details??

on 2/27/15, 9:16 AM
Hi I am using OPENERP 7.

The condition rule is always true ( for testing) if I use "result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False" nothing is calculated.

the python code for computation is:


the employees has 5 days of leaves.

when I run payslip batches for the employees I get the error python code is wrong.

2015-02-27 9:16 GMT-05:00 Baiju KS <baijuks@hotmail.com>:

Hi,, Can you please add more details??

Baiju KS
Sent by Odoo S.A. using Odoo about Forum Post "worked_days.Unpaid.number_of_days" not working

on 2/27/15, 10:00 AM
On 6/30/16, 7:07 PM

I have the same problem, did you manage to find a solution ?

Thanks in advance

Shahid M
On 12/16/15, 8:27 AM

Any one got the solution?
I am also facing the same problem since yesterday 

On 6/5/15, 8:12 AM

I have the same problem when using python code:


and tried with or with or without condition:

result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False


I'm using Odoo 8 and this is my log when trying to calculate. Maybe a language problem? Aparently other people didn't have any problem using this formulas, and eduardo and i use spanish language.


2015-06-04 16:26:08,929 22244 ERROR nuevabase2 openerp.http: Exception during JSON request handling.

Traceback (most recent call last):

File "/opt/odoo/server/openerp/http.py", line 536, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/opt/odoo/server/openerp/http.py", line 573, in dispatch

result = self._call_function(**self.params)

File "/opt/odoo/server/openerp/http.py", line 309, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/opt/odoo/server/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/opt/odoo/server/openerp/http.py", line 306, in checked_call

return self.endpoint(*a, **kw)

File "/opt/odoo/server/openerp/http.py", line 802, in __call__

return self.method(*args, **kw)

File "/opt/odoo/server/openerp/http.py", line 402, in response_wrap

response = f(*args, **kw)

File "/opt/odoo/server/addons/web/controllers/main.py", line 941, in call_button

action = self._call_kw(model, method, args, {})

File "/opt/odoo/server/addons/web/controllers/main.py", line 929, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/opt/odoo/server/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/server/addons/hr_payroll/hr_payroll.py", line 391, in compute_sheet

lines = [(0,0,line) for line in self.pool.get('hr.payslip').get_payslip_lines(cr, uid, contract_ids, payslip.id, context=context)]

File "/opt/odoo/server/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/server/addons/hr_payroll/hr_payroll.py", line 581, in get_payslip_lines

amount, qty, rate = obj_rule.compute_rule(cr, uid, rule.id, localdict, context=context)

File "/opt/odoo/server/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/opt/odoo/server/addons/hr_payroll/hr_payroll.py", line 863, in compute_rule

raise osv.except_osv(_('Error!'), _('Wrong python code defined for salary rule %s (%s).')% (rule.name, rule.code))

except_orm: (u'\xa1Error!', u'C\xf3digo python err\xf3neo en la regla de salario Faltas sin Aviso (0105).')

2015-06-04 16:26:08,932 22244 INFO nuevabase2 werkzeug: - - [04/Jun/2015 16:26:08] "POST /web/dataset/call_button HTTP/1.1" 200 -

2015-06-04 16:26:09,397 22244 INFO nuevabase2 werkzeug: - - [04/Jun/2015 16:26:09] "POST /web/dataset/search_read HTTP/1.1" 200 -

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: 2/27/15, 8:57 AM
Seen: 1024 times
Last updated: 6/30/16, 7:07 PM