From bd6b22d74daeefa7cb16cd845ab72fee8bd3ec72 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: Sun, 28 Sep 2025 18:19:17 +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
---
.../models/property_meter_archives.py | 1 -
.../models/property_meter_water.py | 5 ++-
.../views/property_meter_archives_views.xml | 4 +--
.../views/property_meter_water_views.xml | 5 +--
.../wizard/electric_water_wizard.py | 2 +-
.../models/inherit_yuthon_property.py | 34 +++++++++----------
6 files changed, 21 insertions(+), 30 deletions(-)
diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py
index a0efd56c9..a80147c92 100644
--- a/yuthon_property/models/property_meter_archives.py
+++ b/yuthon_property/models/property_meter_archives.py
@@ -24,7 +24,6 @@ class PropertyMeterArchives(models.Model):
other = fields.Char(string='其他')
unit = fields.Float(string='当月单价')
archives_state = fields.Selection([('stop', '停用'), ('use', '正常'), ('rent', '出租')], string='状态', compute='_compute_archives_state', store=True, default='use')
- is_push = fields.Boolean(string='已推送')
start_time = fields.Date(string="安装日期")
end_time = fields.Date(string="拆除日期")
line_loss = fields.Float(string="线损", default=0.02)
diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py
index 4d19d94a2..9642be5dc 100644
--- a/yuthon_property/models/property_meter_water.py
+++ b/yuthon_property/models/property_meter_water.py
@@ -22,7 +22,6 @@ class PropertyMeterWater(models.Model):
epitope_values_id = fields.Many2one('yuthon.epitope.values', string='表位置')
other = fields.Char(string='其他')
unit = fields.Float(string='当月单价')
- is_push = fields.Boolean(string='已推送')
start_time = fields.Date(string="安装日期")
end_time = fields.Date(string="拆除日期")
line_loss = fields.Float(string="线损", default=0.05)
@@ -139,11 +138,11 @@ class MeterWaterLine(models.Model):
last_read = fields.Float(string='上次读数')
meter_date = fields.Date(string='任务日期')
current_meter = fields.Float(string='本次用量', readonly=True, compute='compute_meter_values')
- current_read = fields.Float(string='本次读数')
+ current_read = fields.Float(string='本次读数', group_operator=None)
unit_number = fields.Char(string='单元编号/用途')
unit = fields.Float(string='当月单价')
receivables = fields.Float(string="应收", compute='_compute_receivables', store=True)
- gauge_magnification = fields.Integer(string='仪表倍率', readonly=True, default=1)
+ gauge_magnification = fields.Integer(string='仪表倍率', readonly=True, default=1, group_operator=None)
last_reading_time = fields.Date(string="最后读数时间")
type = fields.Selection([('public', '公共'), ('fees', '收费')], string='类型')
start_time = fields.Date(string="安装日期")
diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml
index 2f76c64aa..7f990948c 100644
--- a/yuthon_property/views/property_meter_archives_views.xml
+++ b/yuthon_property/views/property_meter_archives_views.xml
@@ -4,7 +4,7 @@
property.meter.archives.tree
property.meter.archives
-
@@ -57,7 +56,6 @@
-
diff --git a/yuthon_property/views/property_meter_water_views.xml b/yuthon_property/views/property_meter_water_views.xml
index d0fa11a03..c1ba3df85 100644
--- a/yuthon_property/views/property_meter_water_views.xml
+++ b/yuthon_property/views/property_meter_water_views.xml
@@ -5,8 +5,7 @@
property.meter.water
+ decoration-danger="water_state == 'stop'">
@@ -25,7 +24,6 @@
-
@@ -60,7 +58,6 @@
-
diff --git a/yuthon_property/wizard/electric_water_wizard.py b/yuthon_property/wizard/electric_water_wizard.py
index 63ed84e5b..5a975c428 100644
--- a/yuthon_property/wizard/electric_water_wizard.py
+++ b/yuthon_property/wizard/electric_water_wizard.py
@@ -97,6 +97,6 @@ class ElectricWaterWizard(models.TransientModel):
'type': water.type,
'start_time': water.start_time,
'end_time': water.end_time,
- 'archives_state': water.archives_state,
+ 'water_state': water.water_state,
'maximum_count': water.maximum_count,
})
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index b606bd683..f119c97ad 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -425,24 +425,6 @@ class PropertyAccountsReceivable(models.Model):
})
contract_account.onchange_contract_id()
- @api.model_create_multi
- def create(self, vals_list):
- contract_account_map = {}
- for vals in vals_list:
- if 'contract_id' in vals and vals['contract_id']:
- contract_id = vals['contract_id']
- if contract_id not in contract_account_map:
- contract_account = self.env['contract.accounts.receivable'].search([
- ('contract_id', '=', contract_id)
- ], limit=1)
- if not contract_account:
- contract_account = self.env['contract.accounts.receivable'].create({
- 'contract_id': contract_id
- })
- else:
- contract_account.onchange_contract_id()
- contract_account.onchange_contract_id()
-
@api.depends('management_type_id')
def _compute_is_rent(self):
for rec in self:
@@ -591,6 +573,22 @@ class PropertyAccountsReceivable(models.Model):
'property_ids': property_ids_value,
'contract_ids': contract_id_value,
})
+
+ contract_account_map = {}
+ for vals in vals_list:
+ if 'contract_id' in vals and vals['contract_id']:
+ contract_id = vals['contract_id']
+ if contract_id not in contract_account_map:
+ contract_account = self.env['contract.accounts.receivable'].search([
+ ('contract_id', '=', contract_id)
+ ], limit=1)
+ if not contract_account:
+ contract_account = self.env['contract.accounts.receivable'].create({
+ 'contract_id': contract_id
+ })
+ else:
+ contract_account.onchange_contract_id()
+ contract_account.onchange_contract_id()
return records
@api.onchange('penalty_date')