diff --git a/fusion_plating/fusion_plating_configurator/tests/test_express_line_fields.py b/fusion_plating/fusion_plating_configurator/tests/test_express_line_fields.py new file mode 100644 index 00000000..cb14d8cd --- /dev/null +++ b/fusion_plating/fusion_plating_configurator/tests/test_express_line_fields.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Express Orders — Task A2 schema tests +from odoo.tests.common import TransactionCase, tagged + + +@tagged('post_install', '-at_install', 'fp_express') +class TestExpressLineFields(TransactionCase): + def test_new_fields_exist(self): + Line = self.env['fp.direct.order.line'] + self.assertIn('customer_line_ref', Line._fields) + self.assertIn('masking_enabled', Line._fields) + self.assertIn('bake_instructions', Line._fields) + + def test_masking_default_true(self): + partner = self.env['res.partner'].create({'name': 'Cust'}) + wiz = self.env['fp.direct.order.wizard'].create({'partner_id': partner.id}) + line = self.env['fp.direct.order.line'].create({ + 'wizard_id': wiz.id, + 'quantity': 1, + }) + self.assertTrue(line.masking_enabled) + self.assertFalse(line.customer_line_ref) + self.assertFalse(line.bake_instructions) diff --git a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_line.py b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_line.py index 9b18340c..a4d85f5e 100644 --- a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_line.py +++ b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_line.py @@ -459,6 +459,24 @@ class FpDirectOrderLine(models.Model): 'or from the part\'s default range.', ) + # ---- Express Orders per-line flags (2026-05-26) ---- + customer_line_ref = fields.Char( + string='Customer Line Job #', + help='Per-line customer sub-reference (e.g. ABC, DEF). Distinct from ' + 'the order-level Customer Job #. Prints on customer docs.', + ) + masking_enabled = fields.Boolean( + string='Masking Enabled', + default=True, + help='When False, masking + de-masking recipe nodes are opted out ' + 'when the job is created.', + ) + bake_instructions = fields.Text( + string='Bake Instructions', + help='Free-text bake instructions. Empty = bake steps are opted out. ' + 'Non-empty = bake step instructions on the operator tablet.', + ) + # ---- Computes ---- @api.depends('quantity', 'unit_price') def _compute_line_subtotal(self):