From da34be52d637c56d8f51f7300457f52c0a0ce452 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: Tue, 3 Mar 2026 18:52:56 +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 --- .../models/property_accounts_receivable.py | 7 ++ yuthon_property/models/property_rent_list.py | 9 ++ .../property_accounts_receivable_views.xml | 1 + .../views/property_rent_list_views.xml | 8 ++ .../models/inherit_yuthon_property.py | 1 + .../views/inherit_yuthon_property_views.xml | 7 ++ .../wizard/penalty_line_wizard.py | 2 +- .../wizard/property_reconciliation_wizard.py | 114 +----------------- 8 files changed, 38 insertions(+), 111 deletions(-) diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index df45bc916..c8f07fed1 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -14,6 +14,7 @@ class PropertyAccountsReceivable(models.Model): _description = '应收账单' payout_date = fields.Date(string='收款日期') + is_liquidated_damages = fields.Boolean(string='生成违约金', default=True) rent_month = fields.Float(string='当月租金') tax = fields.Float(string='税率') title_certificate = fields.Char(sting="产权证号") @@ -54,6 +55,12 @@ class PropertyAccountsReceivable(models.Model): bank_id = fields.Many2one('property.bank.statements', string='流水记录') receivable_log = fields.Text(string='应收日志') + def update_is_liquidated_damages(self): + rent_ids = self.env["property.accounts.receivable"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for rent in rent_ids: + rent.is_liquidated_damages = False + def update_is_invalid(self): record_ids = self.env["property.accounts.receivable"].browse( self._context.get("active_ids", self._context.get("active_id")) diff --git a/yuthon_property/models/property_rent_list.py b/yuthon_property/models/property_rent_list.py index 3f7b86ea5..384552704 100644 --- a/yuthon_property/models/property_rent_list.py +++ b/yuthon_property/models/property_rent_list.py @@ -1,3 +1,5 @@ +from email.policy import default + from odoo import models, fields, api @@ -6,6 +8,7 @@ class PropertyRentList(models.Model): _description = '租金列表' property_id = fields.Many2one('yuthon.property', string='物业') + is_liquidated_damages = fields.Boolean(string='生成违约金', default=True) lessee_id = fields.Many2one('property.tenant.information', string='承租方', store=True) admin_id = fields.Many2one(related='property_id.admin_id', string="片区管理员", store=True) rent_month = fields.Float(string='当月租金') @@ -37,6 +40,12 @@ class PropertyRentList(models.Model): management_type_id = fields.Many2one('yuthon.management.type', string='应收类型') last_update_time = fields.Datetime(string='最后修改时间') + def update_is_liquidated_damages(self): + rent_ids = self.env["property.rent.list"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for rent in rent_ids: + rent.is_liquidated_damages = False + def get_no_read_count(self): return self.env['property.rent.list'].search_count([('is_push', '=', False)]) diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml index 2c05e23b6..73a93a0dd 100644 --- a/yuthon_property/views/property_accounts_receivable_views.xml +++ b/yuthon_property/views/property_accounts_receivable_views.xml @@ -34,6 +34,7 @@ +