From cab3c8f051c36f55a4ffe74d571453edaf09ca92 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: Sat, 20 Sep 2025 16:06:48 +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 | 28 ++++++++++
.../models/property_meter_water.py | 28 ++++++++++
yuthon_property/security/ir.model.access.csv | 4 +-
.../views/property_meter_archives_views.xml | 54 ++++++++++++-------
.../views/property_meter_water_views.xml | 52 ++++++++++++------
.../views/property_design_approval_views.xml | 30 ++++++-----
.../models/yuthon_trade_activities.py | 1 +
.../views/yuthon_trade_activities.xml | 1 +
8 files changed, 151 insertions(+), 47 deletions(-)
diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py
index 06609607a..9a7d77243 100644
--- a/yuthon_property/models/property_meter_archives.py
+++ b/yuthon_property/models/property_meter_archives.py
@@ -34,6 +34,7 @@ class PropertyMeterArchives(models.Model):
last_reading_time = fields.Date(string="最后读数时间")
standards_id = fields.Many2one('yuthon.electricity.setting', string='标准')
yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息')
+ line_ids = fields.One2many('meter.archives.line', 'archives_id', string='明细行')
remarks = fields.Text(string='备注')
@api.depends('yuthon_property_ids')
@@ -159,6 +160,33 @@ class PropertyMeterArchives(models.Model):
}
}
+
+class MeterArchivesLine(models.Model):
+ _name = 'meter.archives.line'
+ _description = '电表库明细行'
+
+ archives_id = fields.Many2one('property.meter.archives', string='电表库', required=True, ondelete='cascade')
+ name = fields.Char(string='仪表编号')
+ epitope_values = fields.Char(string='表位置')
+ lessee_id = fields.Many2one('property.tenant.information', string='承租方')
+ yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息')
+ last_meter = fields.Date(string='上次抄表日期')
+ last_dosage = fields.Float(string='上次用量')
+ last_read = fields.Float(string='上次读数', readonly=True)
+ current_meter = fields.Float(string='本次用量', readonly=True)
+ current_read = fields.Float(string='本次读数')
+ unit_number = fields.Char(string='单元编号/用途')
+ gauge_magnification = fields.Integer(string='仪表倍率', readonly=True, default=1)
+ last_reading_time = fields.Date(string="最后读数时间")
+ type = fields.Selection([('public', '公共'), ('fees', '收费')], string='类型')
+ start_time = fields.Date(string="安装日期")
+ end_time = fields.Date(string="拆除日期")
+ remarks = fields.Text(string='备注')
+ archives_state = fields.Selection([('stop', '停用'), ('use', '正常'), ('rent', '出租')], string='状态',
+ default='use')
+ maximum_count = fields.Integer(string='最大位数')
+
+
class PropertyElectricReading(models.Model):
_name = 'property.electric.reading'
current_meter = fields.Float(string='本次用量', tracking=True)
diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py
index 64a756739..24786f223 100644
--- a/yuthon_property/models/property_meter_water.py
+++ b/yuthon_property/models/property_meter_water.py
@@ -33,6 +33,7 @@ class PropertyMeterWater(models.Model):
water_state = fields.Selection([('stop', '停用'), ('use', '使用'), ('rent', '出租')], string='状态', compute='_compute_water_state', store=True)
standards_id = fields.Many2one('yuthon.electricity.setting', string='标准')
yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息')
+ line_ids = fields.One2many('meter.water.line', 'water_id', string='水表明细行')
remarks = fields.Text(string='备注')
def open_record(self):
@@ -150,6 +151,33 @@ class PropertyMeterWater(models.Model):
}
+class MeterWaterLine(models.Model):
+ _name = 'meter.water.line'
+ _description = '水表库明细行'
+
+ water_id = fields.Many2one('property.meter.water', string='水表库', required=True, ondelete='cascade')
+ name = fields.Char(string='仪表编号')
+ epitope_values = fields.Char(string='表位置')
+ lessee_id = fields.Many2one('property.tenant.information', string='承租方')
+ yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息')
+ last_meter = fields.Date(string='上次抄表日期')
+ last_dosage = fields.Float(string='上次用量')
+ last_read = fields.Float(string='上次读数', readonly=True)
+ current_meter = fields.Float(string='本次用量', readonly=True)
+ current_read = fields.Float(string='本次读数')
+ unit_number = fields.Char(string='单元编号/用途')
+ gauge_magnification = fields.Integer(string='仪表倍率', readonly=True, default=1)
+ last_reading_time = fields.Date(string="最后读数时间")
+ type = fields.Selection([('public', '公共'), ('fees', '收费')], string='类型')
+ start_time = fields.Date(string="安装日期")
+ end_time = fields.Date(string="拆除日期")
+ water_state = fields.Selection([('stop', '停用'), ('use', '使用'), ('rent', '出租')], string='状态')
+ remarks = fields.Text(string='备注')
+ employee_ids = fields.Many2many('hr.employee', string='抄表人')
+ maximum_count = fields.Integer(string='最大位数')
+
+
+
class PropertyWaterReading(models.Model):
_name = 'property.water.reading'
current_meter = fields.Float(string='本次用量', tracking=True)
\ No newline at end of file
diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv
index ee096aeb4..afd13796c 100644
--- a/yuthon_property/security/ir.model.access.csv
+++ b/yuthon_property/security/ir.model.access.csv
@@ -96,4 +96,6 @@ access_electric_water_wizard, electric_water_wizard,model_electric_water_wizard,
access_hydropower_logs,hydropower.logs,model_hydropower_logs,base.group_user,1,1,1,1
access_initialize_wizard,initialize.wizard,model_initialize_wizard,base.group_user,1,1,1,1
-access_receivable_modify_line, receivable.modify.line,model_receivable_modify_line,base.group_user,1,1,1,1
\ No newline at end of file
+access_receivable_modify_line, receivable.modify.line,model_receivable_modify_line,base.group_user,1,1,1,1
+access_meter_archives_line, meter.archives.line,model_meter_archives_line,base.group_user,1,1,1,1
+access_meter_water_line, meter.water.line,model_meter_water_line,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml
index bbc23b11b..9ec6e2b23 100644
--- a/yuthon_property/views/property_meter_archives_views.xml
+++ b/yuthon_property/views/property_meter_archives_views.xml
@@ -10,7 +10,6 @@
-
@@ -31,10 +30,11 @@
+
-
+
property.meter.archives.form
property.meter.archives
@@ -50,36 +50,54 @@
-
-
+
+
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property/views/property_meter_water_views.xml b/yuthon_property/views/property_meter_water_views.xml
index 27051421d..6c64d296c 100644
--- a/yuthon_property/views/property_meter_water_views.xml
+++ b/yuthon_property/views/property_meter_water_views.xml
@@ -11,7 +11,6 @@
-
@@ -33,6 +32,7 @@
+
@@ -52,35 +52,57 @@
-
-
-
-
+
+
+
-
-
+
-
-
-
+
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property_approval/views/property_design_approval_views.xml b/yuthon_property_approval/views/property_design_approval_views.xml
index 270036f66..3684f89d6 100644
--- a/yuthon_property_approval/views/property_design_approval_views.xml
+++ b/yuthon_property_approval/views/property_design_approval_views.xml
@@ -54,6 +54,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -74,19 +91,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/yuthon_trade/models/yuthon_trade_activities.py b/yuthon_trade/models/yuthon_trade_activities.py
index cd29985b9..fe5d4452d 100644
--- a/yuthon_trade/models/yuthon_trade_activities.py
+++ b/yuthon_trade/models/yuthon_trade_activities.py
@@ -20,6 +20,7 @@ class YuthonTradeActivities(models.Model):
other = fields.Text(string="其他")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
+ company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
host_id = fields.Many2one("hr.department", string="主办")
joint_office_ids = fields.Many2many("hr.department", string="联办")
work_end = fields.Boolean(string="结束")
diff --git a/yuthon_trade/views/yuthon_trade_activities.xml b/yuthon_trade/views/yuthon_trade_activities.xml
index eb619ae6d..eb8a6fc1c 100644
--- a/yuthon_trade/views/yuthon_trade_activities.xml
+++ b/yuthon_trade/views/yuthon_trade_activities.xml
@@ -23,6 +23,7 @@
+