diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py
index 45a8a4829..91ef2d51a 100644
--- a/yuthon_hr_attendance/controllers/applet_attendance.py
+++ b/yuthon_hr_attendance/controllers/applet_attendance.py
@@ -744,8 +744,8 @@ class AppletAttendance(Controller):
_logger.info("----------------/yuthon/meter/reading---------接口收到请求-------------------------------")
# 获取需要推送的电表和水表记录
- electric_records = request.env(user=SUPERUSER_ID)['property.meter.archives'].search([('is_push', '=', True), ('archives_state', '=', 'use'), ('current_read', '=', 0)])
- water_records = request.env(user=SUPERUSER_ID)['property.meter.water'].search([('is_push', '=', True), ('water_state', '=', 'use'), ('current_read', '=', 0)])
+ electric_records = request.env(user=SUPERUSER_ID)['meter.archives.line'].search([('archives_state', '=', 'use'), ('current_read', '=', 0)])
+ water_records = request.env(user=SUPERUSER_ID)['meter.water.line'].search([('water_state', '=', 'use'), ('current_read', '=', 0)])
all_records = []
diff --git a/yuthon_hr_attendance/models/resource_calendar_leaves.py b/yuthon_hr_attendance/models/resource_calendar_leaves.py
index dcca6b30a..da169853d 100644
--- a/yuthon_hr_attendance/models/resource_calendar_leaves.py
+++ b/yuthon_hr_attendance/models/resource_calendar_leaves.py
@@ -31,6 +31,7 @@ class ResourceCalendar(models.Model):
# store=True, index=True, string="哺乳期人员")
breastfeeding_holiday_ids = fields.One2many('breastfeeding.holiday', 'resource_calendar_id', string='哺乳假明细')
+
def get_baidu_holiday(self):
"""
通过百度日历接口获取法定节假日信息
@@ -117,8 +118,8 @@ class BreastfeedingHolidaye(models.Model):
resource_calendar_id = fields.Many2one('resource.calendar')
employee_id = fields.Many2one('hr.employee', string="员工")
breastfeeding_type = fields.Selection([('1', '上午'), ('2', '下午')], string="类型")
- calendar_start_time = fields.Datetime(string="假期开始时间")
- calendar_end_time = fields.Datetime(string="假期结束时间")
+ calendar_start_time = fields.Date(string="假期开始时间")
+ calendar_end_time = fields.Date(string="假期结束时间")
class ResourceCalendarHolidaye(models.Model):
_name = "resource.calendar.holiday"
diff --git a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml
index 9743f92aa..c3f29e939 100644
--- a/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml
+++ b/yuthon_hr_attendance/views/resource_calendar_leaves_views.xml
@@ -26,11 +26,11 @@
-
+
-
+
diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py
index 8e0c15287..f3ac1d5d9 100644
--- a/yuthon_property/models/property_meter_archives.py
+++ b/yuthon_property/models/property_meter_archives.py
@@ -18,20 +18,12 @@ class PropertyMeterArchives(models.Model):
employee_ids = fields.Many2many('hr.employee', string='抄表人')
epitope_values = fields.Char(string='表位置')
other = fields.Char(string='其他')
- meter_date = fields.Date(string='任务日期')
- last_dosage = fields.Float(string='上次用量')
- last_read = fields.Float(string='上次读数')
- last_meter = fields.Date(string='上次抄表日期')
- current_meter = fields.Float(string='本次用量', tracking=True)
- current_read = fields.Float(string='本次读数', tracking=True)
unit = fields.Float(string='当月单价')
archives_state = fields.Selection([('stop', '停用'), ('use', '正常'), ('rent', '出租')], string='状态', compute='_compute_archives_state', store=True, default='use')
is_push = fields.Boolean(string='已推送')
start_time = fields.Date(string="安装日期")
end_time = fields.Date(string="拆除日期")
line_loss = fields.Float(string="线损", default=0.02)
- receivables = fields.Float(string="应收", compute='_compute_receivables', store=True)
- 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='明细行')
@@ -45,11 +37,6 @@ class PropertyMeterArchives(models.Model):
else:
record.lessee_id = False
- @api.depends('line_loss', 'current_meter', 'unit')
- def _compute_receivables(self):
- for record in self:
- if record.line_loss and record.current_meter and record.unit:
- record.receivables = record.current_meter * record.unit * (1 + record.line_loss) * record.gauge_magnification
def format_update(self):
insurances_ids = self.env["property.meter.archives"].browse(
@@ -202,10 +189,14 @@ class MeterArchivesLine(models.Model):
@api.depends('current_read', 'last_read')
def _compute_current_meter(self):
for record in self:
- if record.current_read and record.last_read:
+ if record.current_read > record.last_read:
record.current_meter = record.current_read - record.last_read
else:
- record.current_meter = 0
+ if record.maximum_count > 0:
+ max_value = 10 ** record.maximum_count - 1
+ record.current_meter = max_value - record.last_read + record.current_read
+ else:
+ record.current_meter = 0
@api.depends('yuthon_property_ids')
def _compute_lessee_id(self):
diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py
index b6476eb26..37af4f631 100644
--- a/yuthon_property/models/property_meter_water.py
+++ b/yuthon_property/models/property_meter_water.py
@@ -17,18 +17,11 @@ class PropertyMeterWater(models.Model):
employee_ids = fields.Many2many('hr.employee', string='抄表人')
epitope_values = fields.Char(string='表位置')
other = fields.Char(string='其他')
- meter_date = fields.Date(string='任务日期')
- last_dosage = fields.Float(string='上次用量')
- last_read = fields.Float(string='上次读数')
- last_meter = fields.Date(string='上次抄表日期')
unit = fields.Float(string='当月单价')
- current_meter = fields.Float(string='本次用量', tracking=True)
- current_read = fields.Float(string='本次读数', tracking=True)
is_push = fields.Boolean(string='已推送')
start_time = fields.Date(string="安装日期")
end_time = fields.Date(string="拆除日期")
line_loss = fields.Float(string="线损", default=0.05)
- receivables = fields.Float(string="应收", compute='_compute_receivables', store=True)
last_reading_time = fields.Date(string="最后读数时间")
water_state = fields.Selection([('stop', '停用'), ('use', '使用'), ('rent', '出租')], string='状态', compute='_compute_water_state', store=True)
standards_id = fields.Many2one('yuthon.electricity.setting', string='标准')
@@ -52,13 +45,6 @@ class PropertyMeterWater(models.Model):
else:
record.lessee_id = False
- @api.depends('line_loss', 'current_meter', 'unit')
- def _compute_receivables(self):
- for record in self:
- if record.line_loss and record.current_meter and record.unit:
- record.receivables = record.current_meter * record.unit * (1 + record.line_loss) * record.gauge_magnification
-
-
@api.depends('lessee_id')
def _compute_water_state(self):
for record in self:
@@ -90,19 +76,6 @@ class PropertyMeterWater(models.Model):
else:
record.water_state = 'use'
- @api.onchange('current_read', 'last_read')
- def _onchange_current_meter(self):
- for record in self:
- if record.current_read > record.last_read:
- record.current_meter = record.current_read - record.last_read
- else:
- if record.maximum_count > 0:
- max_value = 10 ** record.maximum_count - 1
- record.current_meter = max_value - record.last_read + record.current_read
- else:
- record.current_meter = 0
-
-
@api.onchange('yuthon_property_ids')
def _onchange_property(self):
if self.yuthon_property_ids:
@@ -180,10 +153,14 @@ class MeterWaterLine(models.Model):
@api.depends('current_read', 'last_read')
def _compute_current_meter(self):
for record in self:
- if record.current_read and record.last_read:
+ if record.current_read > record.last_read:
record.current_meter = record.current_read - record.last_read
else:
- record.current_meter = 0
+ if record.maximum_count > 0:
+ max_value = 10 ** record.maximum_count - 1
+ record.current_meter = max_value - record.last_read + record.current_read
+ else:
+ record.current_meter = 0
@api.depends('yuthon_property_ids')
def _compute_lessee_id(self):
diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml
index b5d09feb3..7c8f59ad1 100644
--- a/yuthon_property/views/property_meter_archives_views.xml
+++ b/yuthon_property/views/property_meter_archives_views.xml
@@ -14,15 +14,8 @@
-
-
-
-
-
-
-
@@ -58,12 +51,6 @@
-
-
-
-
-
-
@@ -139,9 +126,6 @@
-
-
-
diff --git a/yuthon_property/views/property_meter_water_views.xml b/yuthon_property/views/property_meter_water_views.xml
index d8df4af61..bfa3a512f 100644
--- a/yuthon_property/views/property_meter_water_views.xml
+++ b/yuthon_property/views/property_meter_water_views.xml
@@ -15,15 +15,8 @@
-
-
-
-
-
-
-
@@ -61,12 +54,6 @@
-
-
-
-
-
-
@@ -140,9 +127,6 @@
-
-
-