From 7eee08c2340d4aa9e25d751c6dcc297a1c323207 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Thu, 25 Sep 2025 18:54:18 +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
---
yuthon_property_approval/__manifest__.py | 1 +
yuthon_property_approval/models/__init__.py | 3 +-
.../models/contract_accounts_receivable.py | 12 ++++
.../models/inherit_yuthon_property.py | 9 +++
.../security/ir.model.access.csv | 2 +
.../contract_accounts_receivable_viwes.xml | 55 +++++++++++++++++++
yuthon_work_brand/views/hr_menus.xml | 8 ++-
7 files changed, 88 insertions(+), 2 deletions(-)
create mode 100644 yuthon_property_approval/models/contract_accounts_receivable.py
create mode 100644 yuthon_property_approval/views/contract_accounts_receivable_viwes.xml
diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py
index 913fb9e04..0085b1230 100644
--- a/yuthon_property_approval/__manifest__.py
+++ b/yuthon_property_approval/__manifest__.py
@@ -63,6 +63,7 @@
'views/property_current_approval_views.xml',
'views/property_split_approval_views.xml',
'views/property_evaluate_application_views.xml',
+ 'views/contract_accounts_receivable_viwes.xml',
'views/inherit_yuthon_property_views.xml',
'views/property_project_works_viwes.xml',
'views/property_sporadic_works_views.xml',
diff --git a/yuthon_property_approval/models/__init__.py b/yuthon_property_approval/models/__init__.py
index ddcd195fb..7a254a5f2 100644
--- a/yuthon_property_approval/models/__init__.py
+++ b/yuthon_property_approval/models/__init__.py
@@ -56,4 +56,5 @@ from . import inherit_property_tenant_information
from . import property_meeting_approval
from . import property_lessee_analysis
from . import yuthon_property_ledger
-from . import payment_process
\ No newline at end of file
+from . import payment_process
+from . import contract_accounts_receivable
\ No newline at end of file
diff --git a/yuthon_property_approval/models/contract_accounts_receivable.py b/yuthon_property_approval/models/contract_accounts_receivable.py
new file mode 100644
index 000000000..8f9098788
--- /dev/null
+++ b/yuthon_property_approval/models/contract_accounts_receivable.py
@@ -0,0 +1,12 @@
+from odoo import models, fields, api
+
+
+class ContractAccountsReceivable(models.Model):
+ _name = 'contract.accounts.receivable'
+ _description = '应收账单(合同)'
+
+ contract_id = fields.Many2one('property.lease.contract', string="合同")
+ lessee_id = fields.Many2one('property.tenant.information', string='承租方')
+ property_ids = fields.Many2many('yuthon.property', string='物业')
+ contract_accounts_ids = fields.One2many('property.accounts.receivable', 'contract_accounts_id', string='关联应收账单')
+
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index 5c98dce81..1e5e86ce5 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -367,6 +367,7 @@ class PropertyAccountsReceivable(models.Model):
_rec_name = 'contract_id'
property_ids = fields.Many2many('yuthon.property', string='物业', compute='_compute_property_ids', store=True)
+ contract_accounts_id = fields.Many2one('contract.accounts.receivable', string="关联应收账单(合同)")
property_name = fields.Text(string='物业', compute="_compute_property_name")
is_rent = fields.Boolean(string='是否租金', default=True, compute = '_compute_is_rent', store=True)
management_area = fields.Float(related='contract_id.total_area', string='面积')
@@ -383,6 +384,14 @@ class PropertyAccountsReceivable(models.Model):
rent_owed = fields.Float(string="欠租金额")
per_day = fields.Float(string="每天违约金(元/天)")
+ last_month_table = fields.Float(string="上月表数")
+ this_month_table = fields.Float(string="本月表数")
+ ratio = fields.Float(string="倍率")
+ billable_quantity = fields.Float(string="计费数量")
+ pre_collection = fields.Float(string="预收金额")
+
+ actual_coping = fields.Float(string="实际应付")
+
@api.depends('management_type_id')
def _compute_is_rent(self):
for rec in self:
diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv
index 29e4aa69b..0597a54bc 100644
--- a/yuthon_property_approval/security/ir.model.access.csv
+++ b/yuthon_property_approval/security/ir.model.access.csv
@@ -109,3 +109,5 @@ access_build_pop_wizard, build_pop_wizard,model_build_pop_wizard,base.group_user
access_penalty_line_wizard, penalty_line_wizard,model_penalty_line_wizard,base.group_user,1,1,1,1
access_penalty_compute_line_wizard, penalty_compute_line_wizard,model_penalty_compute_line_wizard,base.group_user,1,1,1,1
access_penalty_pay_line, penalty_pay_line,model_penalty_pay_line,base.group_user,1,1,1,1
+
+access_contract_accounts_receivable, contract_accounts_receivable,model_contract_accounts_receivable,base.group_user,1,1,1,1
diff --git a/yuthon_property_approval/views/contract_accounts_receivable_viwes.xml b/yuthon_property_approval/views/contract_accounts_receivable_viwes.xml
new file mode 100644
index 000000000..d922a511c
--- /dev/null
+++ b/yuthon_property_approval/views/contract_accounts_receivable_viwes.xml
@@ -0,0 +1,55 @@
+
+
+
+ contract.accounts.receivable.tree
+ contract.accounts.receivable
+
+
+
+
+
+
+
+
+
+ contract.accounts.receivable.form
+ contract.accounts.receivable
+
+
+
+
+
+ 应收账单(合同)
+ contract.accounts.receivable
+ tree,form
+
+
+
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index e045bfeea..29e38abc4 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -783,9 +783,15 @@
sequence="5"/>
+