Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -275,12 +275,13 @@
|
||||
<tree>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="action_type"/>
|
||||
<field name="is_highlight"/>
|
||||
<field name="illustrate"/>
|
||||
<field name="is_highlight" column_invisible="1"/>
|
||||
<field name="node_id" column_invisible="1"/>
|
||||
<field name="users_role_id"/>
|
||||
<field name="users_role_group_ids" widget="many2many_tags"/>
|
||||
<field name="reviewer_id" string="用户"/>
|
||||
<field name="action_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
<field name="name"/>
|
||||
</strong>
|
||||
<div>
|
||||
<span>发起人:</span>
|
||||
<span>申请人:</span>
|
||||
<field name="done_by"/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -381,6 +381,10 @@
|
||||
<span>最后更新日期:</span>
|
||||
<field name="write_date2"/>
|
||||
</div>
|
||||
<div>
|
||||
<span>紧急度:</span>
|
||||
<field name="urgency_level"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom">
|
||||
<button class="btn btn-primary" type="object" name="open_record">
|
||||
|
||||
@@ -721,7 +721,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
self.node_btn_id.with_context(cx).run()
|
||||
if self.node_btn_name == "分发":
|
||||
record_id.is_send = True
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '行政收文')])
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '行政收文')], limit=1)
|
||||
workflow_record_id = self.env['soong.workflow.record'].sudo().search([('code', '=', record_id.code)])
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&menu_id={menu_id.id}&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
@@ -847,7 +847,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
self.node_btn_id.with_context(cx).run()
|
||||
|
||||
if self.node_btn_name == '归档':
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '行政收文')])
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '行政收文')], limit=1)
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
target_url = f'https://oa.thtzjt.com/web#id={record_id.id}&cids=2&menu_id={menu_id.id}&active_id={action_id.id}&model={record_id._name}&view_type=form'
|
||||
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(fields.Datetime.now() + timedelta(hours=8))
|
||||
|
||||
@@ -13,12 +13,58 @@ class VacationOvertimeActive(models.Model):
|
||||
_name = 'vacation.overtime.active'
|
||||
_description = '加班情况归档'
|
||||
|
||||
employee_id = fields.Many2one('hr.employee', string='员工')
|
||||
department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门")
|
||||
company_id = fields.Many2one('res.company', related='employee_id.company_id', string="公司")
|
||||
workflow_record_id = fields.Many2one('soong.workflow.record', string='流程')
|
||||
overtime_name = fields.Char(string="标题")
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
employee_id = fields.Many2one('hr.employee', string="员工")
|
||||
select_month = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
|
||||
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
|
||||
('9', '九月'), ('10', '十月'), ('11', '十一月'),
|
||||
('12', '十二月')], string='月份',
|
||||
default=lambda self: str(datetime.now().month))
|
||||
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='年份',
|
||||
default=lambda self: str(datetime.now().year))
|
||||
last_balance = fields.Float(string="上年结余")
|
||||
valid_date = fields.Date(string="有效至")
|
||||
workday = fields.Float(string='工作日')
|
||||
public_holidays = fields.Float(string='公休日')
|
||||
vacation_sum = fields.Float(string='合计数')
|
||||
carry_forward_quantity = fields.Float(string="结转时长")
|
||||
carry_result = fields.Selection([('success', '成功'), ('failed', '失败')], string="结转结果")
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
remaining_quantity = fields.Float(string="剩余数")
|
||||
|
||||
def open_record(self):
|
||||
self.ensure_one()
|
||||
current_year = int(self.select_year)
|
||||
current_month = int(self.select_month)
|
||||
cutoff_date = date(current_year, current_month, 1) - timedelta(days=1)
|
||||
cutoff_dt = datetime.combine(cutoff_date, datetime.min.time())
|
||||
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
|
||||
domain = [
|
||||
('start_time', '<', cutoff_dt),
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
('employee_id', '=', self.employee_id.id)
|
||||
]
|
||||
if self.employee_id.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('employee_id', '=', self.employee_id.id),
|
||||
'|',
|
||||
('carry_forward_date', '=', False),
|
||||
('carry_forward_date', '<', cutoff_dt),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
'&', ('update_type', '=', 'add'),
|
||||
'&', ('workflow_record_id', '!=', False),
|
||||
'&', ('start_time', '>=', dec_2025_end),
|
||||
'&', ('vacation_id', '!=', False),
|
||||
('start_time', '<', cutoff_dt)
|
||||
]
|
||||
|
||||
tree_id = self.env.ref("yuthon_hr_attendance.view_yuthon_vacation_overtime_tree").id
|
||||
return {
|
||||
'views': [[tree_id, 'tree']],
|
||||
'name': f'加班明细',
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'vacation.over.line',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': domain,
|
||||
'target': 'current'
|
||||
}
|
||||
|
||||
@@ -21,22 +21,23 @@ class YuthonOvertimeLine(models.Model):
|
||||
valid_date = fields.Date(string="有效至")
|
||||
workday = fields.Float(string='工作日')
|
||||
public_holidays = fields.Float(string='公休日')
|
||||
vacation_sum = fields.Float(string='合计数', compute='_compute_vacation_sum')
|
||||
vacation_sum = fields.Float(string='合计数', compute='_compute_vacation_sum', store=True)
|
||||
carry_forward_quantity = fields.Float(string="结转时长")
|
||||
carry_forward_date = fields.Date(string="结转日期")
|
||||
archive_state = fields.Selection([('to_do', '待归档'), ('done', '已归档')], default='to_do', string='状态')
|
||||
remaining_quantity = fields.Float(string="剩余数", compute='_compute_vacation_sum')
|
||||
|
||||
@api.depends('workday', 'public_holidays', 'last_balance', 'carry_forward_quantity')
|
||||
def _compute_vacation_sum(self):
|
||||
for rec in self:
|
||||
rec.vacation_sum = rec.public_holidays + rec.workday + rec.last_balance
|
||||
rec.remaining_quantity = rec.vacation_sum - rec.carry_forward_quantity
|
||||
rec.remaining_quantity = max((rec.vacation_sum - rec.carry_forward_quantity), 0)
|
||||
|
||||
def open_record(self):
|
||||
self.ensure_one()
|
||||
current_year = int(self.select_year)
|
||||
current_month = int(self.select_month)
|
||||
cutoff_date = date(current_year, current_month, 1) + relativedelta(months=1) - timedelta(days=1)
|
||||
cutoff_date = date(current_year, current_month, 1) - timedelta(days=1)
|
||||
cutoff_dt = datetime.combine(cutoff_date, datetime.min.time())
|
||||
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
|
||||
domain = [
|
||||
@@ -47,7 +48,9 @@ class YuthonOvertimeLine(models.Model):
|
||||
if self.employee_id.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('employee_id', '=', self.employee_id.id),
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
'|',
|
||||
('carry_forward_date', '=', False),
|
||||
('carry_forward_date', '<', cutoff_dt),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
@@ -67,4 +70,126 @@ class YuthonOvertimeLine(models.Model):
|
||||
'view_mode': 'tree,form',
|
||||
'domain': domain,
|
||||
'target': 'current'
|
||||
}
|
||||
}
|
||||
|
||||
def carryover_active(self):
|
||||
overtime_ids = self.env["yuthon.overtime.line"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id'))
|
||||
)
|
||||
for overtime_id in overtime_ids:
|
||||
self.env["vacation.overtime.active"].create({
|
||||
'employee_id': overtime_id.employee_id.id,
|
||||
'select_month': overtime_id.select_month,
|
||||
'select_year': overtime_id.select_year,
|
||||
'last_balance': overtime_id.last_balance,
|
||||
'valid_date': overtime_id.valid_date,
|
||||
'workday': overtime_id.workday,
|
||||
'public_holidays': overtime_id.public_holidays,
|
||||
'vacation_sum': overtime_id.vacation_sum,
|
||||
'carry_forward_quantity': overtime_id.carry_forward_quantity,
|
||||
'carry_forward_date': overtime_id.carry_forward_date,
|
||||
'remaining_quantity': overtime_id.remaining_quantity,
|
||||
})
|
||||
overtime_id.archive_state = 'done'
|
||||
remaining_to_allocate = overtime_id.carry_forward_quantity
|
||||
current_year = int(overtime_id.select_year)
|
||||
current_month = int(overtime_id.select_month)
|
||||
cutoff_date = date(current_year, current_month, 1) - timedelta(days=1)
|
||||
cutoff_dt = datetime.combine(cutoff_date, datetime.min.time())
|
||||
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
|
||||
domain = [
|
||||
('start_time', '<', cutoff_dt),
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
('employee_id', '=', overtime_id.employee_id.id)
|
||||
]
|
||||
|
||||
if overtime_id.employee_id.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('employee_id', '=', overtime_id.employee_id.id),
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
'&', ('update_type', '=', 'add'),
|
||||
'&', ('workflow_record_id', '!=', False),
|
||||
'&', ('start_time', '>=', dec_2025_end),
|
||||
'&', ('vacation_id', '!=', False),
|
||||
('start_time', '<', cutoff_dt)
|
||||
]
|
||||
over_lines = self.env['vacation.over.line'].search(domain, order='start_time ASC')
|
||||
# 4. 按顺序分配结转时长
|
||||
for rec in over_lines:
|
||||
if remaining_to_allocate <= 0:
|
||||
break # 分配完毕,退出循环
|
||||
|
||||
# 计算当前记录可分配的最大时长(不超过剩余时长)
|
||||
max_allocation = rec.duration - rec.carry_forward_quantity
|
||||
if max_allocation <= 0:
|
||||
continue # 该记录已无剩余可分配时长
|
||||
|
||||
if rec.is_initial_number and rec.last_balance > 1e-6:
|
||||
need_deduct_total = min(remaining_to_allocate, rec.last_balance)
|
||||
remaining_deduct = need_deduct_total
|
||||
|
||||
# 1. 优先扣减 vacation_id.last_workday
|
||||
if rec.vacation_id and rec.vacation_id.last_workday > 1e-6:
|
||||
deduct_workday = min(remaining_deduct, rec.vacation_id.last_workday)
|
||||
rec.vacation_id.last_workday -= deduct_workday
|
||||
remaining_deduct -= deduct_workday # 剩余待扣减金额减少
|
||||
rec.vacation_id.write({'last_workday': rec.vacation_id.last_workday})
|
||||
|
||||
# 2.扣减 vacation_id.last_holiday
|
||||
if remaining_deduct > 1e-6 and rec.vacation_id and rec.vacation_id.last_holiday > 1e-6:
|
||||
deduct_holiday = min(remaining_deduct, rec.vacation_id.last_holiday)
|
||||
rec.vacation_id.last_holiday -= deduct_holiday
|
||||
remaining_deduct -= deduct_holiday
|
||||
rec.vacation_id.write({'last_holiday': rec.vacation_id.last_holiday})
|
||||
|
||||
# 确定本次分配的时长
|
||||
if remaining_to_allocate >= max_allocation:
|
||||
# 足够分配完当前记录的剩余时长
|
||||
allocate_amount = max_allocation
|
||||
new_state = 'completed'
|
||||
remaining_to_allocate -= allocate_amount
|
||||
else:
|
||||
# 只能分配部分时长
|
||||
allocate_amount = remaining_to_allocate
|
||||
new_state = 'partial'
|
||||
remaining_to_allocate = 0
|
||||
|
||||
rec.write({
|
||||
'carry_forward_quantity': rec.carry_forward_quantity + allocate_amount,
|
||||
'carry_forward_state': new_state,
|
||||
'carry_forward_date': overtime_id.carry_forward_date
|
||||
})
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'type': 'success',
|
||||
'message': '归档成功',
|
||||
'sticky': False,
|
||||
}
|
||||
}
|
||||
|
||||
@api.model
|
||||
def carryover_details(self):
|
||||
domain = [('vacation_sum', '>', 40),
|
||||
('remaining_quantity', '!=', 0.0)
|
||||
]
|
||||
overtime_lines = self.env['yuthon.overtime.line'].search(domain)
|
||||
for overtime in overtime_lines:
|
||||
overtime.carry_forward_date = fields.Date.today()
|
||||
overtime.carry_forward_quantity += overtime.remaining_quantity - 40
|
||||
tree_id = self.env.ref("yuthon_hr_attendance.view_yuthon_overtime_line_tree1").id
|
||||
return {
|
||||
"name": _("结转明细"),
|
||||
"type": "ir.actions.act_window",
|
||||
"views": [(tree_id, "tree")],
|
||||
"res_model": "yuthon.overtime.line",
|
||||
"target": "current",
|
||||
"domain": domain
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -868,7 +868,7 @@ class YuthonVacationReports(models.Model):
|
||||
if line.is_void:
|
||||
continue
|
||||
|
||||
line_total = (line.workday or 0) + (line.public_holidays or 0)
|
||||
line_total = line.remaining_quantity
|
||||
legal_total += (line.legal_day or 0)
|
||||
if line.update_type == 'add':
|
||||
total_add += line_total
|
||||
@@ -1032,15 +1032,15 @@ class YuthonVacationReports(models.Model):
|
||||
base_month = int(base_line.select_month)
|
||||
base_date = date(base_year, base_month, 1)
|
||||
self.env['yuthon.overtime.line'].search([]).unlink()
|
||||
# 上上个月第一天(用于select_month赋值)
|
||||
last_month_first = (base_date - relativedelta(months=2)).replace(day=1)
|
||||
# 上上个月最后一天(时间筛选的截止点)
|
||||
current_month_last = (base_date - relativedelta(months=1)).replace(day=1) - timedelta(days=1)
|
||||
current_date = base_date - timedelta(days=1)
|
||||
current_month_last = base_date - relativedelta(months=1) - timedelta(days=1)
|
||||
current_month_last_dt = datetime.combine(current_month_last, datetime.min.time())
|
||||
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
|
||||
if self.env.user.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
'|',
|
||||
('carry_forward_date', '=', False),
|
||||
('carry_forward_date', '<', current_month_last_dt),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
@@ -1057,7 +1057,8 @@ class YuthonVacationReports(models.Model):
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
('start_time', '<', current_month_last_dt)
|
||||
]
|
||||
over_lines = self.env['vacation.over.line'].search(domain)
|
||||
all_records = self.env['vacation.over.line'].search(domain)
|
||||
over_lines = all_records.filtered(lambda r: abs(r.remaining_quantity) > 1e-6)
|
||||
if not over_lines:
|
||||
return
|
||||
|
||||
@@ -1077,8 +1078,8 @@ class YuthonVacationReports(models.Model):
|
||||
'carry_forward_quantity': 0.0,
|
||||
'carry_forward_date': line.carry_forward_date,
|
||||
'remaining_quantity': 0.0,
|
||||
'select_month': str(last_month_first.month),
|
||||
'select_year': str(last_month_first.year)
|
||||
'select_month': str(current_date.month),
|
||||
'select_year': str(current_date.year)
|
||||
}
|
||||
|
||||
summary = employee_summary[emp_id]
|
||||
@@ -1103,13 +1104,15 @@ class YuthonVacationReports(models.Model):
|
||||
base_month = int(base_line.select_month)
|
||||
base_date = date(base_year, base_month, 1)
|
||||
self.env['yuthon.overtime.line'].search([]).unlink()
|
||||
next_month_first = (base_date + relativedelta(months=1)).replace(day=1)
|
||||
next_month_last = (base_date + relativedelta(months=2)).replace(day=1) - timedelta(days=1)
|
||||
current_date = (base_date + relativedelta(months=2)).replace(day=1) - timedelta(days=1)
|
||||
next_month_last = (base_date + relativedelta(months=1)).replace(day=1) - timedelta(days=1)
|
||||
next_month_last_dt = datetime.combine(next_month_last, datetime.min.time())
|
||||
dec_2025_end = datetime(2025, 12, 31, 23, 59, 59)
|
||||
if self.env.user.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
'|',
|
||||
('carry_forward_date', '=', False),
|
||||
('carry_forward_date', '<', next_month_last_dt),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
@@ -1126,7 +1129,8 @@ class YuthonVacationReports(models.Model):
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
('start_time', '<', next_month_last_dt)
|
||||
]
|
||||
over_lines = self.env['vacation.over.line'].search(domain)
|
||||
all_records = self.env['vacation.over.line'].search(domain)
|
||||
over_lines = all_records.filtered(lambda r: abs(r.remaining_quantity) > 1e-6)
|
||||
if not over_lines:
|
||||
return
|
||||
|
||||
@@ -1144,8 +1148,8 @@ class YuthonVacationReports(models.Model):
|
||||
'public_holidays': 0.0,
|
||||
'carry_forward_quantity': 0.0,
|
||||
'carry_forward_date': line.carry_forward_date,
|
||||
'select_month': str(next_month_first.month),
|
||||
'select_year': str(next_month_first.year)
|
||||
'select_month': str(current_date.month),
|
||||
'select_year': str(current_date.year)
|
||||
}
|
||||
|
||||
summary = employee_summary[emp_id]
|
||||
@@ -1177,7 +1181,9 @@ class YuthonVacationReports(models.Model):
|
||||
# 原有domain(先筛选出基础数据)
|
||||
if self.env.user.company_id.name == '集团本部':
|
||||
domain = [
|
||||
('remaining_quantity', '!=', 0.0),
|
||||
'|',
|
||||
('carry_forward_date', '=', False),
|
||||
('carry_forward_date', '<', current_month_first_dt),
|
||||
'|',
|
||||
('is_initial_number', '=', True),
|
||||
'&', ('is_initial_number', '=', False),
|
||||
@@ -1195,7 +1201,8 @@ class YuthonVacationReports(models.Model):
|
||||
('start_time', '<', current_month_first_dt)
|
||||
]
|
||||
|
||||
over_lines = self.env['vacation.over.line'].search(domain)
|
||||
all_records = self.env['vacation.over.line'].search(domain)
|
||||
over_lines = all_records.filtered(lambda r: abs(r.remaining_quantity) > 1e-6)
|
||||
if not over_lines:
|
||||
return
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ export class CustomAttendanceVacationConfirmController extends ListController {
|
||||
super.setup();
|
||||
}
|
||||
|
||||
async getAction(lock_type) {
|
||||
await this.orm.call('vacation.over.line', 'confirm', []);
|
||||
async getAction() {
|
||||
const res = await this.orm.call('yuthon.overtime.line', 'carryover_details', []);
|
||||
this.actionService.doAction(res)
|
||||
}
|
||||
async getNextAction(lock_type) {
|
||||
await this.orm.call('yuthon.vacation.reports', 'next_month', []);
|
||||
|
||||
@@ -5,13 +5,18 @@
|
||||
<field name="model">vacation.overtime.active</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加班情况(归档)" editable="bottom">
|
||||
<field name="overtime_name"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="carry_forward_quantity"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="select_year"/>
|
||||
<field name="select_month"/>
|
||||
<field name="last_balance"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="workday"/>
|
||||
<field name="public_holidays"/>
|
||||
<field name="vacation_sum" options='{ "fg_color": "red: vacation_sum > 40"}'/>
|
||||
<field name="carry_forward_quantity" options='{ "fg_color": "blue: carry_forward_quantity > 0"}'/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="carry_result"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<button name="open_record" type="object" string="详情" class="oe_highlight"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_overtime_line_tree1" model="ir.ui.view">
|
||||
<field name="name">yuthon.overtime.line.tree</field>
|
||||
<field name="model">yuthon.overtime.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加班结转报表" editable="bottom" create="0">
|
||||
<header>
|
||||
<button name="carryover_active" type="object" string="归档" dclass="oe_highlight" confirm="确定要归档吗?"/>
|
||||
</header>
|
||||
<field name="employee_id"/>
|
||||
<field name="select_year"/>
|
||||
<field name="select_month"/>
|
||||
<field name="last_balance"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="workday"/>
|
||||
<field name="public_holidays"/>
|
||||
<field name="vacation_sum" options='{ "fg_color": "red: vacation_sum > 40"}'/>
|
||||
<field name="carry_forward_quantity" options='{ "fg_color": "blue: carry_forward_quantity > 0"}'/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="archive_state"/>
|
||||
<button name="open_record" type="object" string="详情" class="oe_highlight"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_overtime_line_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.overtime.line.tree</field>
|
||||
<field name="model">yuthon.overtime.line</field>
|
||||
@@ -12,17 +36,13 @@
|
||||
<field name="valid_date"/>
|
||||
<field name="workday"/>
|
||||
<field name="public_holidays"/>
|
||||
<field name="vacation_sum"/>
|
||||
<field name="carry_forward_quantity"/>
|
||||
<field name="vacation_sum" options='{ "fg_color": "red: vacation_sum > 40"}'/>
|
||||
<field name="carry_forward_quantity" options='{ "fg_color": "blue: carry_forward_quantity > 0"}'/>
|
||||
<field name="carry_forward_date"/>
|
||||
<field name="remaining_quantity"/>
|
||||
<field name="archive_state"/>
|
||||
<button name="open_record" type="object" string="详情" class="oe_highlight"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_overtime_line_action" model="ir.actions.act_window">
|
||||
<field name="name">加班合计数报表</field>
|
||||
<field name="res_model">yuthon.overtime.line</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -651,11 +651,6 @@
|
||||
<filter string="员工" name="group_by_employee_id" domain="[]" context="{'group_by': 'employee_id'}"/>
|
||||
<filter name="now_month" string="当月" domain="[('start_time', '>=', (context_today() + relativedelta(day=1)).strftime('%Y-%m-%d')),
|
||||
('start_time', '<', (context_today() + relativedelta(months=+1, day=1)).strftime('%Y-%m-%d'))]"/>
|
||||
<header_search class="header-search-inline">
|
||||
<field name="start_time"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id"/>
|
||||
</header_search>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -66,6 +66,25 @@ class YuthonNotice(models.Model):
|
||||
# self.start_date = today
|
||||
# self.create_date1 = today
|
||||
|
||||
is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',
|
||||
search='_search_part_of_company')
|
||||
|
||||
@api.depends_context('uid', 'company')
|
||||
@api.depends('company_id')
|
||||
def _compute_is_company(self):
|
||||
active_company_ids = self.env.companies
|
||||
for employee in self:
|
||||
employee.is_company = employee.company_id in active_company_ids
|
||||
|
||||
def _search_part_of_company(self, operator, value):
|
||||
company_ids = self.env.companies.ids
|
||||
if not value:
|
||||
operator = '!=' if operator == '=' else '='
|
||||
if operator == '=':
|
||||
return [('company_id', 'in', company_ids)]
|
||||
else:
|
||||
return [('company_id', 'not in', company_ids)]
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for i in vals_list:
|
||||
|
||||
@@ -190,9 +190,10 @@
|
||||
|
||||
<record id="approval_notice_action" model="ir.actions.act_window">
|
||||
<field name="name">通知公告</field>
|
||||
<field name="domain">[('is_company', '=', True)]</field>
|
||||
<field name="res_model">yuthon.notice</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('notice_state', '=', 'yes'),('users_ids', 'in', [uid])]</field>
|
||||
<!-- <field name="domain">[('notice_state', '=', 'yes'),('users_ids', 'in', [uid])]</field>-->
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_notice.view_yuthon_notice_tree2')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_notice.view_yuthon_notice_form2')})]"/>
|
||||
@@ -200,6 +201,7 @@
|
||||
|
||||
<record id="approval_notice_action2" model="ir.actions.act_window">
|
||||
<field name="name">通知公告管理</field>
|
||||
<field name="domain">[('is_company', '=', True)]</field>
|
||||
<field name="res_model">yuthon.notice</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
'report/official_print_template.xml',
|
||||
'report/file_processing_report.xml',
|
||||
'report/file_processing_report_templates.xml',
|
||||
'report/sub_enterprises_report.xml',
|
||||
'report/sub_enterprises_report_templates.xml',
|
||||
'report/incoming_normal_report.xml',
|
||||
'report/incoming_normal_report_templates.xml',
|
||||
|
||||
|
||||
],
|
||||
|
||||
@@ -79,6 +79,10 @@ class YuthonOfficialIncomingNormal(models.Model):
|
||||
'default_incoming_normal_id': self.id,
|
||||
},
|
||||
}
|
||||
|
||||
def action_print_incoming_normal(self):
|
||||
report_ref = self.env.ref('yuthon_official.action_incoming_normal_report')
|
||||
return report_ref.report_action(self.id)
|
||||
# def button_meet(self):
|
||||
# return {
|
||||
# "name": "会议",
|
||||
|
||||
@@ -120,4 +120,8 @@ class YuthonSubEnterprises(models.Model):
|
||||
enterprises_ids = self.env["yuthon.sub.enterprises"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for enterprises in enterprises_ids:
|
||||
enterprises._compute_workflow()
|
||||
enterprises._compute_workflow()
|
||||
|
||||
def action_print_sub_enterprises(self):
|
||||
report_ref = self.env.ref('yuthon_official.action_sub_enterprises_report')
|
||||
return report_ref.report_action(self.id)
|
||||
@@ -24,8 +24,8 @@
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 流水号:页面左上角,位于标题之上 -->
|
||||
<div style="margin-bottom:8px; text-align:left;">
|
||||
<!-- 流水号:页面左上角,位于标题之上,浅灰色 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="paperformat_incoming_normal_small" model="report.paperformat">
|
||||
<field name="name">Incoming Normal Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
<record id="action_incoming_normal_report" model="ir.actions.report">
|
||||
<field name="name">行政收文</field>
|
||||
<field name="paperformat_id" ref="yuthon_official.paperformat_incoming_normal_small"/>
|
||||
<field name="model">yuthon.official.incoming.normal</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_official.incoming_normal_report_document</field>
|
||||
<field name="report_file">yuthon_official.incoming_normal_report_document</field>
|
||||
<field name="binding_model_id" ref="model_yuthon_official_incoming_normal"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'行政收文%s_%s_%s' % (object.name or '', object.code or '', (object.time_date and object.time_date.strftime('%Y-%m-%d') or ''))</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="incoming_normal_report_document">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<style type="text/css">
|
||||
/* 表格纵向版式:自适应,最大800px 居中 */
|
||||
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1;}
|
||||
|
||||
/* 附件清单左对齐 */
|
||||
.attachment-list { text-align: left; }
|
||||
/* 隐藏意见和审批人之间的竖边框 */
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 流水号:页面左上角,位于标题之上,浅灰色 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
<!-- 行政收文标题 - 不在表格内 -->
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
行政收文
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
</colgroup>
|
||||
<!-- 日期行:显示在表格右上角 -->
|
||||
<tr>
|
||||
<td colspan="3" style="border:none;"></td>
|
||||
<td style="text-align:right; border:none;">日期:<span t-esc="doc.time_date and doc.time_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>标题</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>正文</strong></td>
|
||||
<td colspan="3" class="attachment-list"><span t-field="doc.main_text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>附件</strong></td>
|
||||
<td colspan="3" class="attachment-list">
|
||||
<t t-foreach="doc.official_documents_ids" t-as="att">
|
||||
<div><t t-esc="att.name"/></div>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>来文单位</strong></td>
|
||||
<td><span t-esc="doc.official_partner_id.name or ''"/></td>
|
||||
<td class="header-cell"><strong>收文编号</strong></td>
|
||||
<td><span t-esc="doc.incoming_file_id or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>密级</strong></td>
|
||||
<td>
|
||||
<span t-if="doc.secret_level == 'normal'">一般</span>
|
||||
<span t-if="doc.secret_level == 'urgent'">秘密</span>
|
||||
<span t-if="doc.secret_level == 'secret'">机密</span>
|
||||
<span t-if="doc.secret_level == 'so_secret'">绝密</span>
|
||||
</td>
|
||||
<td class="header-cell"><strong>办理期限</strong></td>
|
||||
<td>
|
||||
<span t-if="doc.is_supervising" t-esc="doc.deadline and doc.deadline.strftime('%Y-%m-%d') or ''"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>备注事项</strong></td>
|
||||
<td colspan="1"><span t-esc="doc.remarks or ''"/></td>
|
||||
<td class="header-cell"><strong>完成时间</strong></td>
|
||||
<td>
|
||||
<span t-if="doc.is_supervising" t-esc="doc.done_date and doc.done_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 关联议题:仅在is_issues为True时显示 -->
|
||||
<tr t-if="doc.is_issues">
|
||||
<td class="header-cell"><strong>关联议题</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.related_issues_id.name or ''"/></td>
|
||||
</tr>
|
||||
<!-- 督办明细:仅在is_supervising为True时显示 -->
|
||||
<t t-if="doc.is_supervising and doc.workflow_inspector_ids">
|
||||
<tr>
|
||||
<td colspan="4" style="background-color: #d4e6f1; text-align: center;"><strong>督办明细</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>督办标题</strong></td>
|
||||
<td class="header-cell"><strong>督办流水号</strong></td>
|
||||
<td class="header-cell"><strong>部门</strong></td>
|
||||
<td class="header-cell"><strong>督办日期</strong></td>
|
||||
</tr>
|
||||
<t t-foreach="doc.workflow_inspector_ids" t-as="inspector">
|
||||
<tr>
|
||||
<td><span t-esc="inspector.name or ''"/></td>
|
||||
<td><span t-esc="inspector.code or ''"/></td>
|
||||
<td><span t-esc="inspector.department_id.name or ''"/></td>
|
||||
<td><span t-esc="inspector.start_data and inspector.start_data.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
<tr>
|
||||
<td colspan="4" style="background-color: #d4e6f1; text-align: center;"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<t t-set="logs_ordered" t-value="doc.log_ids.sorted(lambda x: x.date_create or '')"/>
|
||||
<t t-foreach="logs_ordered" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
||||
<!-- 核心修改:隐藏意见列右侧边框 -->
|
||||
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
|
||||
<!-- 核心修改:隐藏审批人列左侧边框 -->
|
||||
<td class="no-left-border" colspan="1">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,19 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="paperformat_official_a4" model="report.paperformat">
|
||||
<field name="name">Official A4</field>
|
||||
<data>
|
||||
<record id="paperformat_official_small" model="report.paperformat">
|
||||
<field name="name">Official Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
<record id="action_official_print_report" model="ir.actions.report">
|
||||
<field name="name">发文审批单</field>
|
||||
<field name="paperformat_id" ref="yuthon_official.paperformat_official_a4"/>
|
||||
<field name="model">yuthon.official</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_official.official_print_template</field>
|
||||
<field name="report_file">yuthon_official.official_print_template</field>
|
||||
<field name="print_report_name">'发文审批单-%s' % (object.name or '')</field>
|
||||
<field name="binding_model_id" ref="yuthon_official.model_yuthon_official"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
<record id="action_official_print_report" model="ir.actions.report">
|
||||
<field name="name">行政发文</field>
|
||||
<field name="paperformat_id" ref="yuthon_official.paperformat_official_small"/>
|
||||
<field name="model">yuthon.official</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_official.official_print_template</field>
|
||||
<field name="report_file">yuthon_official.official_print_template</field>
|
||||
<field name="binding_model_id" ref="model_yuthon_official"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'行政发文%s_%s_%s' % (object.name or '', object.code or '', (object.date and object.date.strftime('%Y-%m-%d') or ''))</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -4,129 +4,134 @@
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<style type="text/css">
|
||||
.po-wrap { max-width: 800px; width: auto; margin: 0 auto; font-size: 13px; }
|
||||
.po-title { text-align: center; font-weight: bold; font-size: 20px; padding: 10px 0 14px; }
|
||||
table.po { max-width: 800px; width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 auto; }
|
||||
table.po td { border: 1px solid #000; padding: 6px; vertical-align: top; }
|
||||
.label { background-color: #d4e6f1; font-weight: bold; text-align: center; width: 120px; }
|
||||
.content-col { width: calc((100% - 240px)/2); }
|
||||
.section { text-align: center; font-weight: bold; background-color: #d4e6f1; border: 1px solid #000; padding: 6px 0; }
|
||||
.subhead { background: #fdf3c1; font-weight: bold; text-align: center; }
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
.text-center { text-align: center !important; }
|
||||
.text-right { text-align: right !important; }
|
||||
</style>
|
||||
<div class="po-wrap">
|
||||
<div class="po-title">发文审批单</div>
|
||||
<div style="margin-bottom: 6px;">
|
||||
部门:
|
||||
<span t-esc="doc.department_id.name or ''"/>
|
||||
</div>
|
||||
<table class="po">
|
||||
<t t-if="doc.is_cold">
|
||||
<tr>
|
||||
<td class="label">公文类型</td>
|
||||
<td class="content-col"><span t-esc="doc.official_type_id.name or ''"/></td>
|
||||
<td class="label">发文字号</td>
|
||||
<td class="content-col"><span t-esc="doc.reference_cold or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<tr>
|
||||
<td class="label">公文类型</td>
|
||||
<td colspan="3"><span t-esc="doc.official_type_id.name or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
<tr>
|
||||
<td class="label">密级</td>
|
||||
<td class="content-col">
|
||||
<t t-if="doc.secret_level == 'normal'">一般</t>
|
||||
<t t-elif="doc.secret_level == 'urgent'">秘密</t>
|
||||
<t t-elif="doc.secret_level == 'secret'">机密</t>
|
||||
<t t-elif="doc.secret_level == 'so_secret'">绝密</t>
|
||||
</td>
|
||||
<td class="label">紧急程度</td>
|
||||
<td class="content-col">
|
||||
<t t-if="doc.urgency_level == 'normal'">一般</t>
|
||||
<t t-elif="doc.urgency_level == 'urgent'">紧急</t>
|
||||
<t t-elif="doc.urgency_level == 'extra_urgent'">特急</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">标题</td>
|
||||
<td colspan="3"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<t t-if="doc.main_flats_id">
|
||||
<tr>
|
||||
<td class="label">主送单位</td>
|
||||
<td colspan="3"><span t-esc="doc.main_flats_id.name or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
<t t-if="doc.copy_flats_id">
|
||||
<tr>
|
||||
<td class="label">抄送单位</td>
|
||||
<td colspan="3"><span t-esc="doc.copy_flats_id.name or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
<tr>
|
||||
<td class="label">文件内容摘要</td>
|
||||
<td colspan="3"><span t-esc="doc.main_text or ''"/></td>
|
||||
</tr>
|
||||
<t t-if="doc.is_chapter == 'yes'">
|
||||
<tr>
|
||||
<td class="label">用章范围</td>
|
||||
<td colspan="3">
|
||||
<t t-if="doc.scope_chapter_ids">
|
||||
<t t-foreach="doc.scope_chapter_ids" t-as="scope">
|
||||
<div><span t-esc="scope.name or ''"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">用章类型</td>
|
||||
<td colspan="3">
|
||||
<t t-if="doc.type_stamp_ids">
|
||||
<t t-foreach="doc.type_stamp_ids" t-as="stype">
|
||||
<div><span t-esc="stype.name or ''"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
<tr>
|
||||
<td class="label">附件</td>
|
||||
<td colspan="3" style="text-align:left;">
|
||||
<t t-if="doc.official_documents_ids">
|
||||
<t t-foreach="doc.official_documents_ids" t-as="att">
|
||||
<div><span t-esc="att.name or ''"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="section">审批详情</div>
|
||||
<table class="po">
|
||||
<t t-if="doc.log_ids">
|
||||
<t t-foreach="doc.log_ids.sorted('sequence')" t-as="log">
|
||||
<tr>
|
||||
<td class="text-center"><span t-esc="log.name or ''"/></td>
|
||||
<td class="no-right-border text-center"><span t-esc="log.comment or ''"/></td>
|
||||
<td class="no-left-border text-center">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/>
|
||||
<span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</table>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
/* 表格纵向版式:自适应,最大800px 居中 */
|
||||
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1;}
|
||||
|
||||
/* 附件清单左对齐 */
|
||||
.attachment-list { text-align: left; }
|
||||
/* 隐藏意见和审批人之间的竖边框 */
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 流水号:页面左上角,位于标题之上,浅灰色 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
<!-- 行政发文标题 - 不在表格内 -->
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
行政发文
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
</colgroup>
|
||||
<!-- 拟稿日期行:显示在表格右上角 -->
|
||||
<tr>
|
||||
<td colspan="3" style="border:none;"></td>
|
||||
<td style="text-align:right; border:none;">拟稿日期:<span t-esc="doc.date and doc.date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>标题</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<!-- 发文字号:仅在is_cold为True时显示 -->
|
||||
<tr t-if="doc.is_cold">
|
||||
<td class="header-cell"><strong>发文字号</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.reference_cold or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>紧急度</strong></td>
|
||||
<td>
|
||||
<span t-if="doc.urgency_level == 'normal'">一般</span>
|
||||
<span t-if="doc.urgency_level == 'urgent'">紧急</span>
|
||||
<span t-if="doc.urgency_level == 'extra_urgent'">特急</span>
|
||||
</td>
|
||||
<td class="header-cell"><strong>密级</strong></td>
|
||||
<td>
|
||||
<span t-if="doc.secret_level == 'normal'">一般</span>
|
||||
<span t-if="doc.secret_level == 'urgent'">秘密</span>
|
||||
<span t-if="doc.secret_level == 'secret'">机密</span>
|
||||
<span t-if="doc.secret_level == 'so_secret'">绝密</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>主送单位</strong></td>
|
||||
<td colspan="3" class="attachment-list">
|
||||
<t t-foreach="doc.main_flats_ids" t-as="main_flat">
|
||||
<span t-esc="main_flat.name"/>
|
||||
<t t-if="not main_flat_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>抄送单位</strong></td>
|
||||
<td colspan="3" class="attachment-list">
|
||||
<t t-foreach="doc.copy_flats_ids" t-as="copy_flat">
|
||||
<span t-esc="copy_flat.name"/>
|
||||
<t t-if="not copy_flat_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>文件内容</strong></td>
|
||||
<td colspan="3" class="attachment-list"><span t-field="doc.main_text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>附件</strong></td>
|
||||
<td colspan="3" class="attachment-list">
|
||||
<t t-foreach="doc.official_documents_ids" t-as="att">
|
||||
<div><t t-esc="att.name"/></div>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 用章类型:仅在is_chapter为'yes'时显示 -->
|
||||
<tr t-if="doc.is_chapter == 'yes'">
|
||||
<td class="header-cell"><strong>用章类型</strong></td>
|
||||
<td colspan="3" class="attachment-list">
|
||||
<t t-foreach="doc.type_stamp_ids" t-as="stamp">
|
||||
<span t-esc="stamp.name"/>
|
||||
<t t-if="not stamp_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 关联议题:仅在is_meet为True时显示 -->
|
||||
<tr t-if="doc.is_meet">
|
||||
<td class="header-cell"><strong>关联议题</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.related_issues_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" style="background-color: #d4e6f1; text-align: center;"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<t t-set="logs_ordered" t-value="doc.log_ids.sorted(lambda x: x.date_create or '')"/>
|
||||
<t t-foreach="logs_ordered" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
||||
<!-- 核心修改:隐藏意见列右侧边框 -->
|
||||
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
|
||||
<!-- 核心修改:隐藏审批人列左侧边框 -->
|
||||
<td class="no-left-border" colspan="1">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="paperformat_sub_enterprises_small" model="report.paperformat">
|
||||
<field name="name">Sub Enterprises Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
<record id="action_sub_enterprises_report" model="ir.actions.report">
|
||||
<field name="name">文件处理(子企业)</field>
|
||||
<field name="paperformat_id" ref="yuthon_official.paperformat_sub_enterprises_small"/>
|
||||
<field name="model">yuthon.sub.enterprises</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_official.sub_enterprises_report_document</field>
|
||||
<field name="report_file">yuthon_official.sub_enterprises_report_document</field>
|
||||
<field name="binding_model_id" ref="model_yuthon_sub_enterprises"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'文件处理(子企业)%s_%s' % (object.name or '', object.code or '')</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="sub_enterprises_report_document">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<style type="text/css">
|
||||
/* 表格纵向版式:自适应,最大800px 居中 */
|
||||
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1;}
|
||||
|
||||
/* 附件清单左对齐 */
|
||||
.attachment-list { text-align: left; }
|
||||
/* 隐藏意见和审批人之间的竖边框 */
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 流水号:页面左上角,位于标题之上,浅灰色 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
<!-- 文件处理(子企业)标题 - 不在表格内 -->
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
文件处理(子企业)
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:50%"/>
|
||||
<col style="width:35%"/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>名称</strong></td>
|
||||
<td colspan="2"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>来文编号</strong></td>
|
||||
<td colspan="2"><span t-esc="doc.come_file_id or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>来文单位</strong></td>
|
||||
<td colspan="2"><span t-esc="doc.official_partner_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>事由</strong></td>
|
||||
<td colspan="2" class="attachment-list"><span t-esc="doc.reason_application or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>附件</strong></td>
|
||||
<td colspan="2" class="attachment-list">
|
||||
<t t-foreach="doc.document_ids" t-as="att">
|
||||
<div><t t-esc="att.name"/></div>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="background-color: #d4e6f1; text-align: center;"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<t t-set="logs_ordered" t-value="doc.log_ids.sorted(lambda x: x.date_create or '')"/>
|
||||
<t t-foreach="logs_ordered" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
||||
<!-- 核心修改:隐藏意见列右侧边框 -->
|
||||
<td class="no-right-border" colspan="1"><span t-esc="log.comment or ''"/></td>
|
||||
<!-- 核心修改:隐藏审批人列左侧边框 -->
|
||||
<td class="no-left-border" colspan="1">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -17,6 +17,12 @@
|
||||
<field name="model">yuthon.official.incoming.normal</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="0">
|
||||
<header>
|
||||
<button name="action_print_incoming_normal"
|
||||
type="object"
|
||||
string="打印"
|
||||
class="btn-primary" invisible="not work_end"/>
|
||||
</header>
|
||||
<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'"/>
|
||||
|
||||
@@ -79,11 +79,12 @@
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_text" string="文件内容"/>
|
||||
<field name="official_documents_ids" widget="preview_many2many"/>
|
||||
</group>>
|
||||
<group string="文件内容">
|
||||
<field name="main_text" string=" "/>
|
||||
</group>
|
||||
<!-- <group string="文件内容">-->
|
||||
<!-- <field name="main_text" string=" "/>-->
|
||||
<!-- </group>-->
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -93,14 +93,16 @@
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_text" string="文件内容"/>
|
||||
<field name="official_documents_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
<group>
|
||||
<!-- <field name="main_text" string="文件内容"/>-->
|
||||
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}}"/>
|
||||
</group>
|
||||
<group string="文件内容">
|
||||
<field name="main_text" string=" "/>
|
||||
</group>
|
||||
<!-- <group string="文件内容">-->
|
||||
<!-- <field name="main_text" string=" "/>-->
|
||||
<!-- </group>-->
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
<field name="model">yuthon.sub.enterprises</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="文件处理(子企业)">
|
||||
<header>
|
||||
<button name="action_print_sub_enterprises"
|
||||
type="object"
|
||||
string="打印"
|
||||
class="btn-primary" invisible="not work_end"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
|
||||
@@ -39,15 +39,17 @@
|
||||
</h1>
|
||||
</div>
|
||||
<group string="审批事项">
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" context="{'search_default_group_by_scope': 1, 'search_default_filter_effective': 1}"/>
|
||||
<field name="approval_unit"/>
|
||||
<field name="remake"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<group>
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" context="{'search_default_group_by_scope': 1, 'search_default_filter_effective': 1}"/>
|
||||
<field name="approval_unit"/>
|
||||
<field name="remake"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
@@ -365,15 +365,15 @@
|
||||
<!-- parent="yuthon_catering_root_menu"-->
|
||||
<!-- action="yuthon_salary.view_yuthon_meal_expenses_action"-->
|
||||
<!-- sequence="5"/>-->
|
||||
<menuitem id="yuthon_salary_party_views_menu"
|
||||
name="党建工作"
|
||||
parent="human_resources_salary_root_board"
|
||||
sequence="4"/>
|
||||
<menuitem id="yuthon_salary_party_views_report_menu"
|
||||
name="党费报表"
|
||||
parent="yuthon_salary_party_views_menu"
|
||||
action="yuthon_salary.view_yuthon_salary_party_action"
|
||||
sequence="1"/>
|
||||
<!-- <menuitem id="yuthon_salary_party_views_menu"-->
|
||||
<!-- name="党建工作"-->
|
||||
<!-- parent="human_resources_salary_root_board"-->
|
||||
<!-- sequence="4"/>-->
|
||||
<!-- <menuitem id="yuthon_salary_party_views_report_menu"-->
|
||||
<!-- name="党费报表"-->
|
||||
<!-- parent="yuthon_salary_party_views_menu"-->
|
||||
<!-- action="yuthon_salary.view_yuthon_salary_party_action"-->
|
||||
<!-- sequence="1"/>-->
|
||||
<menuitem id="human_welfare_expenses"
|
||||
name="福利费"
|
||||
parent="human_resources_salary_root_board"
|
||||
@@ -779,6 +779,17 @@
|
||||
<menuitem id="salary_view_Individual" name="个税计算" action="yuthon_salary.action_view_hr_payslip_month_form2" sequence="100"/>
|
||||
</menuitem>
|
||||
|
||||
<!--党建工作-->
|
||||
<menuitem id="yuthon_salary_party_views_menu"
|
||||
name="党建工作"
|
||||
web_icon="yuthon_work_brand,static/description/party.png"
|
||||
sequence="4">
|
||||
<menuitem id="yuthon_salary_party_views_report_menu"
|
||||
name="党费报表"
|
||||
action="yuthon_salary.view_yuthon_salary_party_action"
|
||||
sequence="1"/>
|
||||
</menuitem>
|
||||
|
||||
|
||||
|
||||
<!-- 培训管理 -->
|
||||
|
||||
Reference in New Issue
Block a user