工资表不在"应用"中,在搜索该模块时需要将默认的"应用"过滤删除掉。
安装工资表后,出现工资单菜单:
在"开发者模式"下,可以自定义薪资规则类别,该表单对应hr.salary.rule.category数据表:
上级:指定父类别,对应本数据表。
再重新创建一个类别,把它作为当前类别的子类别:
点击"薪资类别规则层级"菜单,薪资规则类别按层级显示:
点击薪资规则,添加一个规则,对应hr.salary.rule数据表:
类别:category,对应hr.salary.rule.category数据表。
代码:作为该规则的识别,规则中的计算公式就引用该代码,区分大小写。
针对不同的类别有不同的计算规则,这符合现实情况,比如每个月的工资是一个固定的金额,而奖金等则可能需要按照员工个人的工作绩效动态计算,在odoo中提供了几种定义薪资规则的计算方法:
可以定义三种条件:
条件基于总为真时,可以选择三种计算方法:
固定金额:添加了该种规则的工资为一个固定的值:
百分比:以百分比计算工资,其中百分比中输入的值为20,则代表20%:
Python代码:按照代码动态的计算工资:如下面的计算就代表该计算结果为合约中工资的10%:
系统给出了提示,提供了可用的变量:
# Available variables:
#----------------------
# payslip: object containing the payslips
# employee: hr.employee object
# contract: hr.contract object
# rules: object containing the rules code (previously computed)
# categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).
# worked_days: object containing the computed worked days.
# inputs: object containing the computed inputs.
# Note: returned value have to be set in the variable 'result'
result = contract.wage * 0.10