Merge pull request !2482 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-04-15 03:44:49 +00:00
committed by Gitee
5 changed files with 17 additions and 14 deletions
+7 -4
View File
@@ -15,13 +15,13 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='paperformat_id']" position="after">
<field name="template_docx"
invisible="report_type not in ['docx']" />
invisible="report_type not in ['docx']" string="报表模板"/>
<field name="out_report_type"
invisible="report_type not in ['docx']" />
invisible="report_type not in ['docx']" string="输出报告类型"/>
<field name="python_function_prepare"/>
<field name="python_function_name" invisible="python_function_prepare == False" />
<field name="python_function_prepare" string="是否用Python代码"/>
<field name="python_function_name" invisible="python_function_prepare == False" string="Python代码"/>
<field name="path_source"
invisible="report_type not in ['docx'] or out_report_type in ['docx']" />
<field name="path_convert_folder"
@@ -37,6 +37,9 @@
<p>Change rights and give all users access + writing to the directory you want the documents to be saved in: /tmp/backups</p>
</div>
</xpath>
<xpath expr="//field[@name='report_type']" position="attributes">
<attribute name="string">报表类型</attribute>
</xpath>
</field>
</record>
</data>
@@ -86,9 +86,9 @@ class SoongWorkflowRecord(models.Model):
# 催办
def reminders_record(self):
record_id = self.env[self.res_model].search([('id', '=', self.res_id)])
url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.res_model, record_id.id)
for rec in record_id.log_ids:
if rec.approval_state in ['0', '1']:
url = f'https://oa.thtzjt.com/web?oauth_access_token={rec.done_by.employee_id.user_id.oauth_access_token}&oauth_uid={rec.done_by.employee_id.user_id.oauth_uid}#id={self.id}&cids=2&action={record_id.action.id}&model={self.res_model}&view_type=from&menu_id={record_id.id}'
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(fields.Datetime.now() + timedelta(hours=8))
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=rec.done_by.employee_id.wecom_userid,
title=record_id._description + '催办传阅/抄送,请尽快处理',
@@ -96,6 +96,7 @@ class SoongWorkflowRecord(models.Model):
btntxt="查看详情")
for rec in record_id.log_ids2:
if rec.approval_state == '0':
url = f'https://oa.thtzjt.com/web?oauth_access_token={rec.done_by.employee_id.user_id.oauth_access_token}&oauth_uid={rec.done_by.employee_id.user_id.oauth_uid}#id={self.id}&cids=2&action={record_id.action.id}&model={self.res_model}&view_type=from&menu_id={record_id.id}'
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(fields.Datetime.now() + timedelta(hours=8))
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=rec.done_by.employee_id.wecom_userid,
title=record_id._description + '催办传阅/抄送,请尽快查看',
@@ -171,7 +171,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_btn_id": self.node_btn_id.id,
"approval_state": "0",
})
url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.res_model, record_id.id)
url = f'https://oa.thtzjt.com/web?oauth_access_token={employee.user_id.oauth_access_token}&oauth_uid={employee.user_id.oauth_uid}#id={self.id}&cids=2&action={record_id.action.id}&model={self.res_model}&view_type=from&menu_id={record_id.id}'
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(
fields.Datetime.now() + timedelta(hours=8))
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
@@ -248,7 +248,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_btn_id": self.node_btn_id.id,
"approval_state": "0",
})
url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.res_model, record_id.id)
url = f'https://oa.thtzjt.com/web?oauth_access_token={employee.user_id.oauth_access_token}&oauth_uid={employee.user_id.oauth_uid}#id={self.id}&cids=2&action={record_id.action.id}&model={self.res_model}&view_type=from&menu_id={record_id.id}'
description = "标题: {}\n".format(record_id.name) + self.env.user.name + ' ' + str(
fields.Datetime.now() + timedelta(hours=8))
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
@@ -264,8 +264,8 @@ class SoongWorkflowCommentWizard(models.TransientModel):
log_ids[-1].unlink()
log_ids[-2].write({'approval_state': '1'})
record_id.write({'state': log_ids[-2].name})
url = 'https://oa.thtzjt.com/mail/view?model={}&res_id={}'.format(self._name, record_id.id)
for employee in self.employee_ids:
url = f'https://oa.thtzjt.com/web?oauth_access_token={employee.user_id.oauth_access_token}&oauth_uid={employee.user_id.oauth_uid}#id={self.id}&cids=2&action={record_id.action.id}&model={self._name}&view_type=from&menu_id={record_id.id}'
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
user_id=employee.wecom_userid,
title=self._description,
+4 -5
View File
@@ -96,10 +96,10 @@ class HrAttendance(models.Model):
is_early_card += 1
if i.is_no_card:
is_late_card += 1
str = 'https://oa.thtzjt.com/web#action={}&model=hr.attendance&view_type=list&cids=1&menu_id={}'.format(action_id.id, menu_id.id)
url = f'https://oa.thtzjt.com/web?oauth_access_token={rec.employee_id.user_id.oauth_access_token}&oauth_uid={rec.employee_id.user_id.oauth_uid}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.attendance&view_type=from&menu_id={menu_id.id}'
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att', user_id=rec.employee_id.wecom_userid,
title="打卡异常提醒", description="本月迟到: {}\n本月缺卡: {}\n本月早退: {}\n".format(is_late_card, is_no_card, is_early_card),
url=str, btntxt="详细信息")
url=url, btntxt="详细信息")
def button_leave(self):
form_id = self.env.ref('yuthon_holiday.view_hr_leave_batch_form').id
@@ -275,12 +275,11 @@ class HrAttendance(models.Model):
employee_ids = self.env['hr.employee'].search([('department_id.name', '=', '办公室')])
menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的异常')])
for employee_id in employee_ids:
str = 'https://oa.thtzjt.com/web#action={}&model=hr.attendance&view_type=list&cids=1&menu_id={}'.format(
menu_id.action_id.id, menu_id.id)
url = f'https://oa.thtzjt.com/web?oauth_access_token={employee_id.user_id.oauth_access_token}&oauth_uid={employee_id.user_id.oauth_uid}#id={self.id}&cids=2&action={menu_id.action.id}&model=hr.attendance&view_type=from&menu_id={menu_id.id}'
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='att',
user_id=employee_id.wecom_userid,
title="打卡异常提醒", description="异常提醒",
url=str, btntxt="详细信息")
url=url, btntxt="详细信息")
# 保安部 - 白班
def ba_card_white_up(self):
@@ -36,7 +36,7 @@ class PropertyTenantLine(models.Model):
class PropertyLeaseContract(models.Model):
_name = 'property.lease.contract'
_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 = 'contract_code'
name = fields.Char(string='物业信息')