添加功能
This commit is contained in:
@@ -118,7 +118,7 @@ class ResourceCalendarHolidaye(models.Model):
|
||||
class ResourceCalendarLeave(models.Model):
|
||||
_inherit = "resource.calendar.leaves"
|
||||
|
||||
is_holidays = fields.Boolean(string="法定节假日")
|
||||
holidays = fields.Text(string="法定日")
|
||||
alternate_rest_day = fields.Text(string='调休休息日')
|
||||
shift_replacement_day = fields.Text(string='调班补办日')
|
||||
total_days = fields.Integer(string='总天数')
|
||||
@@ -69,16 +69,6 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="yuthon_resource_calendar_leaves_tree" model="ir.ui.view">
|
||||
<field name="name">resource.calendar.leaves.tree</field>
|
||||
<field name="model">resource.calendar.leaves</field>
|
||||
<field name="inherit_id" ref="hr_holidays.resource_calendar_leaves_tree_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree/field[@name='date_to']" position="after">
|
||||
<field name="is_holidays" string="节假日"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="inherit_resource_calendar_leave_tree" model="ir.ui.view">
|
||||
<field name="name">resource.calendar.leave.tree.inherit</field>
|
||||
<field name="model">resource.calendar.leaves</field>
|
||||
@@ -86,6 +76,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree/field[@name='date_to']" position="after">
|
||||
<field name="alternate_rest_day"/>
|
||||
<field name="holidays"/>
|
||||
<field name="shift_replacement_day"/>
|
||||
<field name="total_days"/>
|
||||
</xpath>
|
||||
@@ -98,6 +89,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='date_to']" position="after">
|
||||
<field name="alternate_rest_day"/>
|
||||
<field name="holidays"/>
|
||||
<field name="shift_replacement_day"/>
|
||||
<field name="total_days"/>
|
||||
</xpath>
|
||||
|
||||
@@ -325,7 +325,6 @@
|
||||
<field name="yuthon_company" optional="hide"/>
|
||||
<field name="use_user_type"/>
|
||||
<field name="salary_group_id" column_invisible="1"/>
|
||||
<field name="number"/>
|
||||
<field name="user_number" optional="hide"/>
|
||||
<field name="mobile_phone"/>
|
||||
<field name="confirmation_date" optional="hide"/>
|
||||
@@ -356,6 +355,9 @@
|
||||
<xpath expr="//field[@name='attendance_manager_id']" position="attributes">
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="number"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_employee_inherit_filter" model="ir.ui.view">
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
'wizard/yuthon_payroll_wizard_views.xml',
|
||||
'wizard/salary_compute_wizard_views.xml',
|
||||
'wizard/salary_payslip_wizard_views.xml',
|
||||
'wizard/select_delete_wizard_viwes.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
|
||||
@@ -164,4 +164,13 @@ class HrPayrollStructure(models.Model):
|
||||
}
|
||||
|
||||
for company_code, field_mapping in company_mappings.items():
|
||||
self.generate_salary_rules(company_code, field_mapping)
|
||||
self.generate_salary_rules(company_code, field_mapping)
|
||||
|
||||
def action_select_delete_wizard(self):
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "选择删除",
|
||||
"res_model": "select.delete.wizard",
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
}
|
||||
@@ -10,11 +10,12 @@ class YuthonPayrollCommon(models.Model):
|
||||
|
||||
name = fields.Char(string='工资项名称')
|
||||
sequence = fields.Char(string='序号', store=True)
|
||||
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],string='公司')
|
||||
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],string='公司', default=lambda self: self.env.user.employee_id.yuthon_company)
|
||||
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="失效日期")
|
||||
before_tax = fields.Boolean(string="税前")
|
||||
is_enable = fields.Boolean(string="启用", default=True)
|
||||
|
||||
def create_salary_common(self):
|
||||
|
||||
@@ -7,4 +7,5 @@ access_yuthon_payroll_insurances,access_yuthon_payroll_insurances,model_yuthon_p
|
||||
access_yuthon_payroll_wizard,access_yuthon_payroll_wizard,model_yuthon_payroll_wizard,base.group_user,1,1,1,1
|
||||
access_salary_compute_wizard,access_salary_compute_wizard,model_salary_compute_wizard,base.group_user,1,1,1,1
|
||||
access_yuthon_account_group,access_yuthon_account_group,model_yuthon_account_group,base.group_user,1,1,1,1
|
||||
access_salary_payslip_wizard,access_salary_payslip_wizard,model_salary_payslip_wizard,base.group_user,1,1,1,1
|
||||
access_salary_payslip_wizard,access_salary_payslip_wizard,model_salary_payslip_wizard,base.group_user,1,1,1,1
|
||||
access_select_delete_wizard,access_select_delete_wizard,model_select_delete_wizard,base.group_user,1,1,1,1
|
||||
|
@@ -117,4 +117,11 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.action_yuthon_payroll_wizard()</field>
|
||||
</record>
|
||||
<record id="all_select_delete_wizard" model="ir.actions.server">
|
||||
<field name="name">删除数据</field>
|
||||
<field name="model_id" ref="hr_payroll.model_hr_payroll_structure"/>
|
||||
<field name="binding_model_id" ref="hr_payroll.model_hr_payroll_structure"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.action_select_delete_wizard()</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -7,6 +7,7 @@
|
||||
<tree string="薪资常用项" editable="bottom">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="before_tax"/>
|
||||
<field name="yuthon_company"/>
|
||||
<field name="department_id"/>
|
||||
<field name="conditional_formulas"/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from . import yuthon_salary_wizard
|
||||
from . import yuthon_payroll_wizard
|
||||
from . import salary_compute_wizard
|
||||
from . import salary_payslip_wizard
|
||||
from . import salary_payslip_wizard
|
||||
from . import select_delete_wizard
|
||||
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import models, fields, api, _, SUPERUSER_ID
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
from pypinyin import pinyin, Style
|
||||
import xlrd
|
||||
import base64
|
||||
import datetime
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class SelectDeleteWizard(models.Model):
|
||||
_name = 'select.delete.wizard'
|
||||
_description = '删除弹窗'
|
||||
|
||||
name = fields.Char(string='删除', help='输入要删除的工资项')
|
||||
|
||||
def confirm(self):
|
||||
for record in self:
|
||||
if record.name:
|
||||
structure_ids = self.env['hr.payroll.structure'].search([])
|
||||
rules_to_delete = self.env['hr.salary.rule']
|
||||
for structure in structure_ids:
|
||||
for rule in structure.rule_ids:
|
||||
if rule.name == record.name:
|
||||
rules_to_delete |= rule
|
||||
if rules_to_delete:
|
||||
rules_to_delete.unlink()
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_select_delete_wizard_form" model="ir.ui.view">
|
||||
<field name="name">select.delete.wizard.form</field>
|
||||
<field name="model">select.delete.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<footer>
|
||||
<button name="confirm" string="确认" type="object" class="oe_highlight"/>
|
||||
<button string="返回" class="btn-secondary" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user