添加功能
This commit is contained in:
@@ -126,11 +126,6 @@ class InheritHrPayslip(models.Model):
|
||||
self.env['hr.payslip.line'].create(payslips._get_payslip_lines())
|
||||
return True
|
||||
|
||||
def action_refresh_from_work_entries_twice(self):
|
||||
self.action_refresh_from_work_entries()
|
||||
self.action_refresh_from_work_entries()
|
||||
return True
|
||||
|
||||
@api.depends('line_ids')
|
||||
def _compute_salary(self):
|
||||
for rec in self:
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
<header>
|
||||
<button name="action_put_wizard" string="推送" type="object" class="oe_highlight"/>
|
||||
<button name="action_temporary_payslip_wizard" string="导入临时工资项" type="object" class="oe_highlight"/>
|
||||
<button name="action_refresh_from_work_entries_twice" string="重新计算" type="object" class="oe_highlight"/>
|
||||
<button name="action_refresh_from_work_entries" string="重新计算" type="object" class="oe_highlight"/>
|
||||
</header>
|
||||
<field name="employee_id" string="姓名" widget="ztree_select"/>
|
||||
<field name="date_of_entry"/>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
'views/yuthon_trade_policy.xml',
|
||||
'views/yuthon_trade_purchase.xml',
|
||||
'views/yuthon_trade_premium.xml',
|
||||
'views/yuthon_business_approval_viwes.xml',
|
||||
'views/yuthon_seals_approval_views.xml',
|
||||
'views/yuthon_trade_refund.xml',
|
||||
'views/yuthon_trade_reimbursed.xml',
|
||||
'views/yuthon_message_approval_views.xml',
|
||||
|
||||
@@ -5,6 +5,28 @@
|
||||
<field name="code">property_work_condolences_code</field>
|
||||
<field name="prefix">JR%(y)s%(month)s%(day)s</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="yuthon_seals_approval_code_sequence" model="ir.sequence">
|
||||
<field name="name">用章审批编号</field>
|
||||
<field name="code">yuthon_seals_approval_code</field>
|
||||
<field name="prefix">YZ%(y)s%(month)s%(day)s</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="yuthon_business_approval_code_sequence" model="ir.sequence">
|
||||
<field name="name">业务审批编号</field>
|
||||
<field name="code">yuthon_business_approval_code</field>
|
||||
<field name="prefix">YW%(y)s%(month)s%(day)s</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="property_work_condolences_code_sequence" model="ir.sequence">
|
||||
<field name="name">节日慰问编号</field>
|
||||
<field name="code">property_work_condolences_code</field>
|
||||
<field name="prefix">JR%(y)s%(month)s%(day)s</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="yuthon_task_approval_code_sequence" model="ir.sequence">
|
||||
<field name="name">作业审批编号</field>
|
||||
|
||||
@@ -20,3 +20,5 @@ from . import yuthon_insurance_policy
|
||||
from . import yuthon_task_approval
|
||||
from . import yuthon_task_setting
|
||||
from . import trade_reward_approval
|
||||
from . import yuthon_seals_approval
|
||||
from . import yuthon_business_approval
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
|
||||
class YuthonBusinessApproval(models.Model):
|
||||
_name = 'yuthon.business.approval'
|
||||
_description = '业务审批'
|
||||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
code = fields.Char(string="流水号",
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_business_approval_code'))
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
issues_result = fields.Html(string="会议结果")
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
reason = fields.Html(string="正文")
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
|
||||
@api.onchange('is_issues')
|
||||
def _onchange_is_issues(self):
|
||||
if self.is_issues:
|
||||
issue_id = self.env['issue.library'].create({'name': self.name})
|
||||
self.related_issues_id = issue_id.id
|
||||
workflow_record_id = self.env["soong.workflow.record"].search(
|
||||
[("res_model", "=", self._name), ("res_id", "=", self.id)])
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': issue_id.id,
|
||||
'workflow_record_id': workflow_record_id.id,
|
||||
'approval_type': workflow_record_id.workflow_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now(),
|
||||
})
|
||||
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
|
||||
class YuthonSealsApproval(models.Model):
|
||||
_name = 'yuthon.seals.approval'
|
||||
_description = '用章审批'
|
||||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string='用章事项')
|
||||
code = fields.Char(string="流水号",
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_seals_approval_code'))
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
type_stamp = fields.Selection([('official', '公章'), ('contract', '合同章'), ('seal', '法人章'),
|
||||
('salary', '财务章'), ('other', '其他')], string='用章类型', default='official')
|
||||
scope_chapter = fields.Selection([('thtz', '天河投资'), ('ttcj', '天投城建'),
|
||||
('thwg', '天河物管'), ('thlc', '天河粮储')], string='用章范围', default='thtz')
|
||||
approval_id = fields.Many2one('hr.department', string="发送单位")
|
||||
remake = fields.Text(string="用章意见")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
@@ -12,6 +12,8 @@ access_yuthon_trade_reimbursed,yuthon_trade_reimbursed,model_yuthon_trade_reimbu
|
||||
access_yuthon_trade_supportive,yuthon_trade_supportive,model_yuthon_trade_supportive,base.group_user,1,1,1,1
|
||||
access_yuthon_care_condolences,yuthon_care_condolences,model_yuthon_care_condolences,base.group_user,1,1,1,1
|
||||
access_yuthon_work_condolences,yuthon_work_condolences,model_yuthon_work_condolences,base.group_user,1,1,1,1
|
||||
access_yuthon_seals_approval,yuthon_seals_approval,model_yuthon_seals_approval,base.group_user,1,1,1,1
|
||||
access_yuthon_business_approval,yuthon_business_approval,model_yuthon_business_approval,base.group_user,1,1,1,1
|
||||
|
||||
access_yuthon_care_setting,yuthon_care_setting,model_yuthon_care_setting,base.group_user,1,1,1,1
|
||||
access_yuthon_work_setting,yuthon_work_setting,model_yuthon_work_setting,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_business_approval_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.business.approval.tree</field>
|
||||
<field name="model">yuthon.business.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="业务审批">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_business_approval_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.business.approval.form</field>
|
||||
<field name="model">yuthon.business.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="业务审批">
|
||||
<sheet>
|
||||
<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>
|
||||
<field name="is_issues"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="related_issues_id" invisible="is_issues == False"/>
|
||||
</group>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="审批事项">
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="reason"/>
|
||||
<field name="document_ids" widget="many2many_tags"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_business_approval_action" model="ir.actions.act_window">
|
||||
<field name="name">业务审批</field>
|
||||
<field name="res_model">yuthon.business.approval</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_seals_approval_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.seals.approval.tree</field>
|
||||
<field name="model">yuthon.seals.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="用章审批">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_seals_approval_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.seals.approval.form</field>
|
||||
<field name="model">yuthon.seals.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="用章审批">
|
||||
<sheet>
|
||||
<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="3">
|
||||
<group>
|
||||
<field name="code" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="urgency_level" readonly="1"/>
|
||||
</group>
|
||||
<group/>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="审批事项">
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="type_stamp"/>
|
||||
<field name="scope_chapter"/>
|
||||
<field name="approval_id"/>
|
||||
<field name="remake"/>
|
||||
<field name="document_ids" widget="many2many_tags"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_seals_approval_action" model="ir.actions.act_window">
|
||||
<field name="name">用章审批</field>
|
||||
<field name="res_model">yuthon.seals.approval</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -98,6 +98,16 @@
|
||||
parent="executive_trade_process_ment"
|
||||
action="view_trade_reward_approval_action"
|
||||
sequence="60"/>
|
||||
<menuitem id="yuthon_seals_approval_board"
|
||||
name="用章审批"
|
||||
parent="executive_trade_process_ment"
|
||||
action="view_yuthon_seals_approval_action"
|
||||
sequence="70"/>
|
||||
<menuitem id="yuthon_business_approval_board"
|
||||
name="业务审批"
|
||||
parent="executive_trade_process_ment"
|
||||
action="view_business_approval_action"
|
||||
sequence="80"/>
|
||||
<menuitem id="executive_trade_setting"
|
||||
name="配置"
|
||||
parent="executive_manage_approval"
|
||||
|
||||
Reference in New Issue
Block a user