我在评估时遇到错误 ValueError(': "\'float\' object has no attribute \'number_of_days\'" result =-(contract.wage/ 31) *working_days.Unpaid.number_of_days\'')
当我试图从工资单中扣除无薪休假时。我是 Odoo 的新人。请帮我。
我最近安装了 https://apps.odoo.com/apps/modules/15.0/ om_hr_payroll/ 这个第三方社区版本。
我创建了薪资规则,如下快照
现在,然后我在薪资结构中添加了该薪资规则
现在,当我单击员工工资单中的计算表时,出现如下错误
我看到了该模块提供商公司的这篇博客文章https://www.cybrosys.com/blog/hr-unpaid-leaves-payroll-management-in-odoo-10
但我的工资单仍然有错误
我的 Odoo 版本是最新的 odoo_15.0(社区版)
I got error ValueError('<class \'AttributeError\'>: "\'float\' object has no attribute \'number_of_days\'" while evaluating\n\'result =-(contract.wage/31) * worked_days.Unpaid.number_of_days\'')
when I'm trying to deduct Unpaid Leave from Payroll. I'm new in Odoo. Please help me.
I recently installed https://apps.odoo.com/apps/modules/15.0/om_hr_payroll/ this third party community edition.
I have created Salary Rule as like below Snapshot
now, then I added that salary rule in Salary Structures
Now then when I click Compute Sheet in Employee Payslips then I got error as like below snapshot
I was seen this Blog post of this Module Provider Company https://www.cybrosys.com/blog/hr-unpaid-leaves-payroll-management-in-odoo-10
but still I got error in payroll
My Odoo Version is latest odoo_15.0 (Community Edition)
发布评论
评论(3)
Odoo 将循环遍历
Worked Days
行,以使用其code
将这些行添加到worked_days_dict
要使用以下表达式,您需要添加一个工作带有
Unpaid
代码的 days 行:请注意,字段名称为:
number_of_days
Odoo will loop over
Worked Days
lines to add the lines to theworked_days_dict
using theircode
To use the following expression, you need to add a worked days line with
Unpaid
code :Note that the field name is :
number_of_days
如果您使用此 https://apps.odoo.com/apps/modules/ 15.0/om_hr_payroll/ 薪资模块,然后有许多对象变量可用于使用 python 代码部分自定义薪资规则。请参阅下面我共享的可用变量列表
现在下面我分享了我对从工资中扣除无薪休假的最终回答
这是Python条件字段输入
这是Python代码字段输入
参见下面的输出快照
你可以看到下面我的答案的快照
-:python 条件:-
-: python 代码:-
If you are using this https://apps.odoo.com/apps/modules/15.0/om_hr_payroll/ payroll module, then there are many object variables available for customize salary rule using python code section. see below I shared available variables list
Now below I shared my Final Answered for Deduct Unpaid Leave from salary
This is Python condition field input
This is Python code field input
See below Snapshot of Output
you can see below snapshot of my answer
-: python condition :-
-: python code :-
除了建议的答案之外,
可以在 python 中使用以下公式计算无薪休假金额:
其中:
worked_days.WORK100.number_of_days 是 odoo 记录的当月工作总天数。
worked_days.LEAVE90.number_of_days 是无薪休假天数。
代码LEAVE90可以在无偿工作条目类型选项卡下配置,该选项卡可以在编辑薪资结构时找到。
查找附件中的 Odoo 示例图像
In addition to the suggested answers,
One can calculate in python the unpaid leave amount with this formular:
Where:
worked_days.WORK100.number_of_days is the total number of days worked for that month as recroded by odoo.
worked_days.LEAVE90.number_of_days is the number of unpaid leave.
The code LEAVE90 can be configured under the tab Unpaid Work Entry Type which can be found when editing Salary Structure.
Find attached the example image from Odoo