From d1a4e09612df6634b7f05a4f41163595ad5174b9 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Tue, 7 Oct 2025 16:42:22 +0800 Subject: [PATCH 1/5] 1 --- .../wizard/soong_workflow_comment_wizard.py | 5 ++--- yuthon_property/__manifest__.py | 2 +- .../models/property_meter_archives.py | 10 +++------- .../models/property_meter_water.py | 15 +++----------- yuthon_property/models/yuthon_property.py | 1 + .../views/yuthon_property_views.xml | 2 ++ .../models/property_lease_contract.py | 20 +++++++++++++++++-- .../views/property_lease_contract.xml | 1 + 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 0174882ee..7314015da 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -399,12 +399,11 @@ class SoongWorkflowCommentWizard(models.TransientModel): action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0] url = f'https://oa.thtzjt.com/web?login={employee.user_id.login}&oauth_uid={employee.wecom_userid}#id={record_id.id}&cids=2&action={action_id.id}&model={record_id._name}&view_type=form&menu_id=10104' self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', - user_id=employee.wecom_userid, + user_id='18562027762', title=record_id._description, description="标题: {}\n".format( record_id.name) + self.env.user.name + ' ' + str( - fields.Datetime.now() + timedelta( - hours=8)), + fields.Datetime.now() + timedelta(hours=8)), url=url, btntxt="查看详情") else: # 串审模式 (沿用原有逻辑) # 查找下一个节点 diff --git a/yuthon_property/__manifest__.py b/yuthon_property/__manifest__.py index 897708bce..a501d2acc 100644 --- a/yuthon_property/__manifest__.py +++ b/yuthon_property/__manifest__.py @@ -87,7 +87,7 @@ ], }, 'demo': [], - 'depends': ['mail', 'documents'], + 'depends': ['mail', 'documents', 'yuthon_issue'], 'installable': True, 'application': True, } diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index 45a803711..e1f17dccb 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -173,10 +173,10 @@ class MeterArchivesLine(models.Model): lessee_id = fields.Many2one('property.tenant.information', string='承租方') yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息') last_meter = fields.Date(string='上次抄表日期') - last_dosage = fields.Float(string='上次用量', compute="compute_meter_values") - last_read = fields.Float(string='上次读数', compute="compute_meter_values") + last_dosage = fields.Float(string='上次用量', compute="compute_meter_values", store=True) + last_read = fields.Float(string='上次读数', store=True) meter_date = fields.Date(string='任务日期') - current_meter = fields.Float(string='本次用量', compute='compute_meter_values') + current_meter = fields.Float(string='本次用量', compute='compute_meter_values', store=True) current_read = fields.Float(string='本次读数') unit_number = fields.Char(string='单元编号/用途') gauge_magnification = fields.Integer(string='仪表倍率', readonly=True, default=1) @@ -264,7 +264,3 @@ class MeterArchivesLine(models.Model): self._context.get('active_ids', self._context.get('active_id'))) for record in meter_ids: record.onchange_lessee_id() - -class PropertyElectricReading(models.Model): - _name = 'property.electric.reading' - current_meter = fields.Float(string='本次用量', tracking=True) diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py index 7be6af519..a80bca6a5 100644 --- a/yuthon_property/models/property_meter_water.py +++ b/yuthon_property/models/property_meter_water.py @@ -140,7 +140,7 @@ class MeterWaterLine(models.Model): last_dosage = fields.Float(string='上次用量', compute="compute_meter_values") last_read = fields.Float(string='上次读数') meter_date = fields.Date(string='任务日期') - current_meter = fields.Float(string='本次用量', readonly=True, compute='compute_meter_values') + current_meter = fields.Float(string='本次用量', compute='compute_meter_values') current_read = fields.Float(string='本次读数', group_operator=None) unit_number = fields.Char(string='单元编号/用途') unit = fields.Float(string='当月单价') @@ -200,12 +200,7 @@ class MeterWaterLine(models.Model): line.current_meter = 0 else: line.current_meter = 0 - - lines = self.search([ - ('unit_number', '=', line.unit_number), - ('meter_date', '!=', False) - ], order='meter_date asc') - + lines = self.search([('unit_number', '=', line.unit_number),('meter_date', '!=', False)], order='meter_date asc') if line in lines: idx = lines.ids.index(line.id) if idx > 0: @@ -231,8 +226,4 @@ class MeterWaterLine(models.Model): meter_ids = self.env["meter.water.line"].browse( self._context.get('active_ids', self._context.get('active_id'))) for record in meter_ids: - record.onchange_lessee_id() - -class PropertyWaterReading(models.Model): - _name = 'property.water.reading' - current_meter = fields.Float(string='本次用量', tracking=True) \ No newline at end of file + record.onchange_lessee_id() \ No newline at end of file diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 3c23d2def..68c182492 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -93,6 +93,7 @@ class YuthonProperty(models.Model): annual_increase_percentage = fields.Float(string='递增百分比', igits=(6, 2)) annual_increase_amount = fields.Float(string='递增金额', igits=(6, 2)) rent_unit = fields.Float(string='租金单价', igits=(6, 2)) + property_type = fields.Selection([('property', '物业'), ('guanggao', '广告位'), ('guanzi', '管子间')], string="资产类型", default='property') def update_mange(self): property_ids = self.env['yuthon.property'].search([('name', 'ilike', '天河商贸大厦')]) diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml index 01aaef891..1eba399cf 100644 --- a/yuthon_property/views/yuthon_property_views.xml +++ b/yuthon_property/views/yuthon_property_views.xml @@ -20,6 +20,7 @@ +