# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. # License OPL-1 (Odoo Proprietary License v1.0) # Part of the Fusion Plating product family. # # Sub 5 — attach delivery reverse link to fp.serial. Lives here rather # than in fusion_plating_configurator because fusion.plating.delivery # is defined in this module, which loads after configurator. from odoo import api, fields, models class FpSerial(models.Model): _inherit = 'fp.serial' delivery_ids = fields.One2many( 'fusion.plating.delivery', 'x_fc_serial_id', string='Deliveries', ) delivery_count = fields.Integer(compute='_compute_delivery_count') @api.depends('delivery_ids') def _compute_delivery_count(self): for rec in self: rec.delivery_count = len(rec.delivery_ids)