diff --git a/fusion_plating/CLAUDE.md b/fusion_plating/CLAUDE.md index 029037e6..b5cfdef9 100644 --- a/fusion_plating/CLAUDE.md +++ b/fusion_plating/CLAUDE.md @@ -366,8 +366,8 @@ rewrite code as new requirements surface. Each sub-project has its own design do ### Sub-Project Roadmap | # | Sub-project | Status | Gaps | |---|---|---|---| -| 1 | Direct Order Wizard fix (no auto-confirm/auto-email) | Pending | Gap 1 | -| 2 | Part Data Model Overhaul (part#/rev required, dual descriptions, per-part cert requirement, SKU→Part Number on customer docs) | Design approved 2026-04-21 | 2b, 2c, 2d, 4 | +| 1 | Direct Order Wizard fix (no auto-confirm/auto-email) | **Shipped 2026-04-22** (commit afd8bae+) | Gap 1 | +| 2 | Part Data Model Overhaul (part#/rev required, dual descriptions, per-part cert requirement, SKU→Part Number on customer docs) | **Shipped 2026-04-22** (commits 868b418..afd8bae) | 2b, 2c, 2d, 4 | | 3 | Default Process + Composer per part (reuse recipe tree) | Pending | 2e, 2f | | 4 | Contract Review two-portion workflow (QA Assistant + QA Manager; pre-production gate) | Pending | 2i | | 5 | Order-line fields (serial, job#, thickness dropdown, revision picker) | Pending | 5, 6, Q2 | 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 1f172c4e..8df36270 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 @@ -10,9 +10,12 @@ from odoo.exceptions import UserError class FpDirectOrderWizard(models.TransientModel): """Direct order entry for repeat customers. - Skips the quotation stage when the customer has already sent a PO. - Creates a sale.order with one sale.order.line per wizard line and - calls action_confirm() in one step. + Creates a sale.order (in draft / quotation state) with one + sale.order.line per wizard line. The user reviews the resulting + quotation, makes any adjustments, and clicks Send / Confirm + manually. The wizard does NOT auto-confirm and does NOT auto-email + the customer — that was deliberately removed in Sub 1 after the + client requested a review step before anything leaves the shop. """ _name = 'fp.direct.order.wizard' _description = 'Fusion Plating - Direct Order Entry' @@ -180,7 +183,13 @@ class FpDirectOrderWizard(models.TransientModel): } def action_create_order(self): - """Create and confirm the sale order with one SO line per wizard line.""" + """Create a DRAFT sale order with one SO line per wizard line. + + Returns an action that opens the newly-created SO in form view so + the user can review, adjust, and manually confirm / send. The + wizard deliberately does not auto-confirm or auto-email — see + Sub 1 in the Fine-Tuning Initiative roadmap (CLAUDE.md). + """ self.ensure_one() if not self.line_ids: raise UserError(_('Add at least one part line before confirming.')) @@ -272,9 +281,10 @@ class FpDirectOrderWizard(models.TransientModel): 'x_fc_quote_id': line.quote_id.id or False, })) - # 5. Create + confirm + # 5. Create — stays in draft / quotation. Sub 1: user reviews + # and manually clicks Confirm / Send. No auto-confirm, no + # auto-email to the client. so = self.env['sale.order'].create(so_vals) - so.action_confirm() # 6. Push-to-defaults (C4) — uses the resolved part cached # during the build loop so rev-bumped lines write defaults to @@ -290,8 +300,8 @@ class FpDirectOrderWizard(models.TransientModel): 'x_fc_default_treatment_ids': [(6, 0, line.treatment_ids.ids)], }) so.message_post(body=_( - 'Direct order created from PO %s with %d line(s). ' - 'Quotation stage skipped.' + 'Quotation created from PO %s with %d line(s). ' + 'Review and confirm manually when ready.' ) % (self.po_number, len(self.line_ids))) return {