Commit Graph

9 Commits

Author SHA1 Message Date
8ae586cca6 feat: Auto-create ows.machine on equipment import/create
- Add @api.model_create_multi hook to MaintenanceEquipment.create()
- Add load() override to handle Excel/CSV import correctly
- Add _create_missing_ows_machines() helper with recursion prevention
- Modify OwsMachine.create() to only create equipment if equipment_id not provided
- Use context flag 'skip_ows_machine_creation' to prevent infinite recursion
- Fixes: Equipment import now auto-creates ows.machine and displays OWS tab
- Migration tested: Compatible with SQL-based post-migration (23/23 machines migrated)
2025-12-19 20:12:54 +01:00
4c048b5ca9 fix(ows_models): Update create() to use @api.model_create_multi for Odoo 18
Fixed DeprecationWarning by updating OwsMachine.create() method:
- Changed from @api.model with single vals parameter
- To @api.model_create_multi with vals_list parameter
- Now supports batch creation of multiple records
- Removed duplicate empty OwsMachineArea class definition

This resolves the Odoo 18 deprecation warning about create method not supporting batch operations.
2025-12-15 20:55:36 +01:00
686b201792 docs(migration): Add comments explaining related field synchronization
Added documentation to clarify:
- Why store=True is used for related fields (performance for filtering/searching)
- Why manual synchronization is needed in migration (related fields don't auto-sync during SQL INSERT)

No functional changes, only improved code documentation.
2025-12-15 20:46:14 +01:00
1b203eeb10 feat(equipment-view): Integrate OWS into Maintenance menu with Equipment-centric views
- Extended maintenance.equipment model with Related fields to ows.machine
  - ows_machine_id: One2many inverse relation
  - ows_category: Related to machine category (editable, stored)
  - ows_area_id: Related to machine area (editable, stored)
  - ows_product_ids: Related One2many for usage products
  - ows_training_ids: Related One2many for training products

- Equipment Form View Extensions:
  - Added ows_area_id and ows_category after location field
  - New 'Offene Werkstatt (Hobbyhimmel)' notebook page with:
    - Security section (category icon, category, area)
    - Usage products section (Nutzungsprodukte)
    - Training products section (Einweisungsprodukte)
  - Page visibility controlled by ows_machine_id existence

- Equipment List/Search View Extensions:
  - Added ows_category_icon and ows_area_id columns
  - Added OWS search fields (area, category)
  - Added category filters (green/yellow/red)
  - Added OWS grouping options (by area, by category)

- Menu Structure Migration:
  - Removed standalone 'Ausrüstung' top-level menu
  - Integrated all OWS config into Maintenance → Configuration:
    - Bereiche (Areas)
    - Zuordnungen (Assignments) container
      - Nutzungsprodukte (Usage Products)
      - Einweisungsprodukte (Training Products)

- Created simplified tree views for Equipment context:
  - view_ows_machine_product_tree_simple (no machine_id column)
  - view_ows_machine_training_tree_simple (no machine_id column)

- Freed location field from automatic area synchronization:
  - Removed area → location mapping in create()/write()
  - location now available for detailed physical location info
  - ows_area_id provides workspace area assignment

BREAKING CHANGE: Standalone OWS menu removed, all features now in Maintenance app
UX IMPROVEMENT: Single Equipment view shows all data, no split views needed
2025-12-13 17:43:07 +01:00
42db76a9c7 feat: Improve equipment creation flow and UX
- Made location field readonly in maintenance.equipment view
- Hide equipment_id field in machine form (auto-created)
- Name and serial_no now directly editable in machine form
- Area is now required field
- Location automatically synced from area to equipment
- Equipment auto-created on machine save with all fields
- Renamed menu from 'Maschinen' to 'Ausrüstung'
- Improved user flow: No need to switch between views

Changes:
- Added maintenance_equipment_views.xml for readonly location
- Updated create() to always auto-create equipment
- Enhanced write() to sync name/serial_no changes to equipment
- Menu labels updated to 'Ausrüstung'
2025-12-07 21:33:06 +01:00
8fb58c744e feat: Migrate to maintenance.equipment with automated OpenUpgrade workflow
- Integrated maintenance.equipment using _inherits pattern in open_workshop_base
- Removed duplicate fields (code, description, storage_location, purchase_price, purchase_date)
- Delegated equipment management to OCA maintenance module
- Added Smart Button UI pattern for equipment details
- Implemented automated migration workflow:
  * SQL script renames module open_workshop → open_workshop_base
  * Pre-migration: Installs maintenance, adds equipment_id column
  * Post-migration: Migrates 23 machines with proper JSONB names and locations
- Restored old open_workshop module (installable=False) for DB compatibility
- Updated CI/CD workflow with migration steps
- Area mapping corrected: area.name → equipment.location
- JSONB handling: Using SQL jsonb_build_object() for proper storage
- Serial numbers: From old code field or generated as OWS-{id}

Tested and verified:
 23 machines successfully migrated
 JSONB names extractable: name->>'de_DE' and name->>'en_US'
 Locations correctly mapped: Fablab, Holzbereich, etc.
 equipment_id linkage functional
2025-12-07 21:09:35 +01:00
3619526af0 Migration: open_workshop → open_workshop_base
- Modul umbenannt von open_workshop zu open_workshop_base
- Alle Referenzen im Code aktualisiert (Templates, Views, Assets)
- SQL-Migrationsskript für automatische DB-Migration erstellt
- post_init_hook hinzugefügt
- Version auf 18.0.1.0.3 erhöht
- Vorbereitung für modulare Architektur (Base, POS, API)

Fixes für Gitea Action Integration:
- SQL-Skript in open_workshop_base/migrations/
- Alter open_workshop/ Ordner entfernt
- Migrations-Workflow getestet auf hh18
2025-12-07 15:45:03 +01:00
58c7e8f258 Open Workshop Multi Module Refactoring 2025-12-07 14:03:32 +01:00
7cd458b72f This now a multi modul odoo repository, open_workshop moved to open_workshop_base 2025-12-06 20:45:29 +01:00