chore(plating): de-dash fusion_plating_iot too
Same em-dash -> hyphen sweep applied to fusion_plating_iot (lives under fusion_iot/ so the main commit missed it). Comments/strings only; no functional dashes in this module. Keeps git in sync with the in-place de-dash already applied to entech. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
"""Post-install hook — backfill new fields on existing live sensors.
|
||||
"""Post-install hook - backfill new fields on existing live sensors.
|
||||
|
||||
Runs once on every install/upgrade. Idempotent: checks before writing
|
||||
so re-runs don't overwrite user-edited values.
|
||||
|
||||
What it does:
|
||||
1. Populates `uuid` on any fp.tank.sensor record that doesn't have one
|
||||
(for sensors created BEFORE the uuid field existed — the create
|
||||
(for sensors created BEFORE the uuid field existed - the create
|
||||
override only covers new records).
|
||||
2. Sets a default `sensor_type_id` on sensors that don't have one yet,
|
||||
inferring from `device_kind` (DS18B20 / PT100 / PT1000 → Temperature,
|
||||
@@ -78,7 +78,7 @@ def _backfill_sensor_types(env):
|
||||
|
||||
|
||||
def _seed_entech_tanks_and_sensors(env):
|
||||
"""Sub 7 — seed 25 tanks (5 small + 20 big; 10 big inactive) with
|
||||
"""Sub 7 - seed 25 tanks (5 small + 20 big; 10 big inactive) with
|
||||
one temperature and one pH sensor each.
|
||||
|
||||
Idempotent: tanks keyed by `code` so re-runs skip existing rows.
|
||||
@@ -103,7 +103,7 @@ def _seed_entech_tanks_and_sensors(env):
|
||||
|
||||
facility = Facility.search([], limit=1)
|
||||
if not facility:
|
||||
_logger.warning('Sub 7 seed: no fusion.plating.facility found — '
|
||||
_logger.warning('Sub 7 seed: no fusion.plating.facility found - '
|
||||
'skipping tank seed. Create a facility first.')
|
||||
return
|
||||
|
||||
@@ -117,7 +117,7 @@ def _seed_entech_tanks_and_sensors(env):
|
||||
)
|
||||
if not temp_param or not ph_param:
|
||||
_logger.warning('Sub 7 seed: temperature / pH bath parameters '
|
||||
'not found — skipping. Seed bath parameters first.')
|
||||
'not found - skipping. Seed bath parameters first.')
|
||||
return
|
||||
|
||||
plan = []
|
||||
@@ -147,7 +147,7 @@ def _seed_entech_tanks_and_sensors(env):
|
||||
('parameter_id.parameter_type', '=', 'temperature'),
|
||||
]):
|
||||
Sensor.create({
|
||||
'name': '%s — Temperature' % tank.name,
|
||||
'name': '%s - Temperature' % tank.name,
|
||||
'tank_id': tank.id,
|
||||
'parameter_id': temp_param.id,
|
||||
'device_kind': 'ds18b20',
|
||||
@@ -160,7 +160,7 @@ def _seed_entech_tanks_and_sensors(env):
|
||||
('parameter_id.parameter_type', '=', 'ph'),
|
||||
]):
|
||||
Sensor.create({
|
||||
'name': '%s — pH' % tank.name,
|
||||
'name': '%s - pH' % tank.name,
|
||||
'tank_id': tank.id,
|
||||
'parameter_id': ph_param.id,
|
||||
'device_kind': 'ph',
|
||||
|
||||
Reference in New Issue
Block a user