From b569cf019274846a55fa25f6c508f15de1848e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 11 Feb 2026 17:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E8=9D=B6=E4=BA=91=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E6=90=9C=E7=B4=A2=EF=BC=8C=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/property_accounts_receivable.py | 19 ++++++++++++++----- .../models/property_tenant_information.py | 1 + yuthon_property/models/yuthon_property.py | 1 + .../models/yuthon_resource_mgmt_config.py | 1 + .../property_accounts_receivable_views.xml | 2 +- .../property_tenant_information_views.xml | 1 + .../views/yuthon_property_views.xml | 1 + .../yuthon_resource_mgmt_config_views.xml | 1 + .../views/inherit_yuthon_property_views.xml | 12 +++++++++--- 9 files changed, 30 insertions(+), 9 deletions(-) diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index b2fd7bbdc..4b7ebadf3 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -15,11 +15,8 @@ class PropertyAccountsReceivable(models.Model): due_date = fields.Date(string='应收开始') due_date_end = fields.Date(string='应收结束') reconciliation_time = fields.Datetime('对账时间') - year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='所属年', ) - month = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), - ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'), - ('9', '九月'), ('10', '十月'), ('11', '十一月'), - ('12', '十二月')], string='选择月份') + month_id = fields.Many2one('base.month', string='月份', compute="_compute_display_date", store=True) + year_id = fields.Many2one('base.year', string='年份', compute="_compute_display_date", store=True) original_amount = fields.Float(string='当期金额') discount_amount = fields.Float(string='减免金额') discount_date = fields.Date(string='减免日期') @@ -69,6 +66,18 @@ class PropertyAccountsReceivable(models.Model): record.due_date = record.due_date_end record.due_date_end = None + @api.depends('due_date') + def _compute_display_date(self): + for rec in self: + if rec.due_date: + month_id = rec.env['base.month'].search([('name', '=', int(rec.due_date.month))]) + rec.month_id = month_id.id if month_id else False + year_id = rec.env['base.year'].search([('name', '=', int(rec.due_date.year))]) + rec.year_id = year_id.id if year_id else False + else: + rec.month_id = False + rec.year_id = False + @api.onchange('is_invalid') def _onchange_is_invalid(self): if self.is_invalid: diff --git a/yuthon_property/models/property_tenant_information.py b/yuthon_property/models/property_tenant_information.py index e1ae614ba..4bf956de9 100644 --- a/yuthon_property/models/property_tenant_information.py +++ b/yuthon_property/models/property_tenant_information.py @@ -27,6 +27,7 @@ class PropertyTenantInformation(models.Model): power_attorney_id = fields.Many2one('ir.attachment', string='委托代理书') attorne_card_id = fields.Many2one('ir.attachment', string='委托代理人身份证') bank_ids = fields.One2many('property.bank.line', 'tenant_id', string='银行信息') + kingdee_tenant_id = fields.Char(string='金蝶云承租方id') def update_tenant_wizard(self): return { diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 8dfab6bb6..f6108bb2d 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -96,6 +96,7 @@ class YuthonProperty(models.Model): rent_unit = fields.Float(string='租金单价', igits=(6, 2)) property_type = fields.Selection([('property', '物业'), ('guanggao', '广告位'), ('guanzi', '管子间'), ('room', '机房'), ('base_station','基站'), ('other', '其他')], string="资产类型", default='property') is_new = fields.Boolean(string="是否最新物业", compute= 'compute_is_new', default=True, store=True) + kingdee_property_id = fields.Char(string="金蝶云物业资产id") def update_property_state(self): today = date.today() diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py index 1739f6a49..3e8e54b5e 100644 --- a/yuthon_property/models/yuthon_resource_mgmt_config.py +++ b/yuthon_property/models/yuthon_resource_mgmt_config.py @@ -111,6 +111,7 @@ class YuthonPropertyCompany(models.Model): rent_account = fields.Char(string="收租公司账号") start_data = fields.Date(string="开始日期") end_data = fields.Date(string="结束日期") + kingdee_company_id = fields.Char(string="金蝶云物业公司id") class YuthonIndustrySetting(models.Model): diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml index 9180f2c38..8a4f91bcc 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/property_tenant_information_views.xml b/yuthon_property/views/property_tenant_information_views.xml index 2b0ca718e..73fd2b39c 100644 --- a/yuthon_property/views/property_tenant_information_views.xml +++ b/yuthon_property/views/property_tenant_information_views.xml @@ -45,6 +45,7 @@ + diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml index 98253023d..c81d7f92b 100644 --- a/yuthon_property/views/yuthon_property_views.xml +++ b/yuthon_property/views/yuthon_property_views.xml @@ -66,6 +66,7 @@ + diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml index a7b4c663c..a5e93aa57 100644 --- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml +++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml @@ -190,6 +190,7 @@ + diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 7d4e4e946..eb74fa542 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -468,15 +468,20 @@ + - + + + + + @@ -492,7 +497,7 @@ 应收账单 property.accounts.receivable tree - {'search_default_group_by_contract_id': True} + {'search_default_group_company_id': True, 'group_by': ['company_id', 'due_date:year', 'due_date:month'], 'orderedBy': [{'name': 'due_date', 'asc': False}]} @@ -501,6 +506,7 @@ property.accounts.receivable tree [('management_type_id.name','=', '违约金')] + {'search_default_group_company_id': True, 'group_by': ['company_id', 'due_date:year', 'due_date:month'], 'orderedBy': [{'name': 'due_date', 'asc': False}]} @@ -508,7 +514,7 @@ 押金列表 property.accounts.receivable tree - {'search_default_group_by_contract_id': True} + {'search_default_group_company_id': True, 'group_by': ['company_id', 'due_date:year', 'due_date:month'], 'orderedBy': [{'name': 'due_date', 'asc': False}]} [('management_type_id.name','=', '押金')]