From a841e33196ee832966f638efb7825079d02f1ab3 Mon Sep 17 00:00:00 2001
From: ONION <2275333053@qq.com>
Date: Sat, 13 Jul 2024 19:36:22 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=94=B6=E5=8F=91=E6=96=87=E6=A8=A1?=
=?UTF-8?q?=E5=9D=971.2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_official/models/official_category.py | 2 +-
yuthon_official/models/yuthon_official.py | 2 +-
yuthon_official/views/yuthon_official_views.xml | 5 ++---
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/yuthon_official/models/official_category.py b/yuthon_official/models/official_category.py
index 4470ef340..d7629bcb6 100644
--- a/yuthon_official/models/official_category.py
+++ b/yuthon_official/models/official_category.py
@@ -34,5 +34,5 @@ class ApprovalRequest(models.Model):
main_flats = fields.Char(string="主送")
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级")
- date = fields.Datetime(string="日期")
+ date = fields.Datetime(string="日期", default=fields.Datetime.now)
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index e025105ea..a7601a085 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -32,7 +32,7 @@ class YuthonOfficial(models.Model):
servings_number = fields.Integer(string="份数")
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级")
- date = fields.Datetime(string="日期")
+ date = fields.Datetime(string="日期",default=fields.Datetime.now)
department_id = fields.Many2one('hr.department', string="申请人部门")
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态")
diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml
index b0ac299ba..09176c7ed 100644
--- a/yuthon_official/views/yuthon_official_views.xml
+++ b/yuthon_official/views/yuthon_official_views.xml
@@ -42,7 +42,7 @@
-
+
-
+
Date: Sun, 14 Jul 2024 18:56:50 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=20?=
=?UTF-8?q?=E5=91=98=E5=B7=A5=E5=88=9B=E5=BB=BA=E7=94=A8=E6=88=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_wechat/views/hr_employee_views.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yuthon_wechat/views/hr_employee_views.xml b/yuthon_wechat/views/hr_employee_views.xml
index af18907a7..1c7df68d0 100644
--- a/yuthon_wechat/views/hr_employee_views.xml
+++ b/yuthon_wechat/views/hr_employee_views.xml
@@ -41,9 +41,9 @@
hr.department
-
+
@@ -56,7 +56,7 @@
From c7f4633d83e15d353d5a2d3f2ef516d2b82bd168 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
Date: Sun, 14 Jul 2024 19:16:46 +0800
Subject: [PATCH 3/3] =?UTF-8?q?ljm=20=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=20=E9=83=A8=E9=97=A8=E6=9B=B4=E6=96=B0=E6=96=B0=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_wechat/models/hr_employee.py | 4 +++-
yuthon_wechat/models/wecom_apps.py | 2 +-
yuthon_wechat/views/hr_employee_views.xml | 6 +++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/yuthon_wechat/models/hr_employee.py b/yuthon_wechat/models/hr_employee.py
index 1017d4d77..2bb3d866b 100644
--- a/yuthon_wechat/models/hr_employee.py
+++ b/yuthon_wechat/models/hr_employee.py
@@ -25,11 +25,13 @@ class HrDepartment(models.Model):
wecom_department_id=record.wecom_id,
name=record.name,
name_en=record.wecom_name_en,
- parentid=record.wecom_parent_id,
+ parentid=record.wecom_parent_id if record.wecom_parent_id else record.parent_id.wecom_id,
)
if not result_status:
sync_flag = False
sync_content = sync_content + record.name + ":" + result_content + ";\n"
+ else:
+ record.wecom_id = result_content.get("id", 0)
if not sync_flag:
raise UserError(str(sync_content))
diff --git a/yuthon_wechat/models/wecom_apps.py b/yuthon_wechat/models/wecom_apps.py
index 1ba7f7952..88c1812ed 100644
--- a/yuthon_wechat/models/wecom_apps.py
+++ b/yuthon_wechat/models/wecom_apps.py
@@ -129,5 +129,5 @@ class WeComApps(models.Model):
else:
result_data = self.sync_function_api("user_create", "DEPARTMENT_CREATE", data)
if result_data.get("errcode", None) == 0:
- return True, result_data.get("errmsg", "")
+ return True, result_data
return False, result_data.get("errmsg", "")
diff --git a/yuthon_wechat/views/hr_employee_views.xml b/yuthon_wechat/views/hr_employee_views.xml
index 1c7df68d0..3acf4b225 100644
--- a/yuthon_wechat/views/hr_employee_views.xml
+++ b/yuthon_wechat/views/hr_employee_views.xml
@@ -41,11 +41,15 @@
hr.department
-
+
+
+
+
+