From 9798523ddeb59da007b9d096c8ce39e19c5d1601 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: Fri, 31 Oct 2025 09:25:43 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index a426a5c0c..e5dea749c 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -254,8 +254,8 @@ class MeterArchivesLine(models.Model): else: record.current_meter = 0 - @api.constrains('line_loss', 'current_meter', 'unit') - def _constrains_receivables(self): + @api.onchange('line_loss', 'current_meter', 'unit') + def onchange_receivables(self): for record in self: if record.line_loss and record.current_meter and record.unit: raw_value = record.current_meter * record.unit * (1 + record.line_loss) * record.gauge_magnification