From cfe776be4c40f6e7d5b83b588f1bfdf4d5580dd7 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Mon, 27 Apr 2026 20:27:35 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20session=20housekeeping=20=E2=80=94=20t?= =?UTF-8?q?ank=20UX,=20plating=20menu=20defaults,=20WO=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fusion_plating: tank field labels (Code → Tank Number, Tank → Tank Name) + state-control header buttons (Mark Empty/Filled/In Use/Draining/ Maintenance/Out of Service) with chatter audit logging. - fusion_plating_configurator: Plating app default landing screen = Sale Orders, while keeping menu name as 'Plating'. - fusion_plating_jobs: SO smart-button label 'Plating Jobs' → 'WO'. Already deployed and verified on entech earlier in the session. Co-Authored-By: Claude Opus 4.7 (1M context) --- fusion_plating/fusion_plating/__manifest__.py | 2 +- .../fusion_plating/models/fp_tank.py | 31 +++++++++++++++++-- .../fusion_plating/views/fp_tank_views.xml | 20 +++++++++++- .../__manifest__.py | 2 +- .../views/fp_configurator_menu.xml | 5 +++ .../fusion_plating_jobs/__manifest__.py | 2 +- .../views/sale_order_views.xml | 2 +- 7 files changed, 57 insertions(+), 7 deletions(-) diff --git a/fusion_plating/fusion_plating/__manifest__.py b/fusion_plating/fusion_plating/__manifest__.py index a8b88b1f..996a73c6 100644 --- a/fusion_plating/fusion_plating/__manifest__.py +++ b/fusion_plating/fusion_plating/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Plating', - 'version': '19.0.9.2.0', + 'version': '19.0.9.3.0', 'category': 'Manufacturing/Plating', 'summary': 'Core plating / metal finishing ERP: facilities, processes, tanks, baths, jobs, operators.', 'description': """ diff --git a/fusion_plating/fusion_plating/models/fp_tank.py b/fusion_plating/fusion_plating/models/fp_tank.py index 20d0b321..acd9b0f0 100644 --- a/fusion_plating/fusion_plating/models/fp_tank.py +++ b/fusion_plating/fusion_plating/models/fp_tank.py @@ -22,12 +22,12 @@ class FpTank(models.Model): _order = 'facility_id, work_center_id, sequence, code' name = fields.Char( - string='Tank', + string='Tank Name', required=True, tracking=True, ) code = fields.Char( - string='Code', + string='Tank Number', required=True, tracking=True, help='Short unique tank identifier (e.g. "T-01", "EN-A1").', @@ -174,3 +174,30 @@ class FpTank(models.Model): if not vals.get('qr_code') and vals.get('code'): vals['qr_code'] = f"FP-TANK:{vals['code']}" return super().create(vals_list) + + # ----- State transition actions --------------------------------------- + def _set_state(self, new_state, message): + for rec in self: + old = dict(rec._fields['state'].selection).get(rec.state, rec.state) + new = dict(rec._fields['state'].selection).get(new_state, new_state) + rec.state = new_state + rec.message_post(body=f"{message} ({old} → {new}) by {self.env.user.name}") + return True + + def action_set_empty(self): + return self._set_state('empty', 'Tank marked Empty') + + def action_set_filled(self): + return self._set_state('filled', 'Tank marked Filled') + + def action_set_in_use(self): + return self._set_state('in_use', 'Tank marked In Use') + + def action_set_draining(self): + return self._set_state('draining', 'Tank marked Draining') + + def action_set_maintenance(self): + return self._set_state('maintenance', 'Tank marked for Maintenance') + + def action_set_out_of_service(self): + return self._set_state('out_of_service', 'Tank marked Out of Service') diff --git a/fusion_plating/fusion_plating/views/fp_tank_views.xml b/fusion_plating/fusion_plating/views/fp_tank_views.xml index d0a163d4..02f18d8c 100644 --- a/fusion_plating/fusion_plating/views/fp_tank_views.xml +++ b/fusion_plating/fusion_plating/views/fp_tank_views.xml @@ -35,6 +35,24 @@
+
@@ -42,7 +60,7 @@
-