添加功能

This commit is contained in:
李鹏宇
2025-10-15 12:04:44 +08:00
parent 18d6ea9379
commit 1824c19a61
2 changed files with 10 additions and 8 deletions
@@ -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
@@ -18,7 +18,7 @@
<field name="lessee_id" options="{'no_create': True}"/>
<field name="yuthon_property_ids" string="物业信息" widget="many2many_tags"/>
<field name="unit_number"/>
<field name="gauge_magnification" readonly="1"/>
<field name="gauge_magnification"/>
<field name="type"/>
<field name="start_time"/>
<field name="end_time"/>
@@ -42,7 +42,7 @@
<field name="type"/>
<field name="lessee_id" options="{'no_create': True}" />
<field name="epitope_values_id" domain="[('type', '=', 'ammeter')]" options="{'no_open': True}"/>
<field name="gauge_magnification" readonly="1"/>
<field name="gauge_magnification"/>
<field name="maximum_count"/>
<field name="yuthon_property_ids" string="物业信息" widget="many2many_tags" options="{'no_open': True}"/>
</group>
@@ -67,7 +67,7 @@
<field name="current_meter" readonly="1"/>
<field name="current_read"/>
<field name="unit_number"/>
<field name="gauge_magnification" readonly="1"/>
<field name="gauge_magnification"/>
<field name="last_reading_time"/>
<field name="type"/>
<field name="start_time"/>
@@ -95,7 +95,8 @@
<field name="meter_date" readonly="1"/>
<field name="archives_id" string="电表名"/>
<field name="unit_number"/>
<field name="gauge_magnification" readonly="1"/>
<field name="gauge_magnification"/>
<field name="initial_value"/>
<field name="last_read" readonly="1"/>
<field name="current_read"/>
<field name="current_meter" readonly="1"/>