feat(configurator): stub fp.direct.order.line model for multi-line direct order wizard

Task A1 of the direct-order-wizard rewrite. Adds the transient line
model that will hold per-part detail (part, coating, qty, price) when
the wizard moves from single-line to header+lines architecture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-19 20:29:52 -04:00
parent 7a53012f09
commit b4558a223c
3 changed files with 49 additions and 0 deletions

View File

@@ -3,4 +3,5 @@
# License OPL-1 (Odoo Proprietary License v1.0)
from . import fp_direct_order_wizard
from . import fp_direct_order_line
from . import fp_part_catalog_import_wizard

View File

@@ -0,0 +1,46 @@
# -*- 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 api, fields, models
class FpDirectOrderLine(models.TransientModel):
_name = 'fp.direct.order.line'
_description = 'Fusion Plating - Direct Order Line'
_order = 'sequence, id'
wizard_id = fields.Many2one(
'fp.direct.order.wizard',
required=True,
ondelete='cascade',
)
sequence = fields.Integer(default=10)
part_catalog_id = fields.Many2one(
'fp.part.catalog',
string='Part',
required=True,
)
coating_config_id = fields.Many2one(
'fp.coating.config',
string='Primary Treatment',
required=True,
)
quantity = fields.Integer(string='Qty', default=1, required=True)
currency_id = fields.Many2one(related='wizard_id.currency_id')
unit_price = fields.Monetary(
string='Unit Price',
currency_field='currency_id',
)
line_subtotal = fields.Monetary(
string='Subtotal',
currency_field='currency_id',
compute='_compute_line_subtotal',
)
@api.depends('quantity', 'unit_price')
def _compute_line_subtotal(self):
for rec in self:
rec.line_subtotal = (rec.quantity or 0) * (rec.unit_price or 0.0)