From 8965b4c30874b4c07ffb2a0dce9f43ac0b42f557 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Mon, 24 Nov 2025 23:53:59 +0800 Subject: [PATCH] 1 --- yuthon_hr_attendance/controllers/applet_attendance.py | 6 ++---- .../report/contract_accounts_receivable_templates.xml | 3 +-- yuthon_property_approval/wizard/print_payment_wizard.py | 9 +++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index ad8122ac6..c606a2361 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -1035,7 +1035,6 @@ class AppletAttendance(Controller): # 根据楼层,状态(reading, unreading) 类型, 获取 列表数据 @route('/yuthon/meter/reading/list', methods=['POST'], type='http', auth='none', cors='*', csrf=False) def yuthon_meter_reading_list(self, **kw): - _logger.info('/yuthon/meter/reading/list--接口收到相应') reading_state = kw.get('state') type = kw.get('type') floor_id = int(kw.get('floor_id')) @@ -1044,11 +1043,10 @@ class AppletAttendance(Controller): first_day = today.replace(day=1, hour=0, minute=0, second=0, microsecond=0) last_day = (today.replace(day=1) + timedelta(days=32)).replace(day=1) - timedelta(days=1) last_day = last_day.replace(hour=23, minute=59, second=59, microsecond=999999) - first_day_str = first_day.strftime('%Y-%m-%d') last_day_str = last_day.strftime('%Y-%m-%d') - floor_name = request.env['yuthon.epitope.values'].sudo().search([('id', '=', floor_id)]).name + _logger.info(f'楼层{floor_name}') # domain = [('state', '=', reading_state), # ('epitope_values_id.name', '=', floor_name), # ('meter_date', '>=', first_day_str), @@ -1066,7 +1064,7 @@ class AppletAttendance(Controller): domain.append(('water_state', '!=', 'stop')) model = 'meter.water.line' records = request.env[model].sudo().search(domain) - _logger.info(f'任务数据{records}') + # _logger.info(f'任务数据{records}') result = [] for record in records: property_infos = record.yuthon_property_ids if record.yuthon_property_ids else [None] diff --git a/yuthon_property_approval/report/contract_accounts_receivable_templates.xml b/yuthon_property_approval/report/contract_accounts_receivable_templates.xml index 248d728db..dac9186bd 100644 --- a/yuthon_property_approval/report/contract_accounts_receivable_templates.xml +++ b/yuthon_property_approval/report/contract_accounts_receivable_templates.xml @@ -1,7 +1,5 @@ - - + diff --git a/yuthon_property_approval/wizard/print_payment_wizard.py b/yuthon_property_approval/wizard/print_payment_wizard.py index 0d5bb5a3f..aa57639f1 100644 --- a/yuthon_property_approval/wizard/print_payment_wizard.py +++ b/yuthon_property_approval/wizard/print_payment_wizard.py @@ -49,9 +49,7 @@ class PrintPaymentWizard(models.Model): 'is_print': True, }) start_date, end_date = self._get_date_range() - receivable_lines = self.contract_id.receivable_ids.filtered( - lambda line: start_date <= line.due_date <= end_date - ) + receivable_lines = self.contract_id.receivable_ids.filtered(lambda line: start_date <= line.due_date <= end_date) for line in receivable_lines: line.print_date = today line.number +=1 @@ -63,6 +61,5 @@ class PrintPaymentWizard(models.Model): 'line_count': len(receivable_lines), 'total_amount': sum(line.original_amount for line in receivable_lines) } - report_ref = self.env['ir.actions.report'].search([ - ('report_name', '=', 'yuthon_property_approval.report_contract_accounts_receivable')]) - return report_ref.report_action(self, data=report_data) \ No newline at end of file + report_ref = self.env['ir.actions.report'].search([('report_name', '=', 'yuthon_property_approval.report_contract_accounts_receivable')]) + return report_ref.report_action(docids=[self.contract_id.id], data=report_data) \ No newline at end of file