From 4d4121b3b5077cab3b066ab3d56e2ab70814111f Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 15 Aug 2025 18:24:15 +0800 Subject: [PATCH 01/10] =?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 --- yuthon_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index d67d5687a..47010b6fb 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -139,7 +139,7 @@ class HrAttendanceDetail(models.Model): checkin_times = sorted(attendance_records.mapped('checkin_time')) check_in = checkin_times[0] if len(checkin_times) == 1: - check_out = 0 + check_out = None else: check_out = checkin_times[-1] if check_in is not None: From dbb53043b21f65c34032bdf191ba8a547935b729 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 15 Aug 2025 18:38:55 +0800 Subject: [PATCH 02/10] =?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 --- .../models/hr_attendance_detail_wechat.py | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 47010b6fb..d09b5d27e 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -122,37 +122,9 @@ class HrAttendanceDetail(models.Model): attendance.check_in = record.checkin_time attendance.check_out = record.checkin_time else: - local_start = datetime.combine(checkin_date, datetime.min.time()) - local_end = local_start + timedelta(days=1) - utc_start = local_start - timedelta(hours=8) - utc_end = local_end - timedelta(hours=8) - domain = [ - ("exception_type", "!=", "未打卡"), - ('employee_id', '=', record.employee_id.id), - ('checkin_time', '>=', fields.Datetime.to_string(utc_start)), - ('checkin_time', '<', fields.Datetime.to_string(utc_end)) - ] - check_in = None - check_out = None - attendance_records = self.env['hr.attendance.detail'].search(domain) - if attendance_records: - checkin_times = sorted(attendance_records.mapped('checkin_time')) - check_in = checkin_times[0] - if len(checkin_times) == 1: - check_out = None - else: - check_out = checkin_times[-1] - if check_in is not None: - attendance.create({ - 'employee_id': record.employee_id.id, - 'check_in': check_in, - 'check_out': check_out, - 'current_data': checkin_date, - }) - - # now_time = fields.Datetime.to_datetime(checkin_date) + timedelta(hours=8, days=1) - # start_time = now_time - timedelta(days=2) - # self.env["hr.attendance.detail"].get_hr_attendance_time(record.employee_id, now_time, start_time) + now_time = fields.Datetime.to_datetime(checkin_date) + timedelta(hours=8, days=1) + start_time = now_time - timedelta(days=2) + self.env["hr.attendance.detail"].get_hr_attendance_time(record.employee_id, now_time, start_time) From cdcfbe683bd9d17c025b02dc0d1f1977c854edc2 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 15:52:34 +0800 Subject: [PATCH 03/10] =?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 --- .../wizard/property_reconciliation_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index bb2c45a55..54fb651aa 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -249,7 +249,7 @@ class PropertyReconciliationWizard(models.Model): 'property_id': line.property_id.id, 'contract_id': line.contract_id.id, 'delivered1': line.amount, - 'payout_date': self.actual_date, + 'payout_date': rec.actual_date if (line.rent == line.amount and line.rent != 0) else None, 'original_amount': line.rent, 'remark': line.remake, 'reconciliation_time': fields.Datetime.now(), From ea8a5daa1f533588b611ae61ea45a988c42c43b5 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:07:49 +0800 Subject: [PATCH 04/10] =?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 --- .../views/property_menu_all.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/yuthon_property_approval/views/property_menu_all.xml b/yuthon_property_approval/views/property_menu_all.xml index ff3e26381..a7c19db62 100644 --- a/yuthon_property_approval/views/property_menu_all.xml +++ b/yuthon_property_approval/views/property_menu_all.xml @@ -367,4 +367,21 @@ + + + \ No newline at end of file From 326c8c5e651b6e63ec24580b3cc37de362a3822b Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:17:09 +0800 Subject: [PATCH 05/10] =?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/applet_attendance.py | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index b145c0f8a..c4b8c7adc 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -849,12 +849,25 @@ class AppletAttendance(Controller): 'code': 400, 'message': '参数不完整' }) - request.env['wifi.message'].sudo().create({ - 'mac': mac, - 'name': name, - 'bssid': bssid, - 'company_id': company_id - }) + + wifi_message = request.env['wifi.message'].sudo().search([ + ('mac', '=', mac), + ('bssid', '=', bssid), + ('company_id', '=', company_id) + ], limit=1) + + if wifi_message: + wifi_message.sudo().write({ + 'name': name, + }) + else: + request.env['wifi.message'].sudo().create({ + 'mac': mac, + 'name': name, + 'bssid': bssid, + 'company_id': company_id + }) + return json.dumps({ 'code': 200, 'message': '成功' @@ -885,14 +898,27 @@ class AppletAttendance(Controller): 'code': 400, 'message': '参数不完整' }) - request.env['applet.address'].sudo().create({ - 'address_name': address_name, - 'address_name2': address_name2, - 'longitude': longitude, - 'latitude': latitude, - 'card_rice': card_rice, - 'company_id': company_id - }) + applet_address = request.env['applet.address'].sudo().search([ + ('address_name', '=', address_name), + ('longitude', '=', longitude), + ('latitude', '=', latitude), + ('company_id', '=', company_id) + ], limit=1) + + if applet_address: + applet_address.sudo().write({ + 'address_name2': address_name2, + 'card_rice': card_rice, + }) + else: + request.env['applet.address'].sudo().create({ + 'address_name': address_name, + 'address_name2': address_name2, + 'longitude': longitude, + 'latitude': latitude, + 'card_rice': card_rice, + 'company_id': company_id + }) return json.dumps({ 'code': 200, 'message': '成功' From 81763af154858367c5a78488cc7ca39b78dd9c34 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:24:03 +0800 Subject: [PATCH 06/10] =?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 --- yuthon_hr_attendance/controllers/applet_attendance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index c4b8c7adc..0f8c15f82 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -69,6 +69,7 @@ class AppletAttendance(Controller): """ _logger.info("----------------/yuthon/att/today---------接口收到响应-------------------------------") current_date = fields.Date.today() + timedelta(hours=8) + _logger.info(f'当前时间{current_date}') user_id = request.env(user=SUPERUSER_ID)["res.users"].search([('id', '=', int(kw['user_id']))]) employee_id = request.env(user=SUPERUSER_ID)["hr.employee"].search([('name', '=', user_id.name)]) attendance_id = request.env(user=SUPERUSER_ID)["hr.attendance"].search( From d13bff9a9ca86269c390c7bd9a3244ee3854e868 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:28:49 +0800 Subject: [PATCH 07/10] =?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 --- yuthon_hr_attendance/controllers/applet_attendance.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 0f8c15f82..551f37b7f 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -68,8 +68,15 @@ class AppletAttendance(Controller): } """ _logger.info("----------------/yuthon/att/today---------接口收到响应-------------------------------") - current_date = fields.Date.today() + timedelta(hours=8) - _logger.info(f'当前时间{current_date}') + current_datetime = fields.Datetime.now() + timedelta(hours=8) + + # 转换为字符串格式以便日志显示 + current_datetime_str = fields.Datetime.to_string(current_datetime) + current_date_str = fields.Date.to_string(current_datetime.date()) + + # 日志输出 + _logger.info(f'当前完整时间(含8小时偏移):{current_datetime_str}') + _logger.info(f'当前日期(含8小时偏移):{current_date_str}') user_id = request.env(user=SUPERUSER_ID)["res.users"].search([('id', '=', int(kw['user_id']))]) employee_id = request.env(user=SUPERUSER_ID)["hr.employee"].search([('name', '=', user_id.name)]) attendance_id = request.env(user=SUPERUSER_ID)["hr.attendance"].search( From 418707f8e3bcc1e67632303e859c4d107e62d20c Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:32:58 +0800 Subject: [PATCH 08/10] =?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 --- yuthon_hr_attendance/controllers/applet_attendance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 551f37b7f..19f4540ec 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -69,6 +69,7 @@ class AppletAttendance(Controller): """ _logger.info("----------------/yuthon/att/today---------接口收到响应-------------------------------") current_datetime = fields.Datetime.now() + timedelta(hours=8) + current_date = fields.Date.today() + timedelta(hours=8) # 转换为字符串格式以便日志显示 current_datetime_str = fields.Datetime.to_string(current_datetime) From cf7f6002d5c05046ad252ec1cab7cac8ea0900ab Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 16:48:28 +0800 Subject: [PATCH 09/10] =?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/home.py | 1 + yuthon_purchase/models/__init__.py | 3 ++- yuthon_purchase/models/inherit_purchase_order.py | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 yuthon_purchase/models/inherit_purchase_order.py diff --git a/sh_backmate_theme_adv_enterprise/controllers/home.py b/sh_backmate_theme_adv_enterprise/controllers/home.py index fab4f2328..4af9a6013 100644 --- a/sh_backmate_theme_adv_enterprise/controllers/home.py +++ b/sh_backmate_theme_adv_enterprise/controllers/home.py @@ -17,6 +17,7 @@ from odoo.addons.web.controllers.home import Home as WebHome MENU_BADGE_MODEL_FUNC_ENUM = { 'base.menu_action_res_users': {'model': 'file.preview.test', 'func': 'get_menu_badge_count'}, 'yuthon_notice.yuthon_notice_menu1': {'model': 'yuthon.notice', 'func': 'get_no_read_count'}, + 'purchase.purchase_order_view_tree': {'model': 'purchase.order', 'func': 'get_no_read_count'}, 'yuthon_property.yuthon_property_rent_list': {'model': 'property.rent.list', 'func': 'get_no_read_count'}, 'yuthon_property.yuthon_property_management_list': {'model': 'property.management.list', 'func': 'get_no_read_count'}, 'yuthon_property.yuthon_property_tariff_list': {'model': 'property.tariff.list', 'func': 'get_no_read_count'}, diff --git a/yuthon_purchase/models/__init__.py b/yuthon_purchase/models/__init__.py index 28bd0f1b4..8ba4ff994 100644 --- a/yuthon_purchase/models/__init__.py +++ b/yuthon_purchase/models/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- from . import purchase_fixed_assets from . import purchase_low_orders -from . import purchase_service_orders \ No newline at end of file +from . import purchase_service_orders +from . import inherit_purchase_order \ No newline at end of file diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py new file mode 100644 index 000000000..c2b513f7d --- /dev/null +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models + + +class InheritPurchaseOrder(models.Model): + _inherit = 'purchase.order' + + def get_no_read_count(self): + domain = [ + ('company_id', '=', self.env.user.company_id.id), + ] + return self.search_count(domain) + From 6b7105ab2b668149e86a87fea640f808f71707ce Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 16 Aug 2025 17:58:31 +0800 Subject: [PATCH 10/10] =?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 --- .../views/property_lease_contract.xml | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index d3c4282c9..a2668a6f9 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -36,10 +36,13 @@ invisible="condition != 'approval'"/> - + + + + @@ -65,7 +68,7 @@ - + @@ -85,7 +88,7 @@ - + @@ -98,7 +101,7 @@ - + @@ -240,7 +243,7 @@ - + @@ -253,7 +256,7 @@ - + @@ -299,7 +302,7 @@ - + @@ -331,7 +334,7 @@ - + @@ -424,13 +427,16 @@ invisible="condition != 'expired'"/> - + + + + @@ -450,22 +456,21 @@ - - + + -