From 1e9906323a9048c368fdafd92a827367c9ec81d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 7 Aug 2025 15:07:39 +0800 Subject: [PATCH 1/4] 1 --- .../controllers/applet_attendance.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 1772bd59e..97dbb14a5 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -24,15 +24,11 @@ class AppletAttendance(Controller): _logger.info("----------------/ro/base/user/login/v1---------接口收到响应-------") password = kw.get('password') login = kw.get('login') - try: uid = request.session.authenticate(request.env.cr.dbname, login, password) except Exception as e: _logger.info(f"接口登录失败: {e}") - # 测试 - # 校验手机号是否存在于承租方. - property_tenant_information = request.env['property.tenant.information'].sudo().search( - [('phone', '=', login)]) + property_tenant_information = request.env['property.tenant.information'].sudo().search([('phone', '=', login)]) if not property_tenant_information: return_data = {'data': {}, 'code': 401, 'message': '用户名或密码错误'} else: @@ -726,6 +722,7 @@ class AppletAttendance(Controller): @route('/yuthon/peoperty/accounts/receivable', methods=['POST'], type='http', auth='none', cors='*', csrf=False) def yuthon_peoperty_accounts_receivable(self, **kw): + _logger.info("-----/yuthon/peoperty/accounts/receivable---------接口收到请求-----") phone = kw.get('phone') if not phone: return json.dumps({ @@ -733,11 +730,6 @@ class AppletAttendance(Controller): 'code': '400', 'message': '请输入手机号' }) - - # 查询该手机号的最近3个月的数据 - # 先查询承租方 - # 查询最近三个月(计算出从现在前3个月的月初,不需要合并查询,只要查询3个月记录即可) - # 未收合计 lessee_records = request.env(user=SUPERUSER_ID)['property.tenant.information'].search([('phone', '=', phone)]) if not lessee_records: return json.dumps({ From 7b74fbde22d62847055355ca21681e3f6080e0b4 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 8 Aug 2025 10:09:26 +0800 Subject: [PATCH 2/4] =?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/inherit_yuthon_property.py | 4 ++-- .../views/property_lease_contract.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 7f46c2fc4..89c1b3fe0 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -543,7 +543,7 @@ class PropertyRentList(models.Model): # 处理合同月 if contract.cycle_mode == 'fixed_monthly': # 计算理论应收结束日(当月最后一天) - next_month_first = (due_date_obj.replace(day=1) + timedelta(days=32)).replace(day=1) + next_month_first = (due_date_obj+ relativedelta(months=1)) theoretical_end = next_month_first - timedelta(days=1) # 处理自然月 elif contract.cycle_mode == 'floating_monthly': @@ -599,7 +599,7 @@ class PropertyRentList(models.Model): # 处理合同月 if contract.cycle_mode == 'fixed_monthly': # 计算理论应收结束日(当月最后一天) - next_month_first = (due_date_obj.replace(day=1) + timedelta(days=32)).replace(day=1) + next_month_first = (due_date_obj+ relativedelta(months=1)) theoretical_end = next_month_first - timedelta(days=1) # 处理自然月 elif contract.cycle_mode == 'floating_monthly': diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 579f1ecdc..82a74eb24 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -561,16 +561,16 @@