From 9b32c5957da4a76dbcd0c2cc4b6289c1f7799ca2 Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Thu, 7 Nov 2024 17:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/employee_login.py | 20 ++++++++++++++++--- .../views/website_employee_views.xml | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/yuthon_hr_employee_approval/controllers/employee_login.py b/yuthon_hr_employee_approval/controllers/employee_login.py index 921d6e2f9..1875192bf 100644 --- a/yuthon_hr_employee_approval/controllers/employee_login.py +++ b/yuthon_hr_employee_approval/controllers/employee_login.py @@ -17,11 +17,25 @@ class EmployeeLogin(Controller): values['employee_id'] = int(employee_id) record = request.env['yuthon.message.login'].sudo().browse(values['employee_id']) values['staff_name'] = record.staff_name + values['political'] = record.political + values['email'] = record.email + values['home_address'] = record.home_address + values['sex'] = record.sex + values['date_birth'] = record.date_birth.strftime('%Y/%m/%d') + values['party_time'] = record.party_time.strftime('%Y/%m/%d') + values['marital_status'] = record.marital_status + values['working_time'] = record.working_time.strftime('%Y/%m/%d') + values['home_phone'] = record.home_phone + values['origin'] = record.origin + values['nation'] = record.nation + values['house_type'] = 'city' + values['current_address'] = record.current_address + values['house_hold'] = record.house_hold if request.httprequest.method == 'POST': if "staff_name" in values and values.get("staff_name", ""): record.staff_name = values.get("staff_name", "") if "political" in values and values.get("political", ""): - record.political = values.get("political", "") + record.political = values.get("political") if values.get("political") != "" else False if "phone" in values and values.get("phone", ""): record.phone = values.get("phone", "") if "email" in values and values.get("email", ""): @@ -37,7 +51,7 @@ class EmployeeLogin(Controller): party_time = values.get("party_time", "") record.party_time = datetime.strptime(party_time, '%Y-%m-%d').date() if "marital_status" in values and values.get("marital_status", ""): - record.marital_status = values.get("marital_status", "") + record.marital_status = values.get("marital_status") if values.get("marital_status") != "" else False if "working_time" in values and values.get("working_time", ""): working_time = values.get("working_time", "") record.working_time = datetime.strptime(working_time, '%Y-%m-%d').date() @@ -48,7 +62,7 @@ class EmployeeLogin(Controller): if "nation" in values and values.get("nation", ""): record.nation = values.get("nation", "") if "house_type" in values and values.get("house_type", ""): - record.house_type = values.get("house_type", "") + record.house_type = values.get("house_type") if values.get("house_type") != "" else False if "current_address" in values and values.get("current_address", ""): record.current_address = values.get("current_address", "") if "house_hold" in values and values.get("house_hold", ""): diff --git a/yuthon_hr_employee_approval/views/website_employee_views.xml b/yuthon_hr_employee_approval/views/website_employee_views.xml index 432a37d62..f0263e6ca 100644 --- a/yuthon_hr_employee_approval/views/website_employee_views.xml +++ b/yuthon_hr_employee_approval/views/website_employee_views.xml @@ -94,7 +94,7 @@
-