From cd2ccde27bebec0429d4887f2a0afcae62a033c7 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Sun, 15 Jun 2025 22:10:35 +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
---
sh_backmate_theme_adv_enterprise/controllers/home.py | 5 +++++
yuthon_property/models/property_deposit_list.py | 3 +++
yuthon_property/models/property_management_list.py | 3 +++
yuthon_property/models/property_rent_list.py | 3 +++
yuthon_property/models/property_tariff_list.py | 3 +++
yuthon_property/models/property_water_list.py | 3 +++
yuthon_property/views/property_bank_statements_views.xml | 1 +
7 files changed, 21 insertions(+)
diff --git a/sh_backmate_theme_adv_enterprise/controllers/home.py b/sh_backmate_theme_adv_enterprise/controllers/home.py
index feb37667f..b575b2cf9 100644
--- a/sh_backmate_theme_adv_enterprise/controllers/home.py
+++ b/sh_backmate_theme_adv_enterprise/controllers/home.py
@@ -17,6 +17,11 @@ 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'},
+ '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'},
+ 'yuthon_property.yuthon_property_water_list': {'model': 'property.water.list', 'func': 'get_no_read_count'},
+ 'yuthon_property.yuthon_property_deposit_list': {'model': 'property.deposit.list', 'func': 'get_no_read_count'},
'soong_workflow.menu_workflow_approval_request_my': {'model': 'soong.workflow.record', 'func': 'get_no_read_count'},
'soong_workflow.menu_workflow_approval_request_copy': {'model': 'soong.workflow.record.copy', 'func': 'get_no_read_count'},
'yuthon_will_task.menu_yuthon_will_task_root': {'model': 'yuthon.will.task', 'func': 'read_number'},
diff --git a/yuthon_property/models/property_deposit_list.py b/yuthon_property/models/property_deposit_list.py
index c8001eab3..4fbd2a8e1 100644
--- a/yuthon_property/models/property_deposit_list.py
+++ b/yuthon_property/models/property_deposit_list.py
@@ -11,3 +11,6 @@ class PropertyDepositList(models.Model):
def unlink(self):
return super().unlink()
+
+ def get_no_read_count(self):
+ return self.search_count([('is_push', '=', False)])
\ No newline at end of file
diff --git a/yuthon_property/models/property_management_list.py b/yuthon_property/models/property_management_list.py
index b2c8862cc..8299a7742 100644
--- a/yuthon_property/models/property_management_list.py
+++ b/yuthon_property/models/property_management_list.py
@@ -16,5 +16,8 @@ class PropertyManagementList(models.Model):
remarks = fields.Text(string='备注')
is_push = fields.Boolean(string='是否推送')
+ def get_no_read_count(self):
+ return self.search_count([('is_push', '=', False)])
+
def unlink(self):
return super().unlink()
diff --git a/yuthon_property/models/property_rent_list.py b/yuthon_property/models/property_rent_list.py
index 4468f64bb..345e482af 100644
--- a/yuthon_property/models/property_rent_list.py
+++ b/yuthon_property/models/property_rent_list.py
@@ -37,6 +37,9 @@ class PropertyRentList(models.Model):
management_type_id = fields.Many2one('yuthon.management.type', string='应收类型')
last_update_time = fields.Datetime(string='最后修改时间')
+ def get_no_read_count(self):
+ return self.env['property.rent.list'].search_count([('is_push', '=', False)])
+
def write(self, vals):
vals['last_update_time'] = fields.Datetime.now()
return super(PropertyRentList, self).write(vals)
diff --git a/yuthon_property/models/property_tariff_list.py b/yuthon_property/models/property_tariff_list.py
index d031cab2d..39354c531 100644
--- a/yuthon_property/models/property_tariff_list.py
+++ b/yuthon_property/models/property_tariff_list.py
@@ -25,5 +25,8 @@ class PropertyTariffList(models.Model):
write_time = fields.Datetime(string='最后修改时间')
is_push = fields.Boolean(string='是否推送')
+ def get_no_read_count(self):
+ return self.env['property.tariff.list'].search_count([('is_push', '=', False)])
+
def unlink(self):
return super().unlink()
diff --git a/yuthon_property/models/property_water_list.py b/yuthon_property/models/property_water_list.py
index 940e8bc07..bd8fcff51 100644
--- a/yuthon_property/models/property_water_list.py
+++ b/yuthon_property/models/property_water_list.py
@@ -25,5 +25,8 @@ class PropertyWaterList(models.Model):
write_time = fields.Datetime(string='最后修改时间')
is_push = fields.Boolean(string='是否推送')
+ def get_no_read_count(self):
+ return self.search_count([('is_push', '=', False)])
+
def unlink(self):
return super().unlink()
diff --git a/yuthon_property/views/property_bank_statements_views.xml b/yuthon_property/views/property_bank_statements_views.xml
index 9ca5c5200..99a6c6562 100644
--- a/yuthon_property/views/property_bank_statements_views.xml
+++ b/yuthon_property/views/property_bank_statements_views.xml
@@ -36,6 +36,7 @@
property.bank.statements
+