25 lines
786 B
Python
25 lines
786 B
Python
# -*- 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([])
|
|
for structure in structure_ids:
|
|
for rule in structure.rule_ids:
|
|
if rule.name == record.name:
|
|
rule.sudo().unlink()
|