From de6336ba42a13e83d24e0715e09c9ca8bdd2592d Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Wed, 27 May 2026 10:36:48 -0400 Subject: [PATCH] changes --- .../models/res_partner.py | 15 +++++++++++ .../static/src/scss/express_order.scss | 25 +++++++++++++++++++ .../wizard/fp_direct_order_wizard.py | 9 +++++++ 3 files changed, 49 insertions(+) diff --git a/fusion_plating/fusion_plating_configurator/models/res_partner.py b/fusion_plating/fusion_plating_configurator/models/res_partner.py index 3a7d9930..a2c2156e 100644 --- a/fusion_plating/fusion_plating_configurator/models/res_partner.py +++ b/fusion_plating/fusion_plating_configurator/models/res_partner.py @@ -16,6 +16,21 @@ class ResPartner(models.Model): string='Parts', compute='_compute_part_count', ) + # Default lead-time band for new Express Orders. Set once per + # customer in their Plating profile; auto-copies onto every new + # Express Order via the partner-onchange on fp.direct.order.wizard. + x_fc_default_lead_time_min_days = fields.Integer( + string='Default Lead Time Min (days)', + default=0, + help='Pre-fills the Lead Time Min field on new Express Orders ' + 'for this customer. Operator can override per-order.', + ) + x_fc_default_lead_time_max_days = fields.Integer( + string='Default Lead Time Max (days)', + default=0, + help='Pre-fills the Lead Time Max field on new Express Orders ' + 'for this customer. Operator can override per-order.', + ) def _compute_part_count(self): for partner in self: diff --git a/fusion_plating/fusion_plating_configurator/static/src/scss/express_order.scss b/fusion_plating/fusion_plating_configurator/static/src/scss/express_order.scss index 347b0305..7bba3b1b 100644 --- a/fusion_plating/fusion_plating_configurator/static/src/scss/express_order.scss +++ b/fusion_plating/fusion_plating_configurator/static/src/scss/express_order.scss @@ -165,6 +165,31 @@ .o_fp_xpr_cell.span-2 { grid-column: span 2; } .o_fp_xpr_cell.row-span-2 { grid-row: span 2; } .o_fp_xpr_cell.row-span-4 { grid-row: span 4; } + .o_fp_xpr_cell.row-span-6 { grid-row: span 6; } + + // Cells with a toggle-style field — label sits inline with the + // toggle instead of stacked above. Used by Blanket Sales Order + // (matches the mockup's compact toggle row). Toggle anchored + // next to the label so layout doesn't shift when the secondary + // "Block partial" toggle appears. + .o_fp_xpr_cell.o_fp_xpr_inline_label { + flex-direction: row; + align-items: center; + gap: 10px; + min-height: 32px; + + > label { + margin-bottom: 0; + white-space: nowrap; + flex: 0 0 auto; + } + > .o_fp_xpr_inline_pair { + flex: 0 0 auto; + display: flex; + align-items: center; + gap: 10px; + } + } .o_fp_xpr_cell.required > label::after { content: " *"; color: $xpr-bad; diff --git a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py index d9f707e3..6bf4ad73 100644 --- a/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py +++ b/fusion_plating/fusion_plating_configurator/wizard/fp_direct_order_wizard.py @@ -488,6 +488,15 @@ class FpDirectOrderWizard(models.Model): self.deposit_percent = partner.x_fc_default_deposit_percent if partner.x_fc_default_delivery_method: self.delivery_method = partner.x_fc_default_delivery_method + # Lead-time default band — set once per customer in their + # Plating profile, auto-copies onto every new Express Order. + # Only fills when the operator hasn't already typed a value. + if (partner.x_fc_default_lead_time_min_days + and not self.lead_time_min_days): + self.lead_time_min_days = partner.x_fc_default_lead_time_min_days + if (partner.x_fc_default_lead_time_max_days + and not self.lead_time_max_days): + self.lead_time_max_days = partner.x_fc_default_lead_time_max_days # Deadline auto-fill — anchored to planned_start_date with today # as fallback. Honours explicit deadlines the user already typed.