22 lines
1.0 KiB
Python
22 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, tools, _
|
|
from datetime import datetime, time, timedelta
|
|
|
|
|
|
class LeaveApprovals(models.Model):
|
|
_name = 'leave.approval'
|
|
_description = "调休审批"
|
|
# _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin','soong.workflow.mixin']
|
|
_rec_name = 'name'
|
|
|
|
name = fields.Char(string="名称")
|
|
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('overtime_approval'))
|
|
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
|
department_id = fields.Many2one('hr.department', string="申请人部门")
|
|
partner_id = fields.Many2one('res.partner', string="来文单位")
|
|
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
|
|
default='drft')
|
|
|
|
def leave_approval(self):
|
|
pass |