!1866 Merge branch 'dev' into dev_zhou

Merge pull request !1866 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-03-17 10:19:07 +00:00
committed by Gitee
3 changed files with 16 additions and 3 deletions
@@ -8,11 +8,13 @@ class YuthonPayrollCommon(models.Model):
_description = '薪资常用项'
name = fields.Char(string='工资项名称')
sequence = fields.Char(string='级别序号', store=True)
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],string='公司')
department_id = fields.Many2one('hr.department', string="部门")
conditional_formulas = fields.Char(string='条件公式')
start_date = fields.Date(string="生效日期", default=fields.Date.today())
end_date = fields.Date(string="失效日期")
is_enable = fields.Boolean(string="启用", default=True)
def create_salary_common(self):
"""
@@ -56,6 +58,15 @@ class YuthonPayrollCommon(models.Model):
}])
sal.write({'rule_ids': rule_list})
@api.depends('start_date', 'end_date')
def compute_is_enable(self):
for rec in self:
if rec.start_date and rec.end_date:
if rec.start_date <= fields.Date.today() < rec.end_date:
rec.is_enable = True
else:
rec.is_enable = False
class YuthonPayrollTemporary(models.Model):
_name = 'yuthon.payroll.temporary'
@@ -26,9 +26,9 @@
<xpath expr="//field[@name='net_wage']" position="after">
<field name="account_id" column_invisible="1"/>
<field name="base_salary"/>
<field name="performance_bonuses"/>
<field name="full_attendance_award"/>
<field name="commuting_allowance"/>
<!-- <field name="performance_bonuses"/>-->
<!-- <field name="full_attendance_award"/>-->
<!-- <field name="commuting_allowance"/>-->
<field name="rank_salary"/>
<field name="housing_loan_interest"/>
<field name="housing_rent"/>
@@ -5,12 +5,14 @@
<field name="model">yuthon.payroll.common</field>
<field name="arch" type="xml">
<tree string="薪资常用项" editable="bottom">
<field name="sequence"/>
<field name="name"/>
<field name="yuthon_company"/>
<field name="department_id"/>
<field name="conditional_formulas"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="is_enable"/>
</tree>
</field>
</record>