添加功能
This commit is contained in:
@@ -17,7 +17,25 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="物业管理变更申请表" create="0">
|
||||
<sheet>
|
||||
<field name="code"/>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
|
||||
invisible="urgency_level != 'urgent'"/>
|
||||
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
|
||||
invisible="urgency_level != 'emergency'"/>
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="code" string="流水号" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="urgency_level" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
|
||||
@@ -147,7 +147,6 @@ class HrPayrollStructure(models.Model):
|
||||
structure.write({'rule_ids': rule_list})
|
||||
|
||||
def salary_rule_data(self):
|
||||
# 定义不同公司的字段映射
|
||||
company_mappings = {
|
||||
'thwg': {
|
||||
'基本工资': 'base_salary',
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='country_id']" position="after">
|
||||
<button name="open_record" type="object" class="btn btn-primary" string="查看详情"/>
|
||||
<button name="salary_rule_data" type="object" class="btn btn-primary" string="cs"/>
|
||||
<!-- <button name="salary_rule_data" type="object" class="btn btn-primary" string="cs"/>-->
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='name']" position="before">
|
||||
<field name="sequence"/>
|
||||
|
||||
@@ -13,7 +13,7 @@ class SalaryComputeWizard(models.Model):
|
||||
_description = '薪资计算弹窗'
|
||||
|
||||
department_ids = fields.Many2many('hr.department', string="部门")
|
||||
personnel_ids = fields.Many2many('hr.employee', string='人员', store=True)
|
||||
employee_ids = fields.Many2many('hr.employee', string='人员', store=True)
|
||||
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='年份',
|
||||
default=lambda self: str(datetime.now().year))
|
||||
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
@@ -39,7 +39,18 @@ class SalaryComputeWizard(models.Model):
|
||||
department_user_ids = set()
|
||||
for department_id in self.department_ids:
|
||||
department_user_ids.update(get_department_employees(department_id))
|
||||
self.personnel_ids = [(6, 0, list(department_user_ids))]
|
||||
self.employee_ids = [(6, 0, list(department_user_ids))]
|
||||
|
||||
|
||||
def confirm(self):
|
||||
pass
|
||||
for employee in self.employee_ids:
|
||||
contract_id = self.env['hr.contract'].search([('employee_id', '=', employee.id)], limit=1)
|
||||
struct_id = contract_id.structure_type_id.default_struct_id
|
||||
payslip = self.env['hr.payslip'].create({
|
||||
'name': employee.name,
|
||||
'employee_id': employee.id,
|
||||
'contract_id': contract_id.id,
|
||||
'struct_id': struct_id.id,
|
||||
'state':'draft',
|
||||
})
|
||||
payslip.compute_sheet()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="department_ids" widget="many2many_tags"/>
|
||||
<field name="personnel_ids" widget="many2many_tags" force_save="1" invisible="1"/>
|
||||
<field name="employee_ids" widget="many2many_tags" force_save="1"/>
|
||||
<field name="select_year"/>
|
||||
<field name="select_time"/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user