# -*- coding: utf-8 -*-
import re
import logging
import time
import requests
from datetime import datetime
import base64
import hashlib
from odoo import fields, models, api
import json
import requests
from odoo.http import request
from odoo.exceptions import ValidationError
from odoo.exceptions import UserError



_logger = logging.getLogger(__name__)


# 审批管理
class WxWorkApproval(models.Model):
    _name = 'wxwork.approval.record'
    _description = '审批记录'

    approval_type = fields.Many2one('wxwork.approval.template', string='审批模板名称')
    approval_num = fields.Char(string='审批单据编号')
    initiator = fields.Many2one('hr.employee', string='发起人')
    # approver = fields.Many2one('hr.employee', string='审批人')
    approval_state = fields.Selection([
        ('draft', '提交审批'),
        ('pending', '审批中'),
        ('approved', '已批准'),
        ('rejected', '已拒绝')
    ], string='审批状态', default='草稿')
    approval_time = fields.Datetime(string='审批发起时间')
    note = fields.Text(string='备注')
    #
    # # 根据具体业务需要添加其他字段
    # leave_type = fields.Selection([
    #     ('annual_leave', 'Annual Leave'),
    #     ('sick_leave', 'Sick Leave'),
    #     ('personal_leave', 'Personal Leave')
    # ], string='请假类型')
    # leave_days = fields.Float(string='Leave Days')
    # overtime_hours = fields.Float(string='Overtime Hours')






