From b61d56aa1b1a1d10a7452d2b36f3ec449b0fcc96 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 19 Jun 2025 21:29:55 +0800
Subject: [PATCH 1/2] =?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/hr_attendance_month_views.xml | 2 +-
.../models/property_accounts_receivable.py | 1 +
.../views/property_accounts_receivable_views.xml | 2 +-
yuthon_property/views/yuthon_property_views.xml | 8 --------
.../models/inherit_yuthon_property.py | 2 +-
.../views/inherit_yuthon_property_views.xml | 15 +++++++++++++--
.../wizard/property_rental_wizard.py | 13 ++++++++++---
yuthon_salary/views/inherit_hr_payslip_views.xml | 4 ++--
8 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/yuthon_hr_attendance/views/hr_attendance_month_views.xml b/yuthon_hr_attendance/views/hr_attendance_month_views.xml
index e0d1d1e16..9930fc09a 100644
--- a/yuthon_hr_attendance/views/hr_attendance_month_views.xml
+++ b/yuthon_hr_attendance/views/hr_attendance_month_views.xml
@@ -69,6 +69,7 @@
+
@@ -105,7 +106,6 @@
-
diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py
index 9e35359e3..e7ef82699 100644
--- a/yuthon_property/models/property_accounts_receivable.py
+++ b/yuthon_property/models/property_accounts_receivable.py
@@ -8,6 +8,7 @@ class PropertyAccountsReceivable(models.Model):
_description = '应收账单'
property_id = fields.Many2one('yuthon.property', string='物业')
+ management_area = fields.Float(related='property_id.management_area', string='面积')
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
admin_id = fields.Many2one(related='property_id.admin_id', string="片区管理员")
company_id = fields.Many2one(related='property_id.company_id', string="公司")
diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml
index 9bd749557..9e30bbfe3 100644
--- a/yuthon_property/views/property_accounts_receivable_views.xml
+++ b/yuthon_property/views/property_accounts_receivable_views.xml
@@ -3,7 +3,7 @@
property.accounts.receivable.tree
property.accounts.receivable
-
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index abd77827b..6c627a1b1 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -280,15 +280,7 @@
-
-
-
-
-
-
-
-
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index c3e1675c5..61fe2dac5 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -414,7 +414,7 @@ class PropertyDepositList(models.Model):
'contract_id': rec.contract_id.id,
'property_id': rec.property_id.id,
'lessee_id': rec.contract_id.lessee_id.id if rec.contract_id.lessee_id else None,
- 'original_amount': rec.aggregate,
+ 'original_amount': rec.original_amount,
'create_time': datetime.now(),
'management_type_id': management_type_id.id,
})
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index 117f3d342..e37cfca8a 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -386,7 +386,7 @@
- 应收列表
+ 应收账单
property.accounts.receivable
tree
{'group_by': 'contract_id'}
@@ -410,6 +410,7 @@
合同应收报表
tree
property.accounts.receivable
+
@@ -438,6 +439,7 @@
违约金明细报表
property.accounts.receivable
tree
+
@@ -458,6 +460,7 @@
本月实收报表
property.accounts.receivable
tree
+
@@ -465,7 +468,14 @@
property.accounts.receivable
-
+
+
+
+
+
+
+
+
@@ -473,6 +483,7 @@
累计欠收报表
property.accounts.receivable
tree
+
批量生成违约金
diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py
index 7cdbd64bf..f5c70e9cb 100644
--- a/yuthon_property_approval/wizard/property_rental_wizard.py
+++ b/yuthon_property_approval/wizard/property_rental_wizard.py
@@ -2,6 +2,8 @@ from odoo import models, fields, api, _, SUPERUSER_ID
from odoo.exceptions import UserError, ValidationError
from dateutil.relativedelta import relativedelta
from datetime import datetime, time, timedelta
+import calendar
+
class PropertyRentalWizard(models.Model):
_name = 'property.rental.wizard'
@@ -158,12 +160,17 @@ class PropertyRentalWizard(models.Model):
def confirm(self):
"""主逻辑入口"""
- records = self.env['property.lease.contract'].search(
- [('cycle_dict', 'in', ['monthly', 'quarter', 'half', 'year'])])
year, month = int(self.select_year), int(self.select_month)
date_field = datetime(year, month, 1).date()
date_field_year_month = date_field.strftime('%Y-%m')
-
+ # 获取当月第一天和最后一天
+ first_day = datetime.strptime(date_field_year_month, '%Y-%m').date() # 当月第一天
+ last_day = (first_day + relativedelta(months=1, days=-1)) # 当月最后一天
+ records = self.env['property.lease.contract'].search([
+ ('cycle_dict', 'in', ['monthly', 'quarter', 'half', 'year']),
+ ('actual_start_time', '<=', last_day),
+ ('actual_end_time', '>=', first_day)
+ ])
for record in records:
date_data = {
'five': 5,
diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml
index cfd8cc07c..2df5d6d10 100644
--- a/yuthon_salary/views/inherit_hr_payslip_views.xml
+++ b/yuthon_salary/views/inherit_hr_payslip_views.xml
@@ -364,6 +364,8 @@
hr.payslip
+
+
@@ -374,8 +376,6 @@
-
-
From 2aadb35429e315cda9ffff98d348845fc442fd54 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Thu, 19 Jun 2025 21:33:52 +0800
Subject: [PATCH 2/2] =?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/inherit_yuthon_property_views.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index e37cfca8a..ae2b401b7 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -390,9 +390,10 @@
property.accounts.receivable
tree
{'group_by': 'contract_id'}
+
-
+
property.accounts.receivable.tree.form
property.accounts.receivable
@@ -410,7 +411,7 @@
合同应收报表
tree
property.accounts.receivable
-
+