folder rename
This commit is contained in:
72
fusion_plating/fusion_plating/models/fp_work_center.py
Normal file
72
fusion_plating/fusion_plating/models/fp_work_center.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FpWorkCenter(models.Model):
|
||||
"""A production line or station inside a facility.
|
||||
|
||||
Examples: "Line 1 - EN", "Anodize Line", "Prep Bay", "Bake Station",
|
||||
"Inspection Booth", "Shipping Dock". Work centers group tanks and
|
||||
provide scheduling capacity.
|
||||
"""
|
||||
_name = 'fusion.plating.work.center'
|
||||
_description = 'Fusion Plating — Work Center'
|
||||
_order = 'facility_id, sequence, name'
|
||||
|
||||
name = fields.Char(
|
||||
string='Work Center',
|
||||
required=True,
|
||||
)
|
||||
code = fields.Char(
|
||||
string='Code',
|
||||
required=True,
|
||||
)
|
||||
facility_id = fields.Many2one(
|
||||
'fusion.plating.facility',
|
||||
string='Facility',
|
||||
required=True,
|
||||
ondelete='cascade',
|
||||
)
|
||||
sequence = fields.Integer(
|
||||
string='Sequence',
|
||||
default=10,
|
||||
)
|
||||
active = fields.Boolean(
|
||||
string='Active',
|
||||
default=True,
|
||||
)
|
||||
supported_process_ids = fields.Many2many(
|
||||
'fusion.plating.process.type',
|
||||
'fp_work_center_process_rel',
|
||||
'work_center_id',
|
||||
'process_type_id',
|
||||
string='Supported Processes',
|
||||
)
|
||||
tank_ids = fields.One2many(
|
||||
'fusion.plating.tank',
|
||||
'work_center_id',
|
||||
string='Tanks',
|
||||
)
|
||||
tank_count = fields.Integer(
|
||||
compute='_compute_tank_count',
|
||||
)
|
||||
capacity_per_day = fields.Float(
|
||||
string='Capacity / Day',
|
||||
help='Theoretical throughput (parts, jobs, or square metres per day) — unit depends on shop.',
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
'fp_work_center_code_facility_uniq',
|
||||
'unique(code, facility_id)',
|
||||
'Work center code must be unique within a facility.',
|
||||
),
|
||||
]
|
||||
|
||||
def _compute_tank_count(self):
|
||||
for rec in self:
|
||||
rec.tank_count = len(rec.tank_ids)
|
||||
Reference in New Issue
Block a user