From 1824c19a6197f9d2d2749d2e68555f766680fea8 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: Wed, 15 Oct 2025 12:04:44 +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
---
yuthon_property/models/property_meter_archives.py | 9 +++++----
yuthon_property/views/property_meter_archives_views.xml | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py
index 36ceafc66..dddfcd80c 100644
--- a/yuthon_property/models/property_meter_archives.py
+++ b/yuthon_property/models/property_meter_archives.py
@@ -31,7 +31,7 @@ class PropertyMeterArchives(models.Model):
epitope_values = fields.Char(string="表位置")
epitope_values_id = fields.Many2one("yuthon.epitope.values", string="表位置")
other = fields.Char(string="其他")
- unit = fields.Float(string="当月单价")
+ unit = fields.Float(string="当月单价", digits=(16, 4))
archives_state = fields.Selection(
[("stop", "停用"), ("use", "正常"), ("rent", "出租")],
string="状态",
@@ -228,6 +228,7 @@ class MeterArchivesLine(models.Model):
last_dosage = fields.Float(
string="上次用量", store=True, group_operator=None, compute="_compute_last"
)
+ initial_value = fields.Float(string="初始读数")
last_read = fields.Float(
string="上次读数", store=True, group_operator=None, compute="_compute_last"
)
@@ -255,9 +256,9 @@ class MeterArchivesLine(models.Model):
)
last_reading_time = fields.Date(string="最后读数时间")
receivables = fields.Float(
- string="应收", compute="_compute_receivables", store=True, group_operator=None, help="应收金额=本次用量*单价*(1+线损)"
+ string="应收", compute="_compute_receivables", store=True, help="应收金额=本次用量*单价*(1+线损)"
)
- unit = fields.Float(string="当月单价", group_operator=None, igits=(6, 4))
+ unit = fields.Float(string="当月单价", group_operator=None, digits=(16, 4))
line_loss = fields.Float(string="线损", default=0.02)
type = fields.Selection([("public", "公共"), ("fees", "收费")], string="类型")
start_time = fields.Date(string="安装日期")
@@ -341,7 +342,7 @@ class MeterArchivesLine(models.Model):
i.current_meter = 0
else:
i.last_dosage = 0
- i.last_read = 0
+ i.last_read = i.initial_value
i.last_meter = i.meter_date
i.current_meter = 0
diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml
index 3463b1675..a5c6d44c8 100644
--- a/yuthon_property/views/property_meter_archives_views.xml
+++ b/yuthon_property/views/property_meter_archives_views.xml
@@ -18,7 +18,7 @@
-
+
@@ -42,7 +42,7 @@
-
+
@@ -67,7 +67,7 @@
-
+
@@ -95,7 +95,8 @@
-
+
+