Merge branch 'dev' of gitee.com:jinan-pengyusen-data/gzth into dev_zhou

Signed-off-by: 李鹏宇 <pengyuthon@163.com>
This commit is contained in:
李鹏宇
2026-01-24 14:09:06 +00:00
committed by Gitee
16 changed files with 157 additions and 71 deletions
+22 -5
View File
@@ -659,11 +659,28 @@ class SoongWorkflowMixin(models.AbstractModel):
self.env["soong.workflow.record"].create(values)
if record_obj:
record_obj.update({"workflow_id": rec.workflow_id.id,
"node_id": rec.node_id.id,
"done_by": self.env.uid,
"write_date2": fields.Datetime.now(),
})
# 获取上一节点的结束时间(即log_ids最后一条记录的lase_click_date)
node_update_time = False
try:
if hasattr(rec, 'log_ids') and rec.log_ids:
# 按ID排序获取最后一条日志
sorted_logs = rec.log_ids.sorted(lambda log: log.id)
if sorted_logs and sorted_logs[-1].lase_click_date:
node_update_time = sorted_logs[-1].lase_click_date
except Exception as e:
_logger.debug(f"Failed to get node_update_time: {e}")
# 更新记录
update_vals = {
"workflow_id": rec.workflow_id.id,
"node_id": rec.node_id.id,
"done_by": self.env.uid,
"write_date2": fields.Datetime.now(),
}
if node_update_time:
update_vals["node_update_time"] = node_update_time
record_obj.update(update_vals)
def find_fields_by_string(self,record_id):
"""
@@ -82,6 +82,9 @@ class SoongWorkflowRecord(models.Model):
is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',search='_search_part_of_company')
# 办结时间(上一节点的结束时间)
node_update_time = fields.Datetime(string="办结时间")
@api.depends_context('uid', 'company')
@api.depends('company_id')
def _compute_is_company(self):
@@ -8,10 +8,18 @@
<field name="name">User</field>
<field name="category_id" ref="module_category_soong_workflow"/>
</record>
<record id="group_soong_workflow_hr" model="res.groups">
<field name="name">工作流--人事分组</field>
<field name="category_id" ref="module_category_soong_workflow"/>
<field name="implied_ids" eval="[(4, ref('group_soong_workflow_user'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
<record id="group_soong_workflow_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_category_soong_workflow"/>
<field name="implied_ids" eval="[(4, ref('group_soong_workflow_user'))]"/>
<field name="implied_ids" eval="[(4, ref('group_soong_workflow_user')),(4, ref('group_soong_workflow_hr'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
</record>
@@ -38,17 +46,5 @@
<field name="perm_unlink" eval="True"/>
</record>
<!-- 当前用户可以访问当前部门以及下属部门的数据-->
<!-- <record id="rule_soong_workflow_record_user_department_read" model="ir.rule">-->
<!-- <field name="name">当前用户可以访问当前部门以及下属部门的数据</field>-->
<!-- <field name="model_id" ref="model_soong_workflow_record"/>-->
<!-- <field name="groups" eval="[(4, ref('group_soong_workflow_user'))]"/>-->
<!-- <field name="domain_force">[('is_department_record', '=', True)]</field>-->
<!-- <field name="perm_read" eval="True"/>-->
<!-- <field name="perm_write" eval="True"/>-->
<!-- <field name="perm_create" eval="True"/>-->
<!-- <field name="perm_unlink" eval="True"/>-->
<!-- </record>-->
</data>
</odoo>
@@ -19,4 +19,16 @@
}
.o_comment_combined_input {
flex: 2;
}
.o_kanban_soong_wkf_record {
.o_kanban_record_headings {
flex: 1;
}
.o_kanban_record_bottom {
flex: 0 0 94px;
@include media-breakpoint-down(sm) {
flex: 0 0 56px;
}
}
}
@@ -175,21 +175,21 @@
<field name="node_btn_name"/>
<templates>
<t t-name="kanban-box">
<div class="o_kanban_record d-md-none card h-100">
<div class="o_kanban_record d-md-none card h-100 border-0">
<div class="card-body">
<div class="mb-2">
<small>
节点:<field name="name" />
</small>
<div class="d-flex justify-content-between align-items-center">
<small>
节点:<field name="name" />
</small>
<small>
状态:<field name="approval_state"/>
</small>
</div>
</div>
<div class="mb-2">
<small>
状态:<field name="approval_state"/>
</small>
</div>
<div class="mb-2">
<small>
经办人:<field name="done_by"/>
经办人:<field name="done_by"/> <field name="lase_click_date"/>
</small>
</div>
<div class="mb-2">
@@ -197,7 +197,7 @@
意见:<field name="comment"/>
</small>
</div>
<div class="mb-2">
<div class="mb-2" t-if="record.document_ids.raw_value.length">
<small>
附件:<field name="document_ids" widget="preview_many2many"/>
</small>
+41 -5
View File
@@ -243,7 +243,7 @@
decoration-danger="approve_state == 'end'" decoration-success="approve_state == 'pending'"/>
<field name="create_uid"/>
<field name="employee_ids" widget="many2many_tags" string="当前经办人" class="list_ids_width"/>
<field name="soong_state"/>
<field name="soong_state"/><field name="node_update_time" string="办结时间" optional="show"/>
<field name="is_manager" column_invisible="1"/>
<field name="is_unlink" column_invisible="1"/>
<field name="is_log2" column_invisible="1"/>
@@ -252,7 +252,42 @@
invisible="not is_unlink"/>
<button name="greater_record" type="object" string="更多" class="btn-primary" invisible="not is_log2"/>
<button name="reminders_record" type="object" string="催办" class="btn-primary"
invisible="soong_state != 'done' or create_uid != uid or approve_state == 'end'"/>
invisible="create_uid != uid or approve_state == 'end'"/>
<button name="revoke_record" type="object" string="撤销" class="btn-primary"
groups="soong_workflow.group_soong_workflow_manager"/>
</tree>
</field>
</record>
<!-- 已办流程视图 -->
<record id="soong_workflow_record_done_tree" model="ir.ui.view">
<field name="name">soong.workflow.done.record.tree</field>
<field name="model">soong.workflow.record</field>
<field name="arch" type="xml">
<tree string="已办流程" action="open_record" type="object"
decoration-muted="approve_state == 'end'" decoration-warning="approve_state != 'end'"
delete="false"
create="false" default_order="write_date2 desc, id desc" expand="1" limit="10">
<header>
<button name="admin_end" type="object" string="管理员强制结束" class="oe_highlight"
groups="soong_workflow.group_soong_workflow_manager"/>
<button name="delete_record" type="object" string="删除" class="oe_highlight"
groups="soong_workflow.group_soong_workflow_manager"/>
</header>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="code"/>
<field name="workflow_id" string="审批类型"/>
<field name="name"/>
<field name="approve_state" string="审批状态" widget="badge"
decoration-danger="approve_state == 'end'" decoration-success="approve_state == 'pending'"/>
<field name="create_uid"/>
<field name="node_update_time" string="办结时间" optional="show"/>
<field name="is_manager" column_invisible="1"/>
<field name="is_unlink" column_invisible="1"/>
<field name="is_log2" column_invisible="1"/>
<button name="delete_record" type="object" string="删除" class="btn-primary"
confirm="你确定要删除吗?"
invisible="not is_unlink"/>
<button name="greater_record" type="object" string="更多" class="btn-primary" invisible="not is_log2"/>
<button name="revoke_record" type="object" string="撤销" class="btn-primary"
groups="soong_workflow.group_soong_workflow_manager"/>
</tree>
@@ -294,6 +329,7 @@
<button name="delete_record" type="object" string="删除" class="oe_highlight"
groups="soong_workflow.group_soong_workflow_manager"/>
</header>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="code"/>
<field name="workflow_id" string="审批类型"/>
<field name="name"/>
@@ -301,7 +337,7 @@
decoration-danger="approve_state == 'end'" decoration-success="approve_state == 'pending'"/>
<field name="create_uid"/>
<field name="employee_ids" widget="many2many_tags" string="当前经办人" class="list_ids_width"/>
<field name="soong_state"/>
<field name="soong_state"/><field name="node_update_time" string="办结时间" optional="show"/>
<field name="is_manager" column_invisible="1"/>
</tree>
</field>
@@ -315,7 +351,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_details">
<div class="o_kanban_record_top mb-0">
<div class="o_kanban_record_top mb-0 o_kanban_soong_wkf_record">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
@@ -393,7 +429,7 @@
['done', 'active']), ('is_company', '=', True)]
</field>
<field name="search_view_id" ref="soong_workflow_record_search1"/>
<field name="view_id" ref="soong_workflow_record_my_tree"/>
<field name="view_id" ref="soong_workflow_record_done_tree"/>
</record>
<record id="soong_workflow_department_record_action" model="ir.actions.act_window">
<field name="name">流程查询</field>
@@ -35,7 +35,7 @@
<group>
<!-- 归档弹窗新增“本公司”勾选,控制抄送人员是否限定当前公司 -->
<field name="is_this_company"/>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)] if is_this_company else [('id', 'not in' , filter_personnel_ids)]" context="{'select_dialog': 'list'}"/>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)] if is_this_company else [('id', 'not in' , filter_personnel_ids)]"/>
<field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>
</group>
</group>
@@ -59,7 +59,7 @@
<field name="comment_note" placeholder="请输入意见内容..." style="width: 100%;"/>
</div>
<group>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain = "[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)]" context="{'select_dialog': 'list'}"/>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain = "[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)]"/>
</group>
</group>
<group invisible="node_btn_name != '分发'">
@@ -94,8 +94,8 @@
<field name="is_selection"/>
<field name="company_id" invisible="1"/>
<field name="employee_ids1" widget="many2many_tags" string="人员范围" invisible="1"/>
<field name="employee_ids" widget="many2many_tags" string="人员范围" domain = "[('company_id', '=', company_id), ('id', 'in', employee_ids1)] if is_this_company else [('id', 'in', employee_ids1)]" options="{'no_create': True}" context="{'select_dialog': 'list'}"/>
<field name="circulated_employee_ids" invisible="node_btn_name == '退回'" widget="many2many_tags" options="{'no_create': True}" domain = "[('company_id', '=', company_id),('id', 'not in' , filter_personnel_ids)]" context="{'select_dialog': 'list'}"/>
<field name="employee_ids" widget="many2many_tags" string="人员范围" domain = "[('company_id', '=', company_id), ('id', 'in', employee_ids1)] if is_this_company else [('id', 'in', employee_ids1)]" options="{'no_create': True}" context="{'tree_view_ref':'yuthon_hr_employee.view_employee_phone_tree'}"/>
<field name="circulated_employee_ids" invisible="node_btn_name == '退回'" widget="many2many_tags" options="{'no_create': True}" domain = "[('company_id', '=', company_id),('id', 'not in' , filter_personnel_ids)]"/>
<!-- <field name="add_employee_ids" invisible="node_btn_name == '退回'" widget="many2many_tags" options="{'no_create': True}"/>-->
</group>
</group>
@@ -105,13 +105,23 @@
<div invisible="node_btn_name != '收回'">
<h2>当前流程是否收回,请确认</h2>
</div>
<group invisible="node_btn_name != '分发'">
<field name="employee_ids" widget="many2many_tags" string="董事长" domain="[('user_role_id.name', '=', '董事长')]" options="{'no_create': True}" groups="yuthon_salary.group_jtbb_user"/>
<!-- 分发弹窗:本公司开关控制人员筛选范围 -->
<field name="is_this_company"/>
<field name="dep_manager_employee_ids" widget="many2many_tags" string="承办" options="{'no_create': True}" domain="[('company_id', '=', company_id)] if is_this_company else []" context="{'select_dialog': 'list'}"/>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)] if is_this_company else [('id', 'not in' , filter_personnel_ids)]" context="{'select_dialog': 'list'}"/>
<field name="supervising_employee_ids" widget="many2many_tags" invisible="not is_supervising" options="{'no_create': True}" context="{'select_dialog': 'list'}"/>
<group invisible="node_btn_name != '分发'" col="1">
<group>
<field name="employee_ids" widget="many2many_tags" string="董事长" domain="[('user_role_id.name', '=', '董事长')]" options="{'no_create': True}" groups="yuthon_salary.group_jtbb_user"/>
</group>
<group>
<!-- 分发弹窗:本公司开关控制人员筛选范围 -->
<field name="is_this_company"/>
</group>
<group>
<field name="dep_manager_employee_ids" widget="many2many_tags" string="承办" options="{'no_create': True}" domain="[('company_id', '=', company_id)] if is_this_company else []"/>
</group>
<group>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)] if is_this_company else [('id', 'not in' , filter_personnel_ids)]"/>
</group>
<group>
<field name="supervising_employee_ids" widget="many2many_tags" invisible="not is_supervising" options="{'no_create': True}"/>
</group>
</group>
<footer>
<button name="add_comment" string="确认" type="object" class="oe_highlight"/>
+2 -4
View File
@@ -85,11 +85,9 @@ class YuThonPhone(http.Controller):
user_id = request.env['res.users'].sudo().browse(kw.get('employee'))
employee_id = user_id.with_company(user_id.company_id.id).employee_id
applet_security_setting_ids = request.env['applet.security'].sudo().search([('employee_id', '=', employee_id.id)]).applet_security_setting_ids
task_ids = request.env['yuthon.will.task'].sudo().search([('users_ids', 'in', [user_id])])
data = [{
'日程': 5,
'抄表': 10,
'OA': 0,
'工作流': 10,
'日程': len(task_ids),
}]
return json.dumps({'data': data, 'code': 200, 'message': ''})
@@ -5,6 +5,7 @@ from datetime import date, timedelta
class YuthonOvertimeReport(models.Model):
_name = 'yuthon.holiday.statement'
class InheritHrLeave(models.Model):
_inherit = 'hr.leave'
_description = '请假情况'
@@ -63,13 +63,7 @@ class CurrentReceivableRentReport(models.Model):
for idx, rec in enumerate(receivables, start=1):
amt = rec.original_amount or 0.0
# 从property.rent.list中获取税率
rent_list = self.env['property.rent.list'].search([
('lessee_id', '=', rec.lessee_id.id if rec.lessee_id else False),
('property_id', 'in', rec.property_ids.ids if rec.property_ids else []),
('due_date', '=', rec.due_date),
], limit=1)
tax_rate = rent_list.tax if rent_list else (rec.tax or 0.0)
tax_rate = rec.tax or 0.0
amt_nt = amt / (1 + tax_rate / 100) if tax_rate else amt
total_amount += amt
total_amount_nt += amt_nt
@@ -1,4 +1,4 @@
/** @odoo-module1 **/
/** @odoo-module **/
import {registry} from "@web/core/registry";
@@ -158,6 +158,14 @@ class ReceivableReport extends Component {
async onUpdateCompany(v) {
console.log(v)
// 检查v是否为空或v[0]不存在
if (!v || !v[0]) {
this.state.selectCompany = {};
this.state.selectPartner = {};
this.state.domainUsers = [];
await this.onSearch();
return;
}
// 执行一次 查询
// 通过 read 重新查询一次, 更多只返回了 id
let values = await this.serviceOrm.call(
@@ -51,9 +51,11 @@
</div>
<div class="col">
<select id="formview_default_conditions" class="o_input" t-model="state.condition" t-on-change="onChangeCondition">
<option value="">权属类型</option>
<option t-foreach="state.conditions" t-as="cond"
t-att-value="cond.value"
t-key="cond.name">
t-key="cond.name"
t-if="cond.value">
<t t-esc="cond.name"/>
</option>
</select>
@@ -23,4 +23,9 @@
}
.stat-change {
font-size: 0.9rem;
}
/* 下拉框placeholder样式 */
#formview_default_conditions option[value=""] {
color: #6c757d;
}
+5 -5
View File
@@ -66,16 +66,16 @@ class YuthonWillTask(http.Controller):
users_id = int(kw.get('users_id'))
user = request.env['res.users'].sudo().browse(int(users_id))
employee_id = user.with_company(user.company_id.id).employee_id.id
records = request.env['hr.payslip'].sudo().search([('employee_id', '=', employee_id)])
records = request.env['yuthon.salary.active'].sudo().search([('employee_id', '=', employee_id)])
data = {}
for record in records:
year = record.date_from.year
month = record.date_from.month
year = int(record.select_year)
month = int(record.select_time)
if year not in data.keys():
data[year] = {'total': 0}
if month not in data[year].keys():
data[year][month] = {'total': record.actual_salary}
data[year]['total'] += record.actual_salary
data[year][month] = {'total': record.actual_paid_salary}
data[year]['total'] += record.actual_paid_salary
return json.dumps({'data': data, 'code': 200, 'message': ''})
@http.route('/phone/salary/self/detail', type='http', auth="none", csrf=False, cors='*')
+10 -6
View File
@@ -73,12 +73,10 @@ class YuthonWillTask(http.Controller):
@http.route('/will/task/list', methods=['POST'], type='http', auth='public', csrf=False)
def will_task_list(self, **kwargs):
employee_id = request.env['hr.employee'].search([('user_id', '=', int(kwargs.get('users_id')))])
start = kwargs.get('start')
request_hour_selection = request.env['yuthon.will.task'].sudo().fields_get(allfields=['request_hour_from'])['request_hour_from']['selection']
result_list = []
# task_ids = request.env['yuthon.will.task'].sudo().search([], offset=start, limit=20)
task_ids = request.env['yuthon.will.task'].sudo().search(['|', ('employee_ids', 'in', employee_id.id), ('employee_id.id', '=', employee_id.id)], offset=start, limit=20)
task_ids = request.env['yuthon.will.task'].sudo().search([('users_ids', 'in', [int(kwargs.get('users_id'))])], offset=start, limit=20)
for task in task_ids:
weekday_str = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"][task.start_date.weekday()]
result = {
@@ -123,15 +121,21 @@ class YuthonWillTask(http.Controller):
'id': task.id,
'name': task.name,
'employee_id': task.employee_id.name,
'employee_ids': ', '.join(task.employee_ids.mapped('name')),
'employee_ids': ','.join(task.employee_ids.mapped('name')),
'employee_ids2': ','.join(task.employee_ids2.mapped('name')),
'task_time_ids': ','.join(task.task_time_ids.mapped('name')),
'drivers': task.employee_ids2.read(['name']),
'employee': task.employee_ids.read(['name']),
'task_time': task.task_time_ids.read(['name']),
'employee_num': len(task.employee_ids),
'start_date': fields.Date.to_string(task.start_date),
'weekday': weekday_str,
'request_hour_from': '',
'request_hour_to': '',
'request_hour_from': task.request_hour_from,
'request_hour_to': task.request_hour_to,
'remarks': task.remarks,
'address': task.address,
'file_list': file_list,
'priority': task.priority,
}
hour_dict = dict(request_hour_selection)
+2 -2
View File
@@ -757,7 +757,7 @@
<menuitem id="menu_soong_workflow_department_record" name="流程查询" action="soong_workflow.soong_workflow_department_record_action" sequence="15"/>
<menuitem id="menu_soong_workflow_done_record" name="已办流程" action="soong_workflow.soong_workflow_record_done_action" sequence="20"/>
<menuitem id="menu_workflow_approval_request_admin" name="流程监控" action="soong_workflow.soong_workflow_record_action_admin" sequence="25"/>
<menuitem id="menu_soong_workflow_hr_employee" name="人力资源流程" action="soong_workflow.soong_workflow_hr_employee_action" sequence="30"/>
<menuitem id="menu_soong_workflow_hr_employee" name="人力资源流程" action="soong_workflow.soong_workflow_hr_employee_action" sequence="30" groups="soong_workflow.group_soong_workflow_hr"/>
<menuitem id="yuthon_file_processing_menu" name="文件处理" action="yuthon_official.yuthon_file_processing_action" sequence="35"/>
<menuitem id="yuthon_sub_enterprises" name="文件处理(子企业)" action="yuthon_official.view_yuthon_sub_enterprises_action" sequence="40"/>
<menuitem id="yuthon_notice_menu1_board" name="通知公告" action="yuthon_notice.approval_notice_action" sequence="45"/>
@@ -767,7 +767,7 @@
<menuitem id="menu_hr_attendance_my_record_board" name="我的考勤" action="yuthon_hr_attendance.hr_attendance_action1" sequence="65"/>
<menuitem id="menu_hr_attendance_my_abnormal_board" name="我的异常" action="yuthon_hr_attendance.hr_attendance_my_abnormal" sequence="70"/>
<menuitem id="yuthon_vacation_reports_my" name="考勤确认单" action="yuthon_hr_attendance.action_server_open_my_vacation_form1" sequence="75"/>
<menuitem id="yuthon_salary_active_my1" name="工资条" action="yuthon_salary.yuthon_salary_active_my_action" sequence="80"/>
<menuitem id="yuthon_salary_active_my2" name="工资条" action="yuthon_salary.yuthon_salary_active_my_action" sequence="80"/>
<menuitem id="yuthon_meal_expenses_my_board" name="餐费" action="yuthon_salary.view_my_yuthon_meal_expenses_action" sequence="85"/>
<menuitem id="property_device_repair_action_brand" name="报事报修" action="yuthon_maintain.property_device_repair_action" sequence="90"/>
<menuitem id="property_device_repair_action_brand_all" name="报事报修(管理员)" action="yuthon_maintain.property_device_repair_all_action" groups="base.group_system" sequence="95"/>