添加功能

This commit is contained in:
zhou
2025-06-15 22:10:35 +08:00
parent a92fb0f4da
commit cd2ccde27b
7 changed files with 21 additions and 0 deletions
@@ -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'},
@@ -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)])
@@ -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()
@@ -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)
@@ -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()
@@ -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()
@@ -36,6 +36,7 @@
<field name="model">property.bank.statements</field>
<field name="arch" type="xml">
<tree string="银行流水" editable="bottom" js_class="custom_bank_statements_button" limit="20">
<field name="sequence_number"/>
<!-- <header>-->
<!-- <button name="handle_contract_penalty" type="object" class="oe_highlight" string="ce"/>-->
<!-- </header>-->