Merge pull request !5351 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-09-24 02:53:12 +00:00
committed by Gitee
3 changed files with 4 additions and 6 deletions
@@ -191,10 +191,10 @@ class MeterArchivesLine(models.Model):
insurances_ids = self.env["meter.archives.line"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for line in insurances_ids:
line._compute_meter_values()
line.compute_meter_values()
@api.depends('current_read', 'last_read', 'meter_date', 'maximum_count', 'archives_id')
def _compute_meter_values(self):
def compute_meter_values(self):
"""合并计算当前用量和上次用量"""
for line in self:
# 计算当前用量 (原 _compute_current_meter 逻辑)
@@ -155,10 +155,10 @@ class MeterWaterLine(models.Model):
insurances_ids = self.env["meter.water.line"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for line in insurances_ids:
line._compute_meter_values()
line.compute_meter_values()
@api.depends('current_read', 'last_read', 'meter_date', 'maximum_count', 'water_id')
def _compute_meter_values(self):
def compute_meter_values(self):
"""合并计算当前用量和上次用量"""
for line in self:
# 计算当前用量 (原 _compute_current_meter 逻辑)
-2
View File
@@ -31,7 +31,6 @@ class YuthonProperty(models.Model):
# 查询数据,限制100条
properties = self.search(domain, limit=100)
state_selection = dict(self._fields['property_state']._description_selection(self.env))
rental_method_selection = dict(self._fields['rental_method']._description_selection(self.env))
return [
{
@@ -49,7 +48,6 @@ class YuthonProperty(models.Model):
"联系人": p.contact or "",
"出租用途": p.rental_purposes.name or "" if p.rental_purposes else "",
"审批情况": p.approval_status or "",
"出租方式": rental_method_selection.get(p.rental_method, ""),
"租赁合同号": p.contract_id.name or "" if p.contract_id else "",
"出租面积": p.rental_area or 0.0,
"评估价(元/m² •月)": p.appraisal_price or 0.0,