diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index e1e4f9448..1047cffe3 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -579,12 +579,24 @@ class YuthonPropertyWater(models.Model):
property_meter_water_id = fields.Many2one('property.meter.water', string="水表库")
rate = fields.Integer(related='property_meter_water_id.gauge_magnification', string="倍率", store=True)
- standard_id = fields.Many2one(related='property_meter_water_id.standards_id', string="标准", store=True)
- installation_date = fields.Date(related='property_meter_water_id.start_time', string="安装日期")
- demolition_date = fields.Date(related='property_meter_water_id.end_time', string="拆除日期")
+ unit_number = fields.Integer(related='property_meter_water_id.unit_number', string="单元编号/用途")
+ start_date = fields.Date(string="开始日期")
+ end_date = fields.Date(string="结束日期")
epitope_values_id = fields.Many2one(related='property_meter_water_id.epitope_values_id', string="位置")
yuthon_property_id = fields.Many2one('yuthon.property', string="物业管理")
+ @api.depends('property_meter_water_id')
+ def _compute_date(self):
+ for record in self:
+ if record.property_meter_water_id.yuthon_property_ids:
+ contract_id = record.env['property.lease.contract.line'].search(
+ [('address_id', '=', record.property_meter_water_id.yuthon_property_ids[0].id),
+ ('lease_id.contact_state', '=', 'ing')])
+ if contract_id:
+ record.start_date = contract_id[0].term_start_time
+ record.end_date = contract_id[0].term_end_time
+
+
# 水表跳转
def detail(self):
return {
@@ -612,12 +624,21 @@ class YuthonPropertyEnergy(models.Model):
property_meter_archives_id = fields.Many2one('property.meter.archives', string="电表编号")
rate = fields.Integer(related='property_meter_archives_id.gauge_magnification', string="倍率", store=True)
- standard_id = fields.Many2one(related='property_meter_archives_id.standards_id', string="标准", store=True)
- installation_date = fields.Date(related='property_meter_archives_id.start_time', string="安装日期")
- demolition_date = fields.Date(related='property_meter_archives_id.end_time', string="拆除日期")
+ unit_number = fields.Integer(related='property_meter_archives_id.unit_number', string="单元编号/用途")
+ start_date = fields.Date(string="开始日期", compute='_compute_date')
+ end_date = fields.Date(string="结束日期", compute='_compute_date')
epitope_values_id = fields.Many2one(related='property_meter_archives_id.epitope_values_id', string="位置")
yuthon_property_id = fields.Many2one('yuthon.property', string="物业管理")
+ @api.depends('property_meter_archives_id')
+ def _compute_date(self):
+ for record in self:
+ if record.property_meter_water_id.yuthon_property_ids:
+ contract_id = record.env['property.lease.contract.line'].search([('address_id', '=', record.property_meter_archives_id.yuthon_property_ids[0].id), ('lease_id.contact_state', '=', 'ing')])
+ if contract_id:
+ record.start_date = contract_id[0].term_start_time
+ record.end_date = contract_id[0].term_end_time
+
# 电表跳转
def detail(self):
return {
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index 160d341ba..33c9516c8 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -248,9 +248,9 @@
-
-
-
+
+
+
danger
@@ -264,9 +264,9 @@
-
-
-
+
+
+
diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
index 2a63f077a..c10374f42 100644
--- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py
+++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
@@ -531,7 +531,7 @@ class PropertyReconciliationWizard(models.Model):
class PropertyReconciliationLine(models.Model):
_name = 'property.reconciliation.line'
_description = '对账明细'
- _order = 'collection_type desc, due_date desc'
+ _order = 'due_date desc'
reconciliation_id = fields.Many2one('property.reconciliation.wizard', string='关联对账单弹窗')
sequence = fields.Integer(string='顺序')