Modules / Orders
Sales orders
Turn an accepted quote into a confirmed order in one step, track what has been delivered, and invoice exactly what is due (on order or on delivery, with deposits up front) without anyone re-typing a line.
People ask for it as: “the customer said yes, now what”, “sales orders”, “order confirmation”, “invoice when we deliver”, “50% deposit up front”, “what's still to deliver”, “when can you deliver”, “returns and RMA numbers”, “year-end rebate”, “ship to a different address”, “free samples”, “stock held at the customer”, “invoice in stages”
Who uses it
| Role | Does | Sees |
|---|---|---|
| Sales | creates orders of any type (from a quote or by hand), confirms them, amends them before delivery, raises returns (RMAs) and credit or debit memo requests, tells the customer the promised dates | the orders they own; a holder of so:sales_order:read_all sees every order |
| Sales operations / the owner | approves amendments and cancellations of confirmed orders, overrides a credit hold, sets and releases delivery and billing blocks, keeps order types, condition records and rebate agreements, asks for a rebate settlement, sets order policy | every order |
| A second person for money going back (the finance controller, the owner) | approves credit and debit memo requests, free-of-charge orders above the limit and rebate settlements; never one they raised or set up (compared by email AND sign-in subject) | every order, condition and rebate agreement with its accruals |
| The owner or a finance controller | sets the controls on order takers (whether amendments need approval, whether an accepted quote confirms itself, the business time zone, which AI steps are on), each from a later date | every order |
| Whoever delivers (operations, the project lead, the warehouse) | records what has been delivered or done, line by line | confirmed orders to deliver; never prices |
| Whoever invoices | asks for the invoice of what is due, raises the deposit | every confirmed order |
| The customer | sends their purchase order, receives the confirmation | their own order confirmation, by email or the portal |
| The system | creates the order on acceptance, suggests a draft from a PO and compares a PO with the order, derives fulfilment and invoice status, numbers confirmed orders, locks finished orders, re-promises unconfirmed quantities, accrues rebates, records return inspections and supplier shipments reported by inventory and purchasing, imports the Odoo orders once | everything, through its own service account |
What it has to do
Reference user stories. Each has a test written into it — the given / when / then — which becomes an automated check once it is built. Expect to keep some, change some and drop some.
Things people do
SO-02As a sales rep, I want to raise an order by hand when there was no quote, so that a repeat order on the phone is still a real order.
Given a customer with bp_id 7311, active products, and COLA-075 sold by the bottle (C62) and the 24-pack (PK24) · when I add 2 x PK24 of COLA-075 and 3 hours (HUR) of SETUP and save · then a draft order dated today (in business_timezone; it cannot be dated earlier) exists; each line is priced by product's find_price(product_id, quantity, unit_code, bp_id, currency, priced_on = today), stores the price, the unit and its conversion, and priced_from (the list, rule and row the answer named), and is taxed by the tax module; nothing is typed but products, units and quantities; a unit the product does not sell in is refused
Sales · screen: Order · reference: not built
SO-03As a sales rep, I want to confirm an order, so that the customer and the team know it is committed.
Given a draft order, priced and taxed, for a customer not on credit hold · when I confirm it · then it gets the next number from the series (SO-2026-0001), its prices and tax are frozen, a confirmation goes to the customer when I send it; before I press confirm the order shows its readiness, each gate as {gate, met, reason, fix} (e.g. {gate: credit, met: false, reason: "on hold: 2 invoices over 60 days", fix: "ask an order admin to override"}); confirming with a gate unmet is refused with that reason, and a credit hold only an order admin overrides, with a reason
Sales · screen: Order · reference: not built
Usually different per customer: whether a PO from the customer is required before confirming
SO-04As a sales rep, I want to record the customer's purchase order number, so that their accounts payable team can match our invoice.
Given a customer whose order policy says "PO required" from 2026-11-01 (a dated row; a policy cannot start today or earlier, and a correction is a new row from a later date) · when I confirm without one on 2026-11-02 · then refused (gate po_ref, "this customer requires a PO number"); with PO-4471 it confirms and every invoice for the order carries PO-4471; on 2026-10-30 the policy did not yet apply
Sales · screen: Order · reference: not built
SO-05As a sales rep, I want to amend a confirmed order before it is delivered, so that a change of mind is a revision, not a new order.
Given a confirmed order with 10 units, none delivered or invoiced · when I change it to 12 units · then revision 2 exists with the reason; only the changed line is re-priced, by find_price with priced_on = today and a new priced_from; the other lines keep their price and source; approval by an order admin where the control asks for it, never by the rep who amended; reducing below what is already delivered or invoiced is refused (gate not_below_done)
Sales · screen: Order · reference: not built
SO-06As the order admin, I want to cancel an order with a reason, so that the pipeline and the books stop expecting it.
Given a confirmed order with nothing delivered or invoiced · when I cancel it with the reason "customer withdrew" · then it is cancelled, keeps its number, and asks invoicing to cancel any draft it requested; an order with a delivery or an issued invoice cannot be cancelled ("credit the invoice, then close the order")
Sales operations / the owner · screen: Order · reference: not built
SO-07As the person who delivers, I want to record what was delivered or done, line by line, so that invoicing on delivery bills exactly that.
Given a confirmed order with 12 units of a delivered-policy product · when I record 5 delivered on 2026-11-20 with delivery note DN-118 · then the line shows 5 of 12 delivered, the order shows "partly delivered", 5 units become invoiceable; recording the same delivery note twice records it once; delivering more than ordered, or dating a delivery after today or before the confirmation, is refused; a mistake is corrected by a new correction row (DN-118-C, -2 against DN-118), never by editing DN-118, and never below what is already invoiced
Whoever delivers (operations, the project lead, the warehouse) · screen: Deliveries · reference: not built
SO-08As the biller, I want to invoice what an order has due, so that nothing is billed early, late or twice.
Given an order: line 1 policy ordered, 1 unit; line 2 policy delivered, 12 ordered, 5 delivered; nothing invoiced · when I ask for the invoice · then invoicing receives one draft request for line 1 x 1 and line 2 x 5, keyed on the order and the request number; asking again with nothing new due creates nothing; the order shows "partly invoiced"
Whoever invoices · screen: Order · reference: not built
SO-09As the biller, I want to raise a deposit before the work starts, so that "50% up front" is a real invoice.
Given a confirmed order of 10,000.00 net and a setting for a 50% deposit · when I raise the deposit · then invoicing receives a deposit request of 5,000.00 net (taxed when the payment is received or the invoice issued, whichever is first, per the tax point rule); the next invoices for the order deduct it until it is used; a second deposit beyond the order total is refused
Whoever invoices · screen: Order · reference: not built
SO-10As a sales rep, I want one list of orders with what is still to deliver and to invoice, so that I can answer "where is my order" in a sentence.
Given orders in every state · when I open the list · then each row shows the number, the customer, the total, the fulfilment status and the invoice status (both derived); filters by state, customer and date
Sales · screen: Orders · reference: not built
SO-11As a sales rep, I want to send the customer an order confirmation, so that they have in writing what was agreed.
Given a confirmed order · when I send the confirmation · then the document (number, lines, prices, tax, delivery terms, their PO) is produced from the frozen order and the send is recorded; re-sending records a second send
Sales · screen: Order · reference: not built
SO-15As the owner, I want to set the controls on how orders are taken, so that a rep cannot loosen the rules they work under.
Given amendment_needs_approval true and the PO-draft AI step off · when on 2026-10-22 I set amendment approval off from 2026-11-01 and turn ai_order_from_po to suggest · then each control is a dated row; one starting today or earlier is refused ("starts after today, in Europe/London"); a correction is a new row from a later date; a holder of so:settings:write alone is refused on a control; turning an AI step on is recorded as the owner's consent (who, when, which step)
The owner or a finance controller · screen: Settings · reference: not built
SO-16As a sales rep, I want to accept, change or reject what the AI suggested from a customer's PO, so that nothing the AI read reaches the order without me.
Given a draft order suggested from PO-4471 with 3 matched lines and one difference from the quote listed · when I accept two lines, change the third line's unit from C62 to PK24, and reject the difference as noise · then the draft holds the accepted and changed lines, each priced by find_price; the suggestion, the model, what I accepted, changed or rejected, and when are recorded on the order's suggestion log; nothing was on the order before I acted
Sales · screen: Order · reference: not built
SO-29As sales operations, I want order types (standard, rush, cash, returns, credit and debit memo requests, free of charge, consignment), each behaving its own way, so that a return or a free sample is not an ordinary order someone has to remember to treat differently.
Given seeded types STANDARD (SO-{yyyy}-{seq:4}), RUSH, CASH, RETURNS (RE-), CREDIT_REQ (CR-), DEBIT_REQ (DR-), FREE_OF_CHARGE (FC-), CONS_FILL, CONS_ISSUE, CONS_PICKUP, CONS_RETURN (CS-), each with direction, billing relevance, a required reference and default blocks; item category rules: STANDARD + product type TRADING -> STD_STOCK, STANDARD + SERVICE -> STD_SERVICE, STANDARD + TRADING with usage drop_ship -> THIRD_PARTY, FREE_OF_CHARGE + any -> FREE · when a rep raises a STANDARD order of COLA-075 and HOST-M, a RETURNS order with no reference, and later tries to change the confirmed STANDARD order to RUSH · then COLA-075 gets item category STD_STOCK (delivery-relevant, billed per its invoicing policy) and HOST-M STD_SERVICE (not delivered from stock), each line keeping the category it was determined with; the RETURNS order is refused (gate reference_required, "a return names the order line it returns"); the type change is refused ("an order's type is fixed once confirmed: cancel it and raise a new one"); each type numbers from its own series at confirmation, claimed with a plain INSERT, never reused and with no gap from a refused confirmation; a type or rule is a dated config row (from tomorrow), so a confirmed order keeps the behaviour it was confirmed under
Sales operations / the owner · screen: Settings · reference: SAP sales document types (VOV8: OR, SO rush, BV cash, RE returns, G2 / L2 credit / debit memo requests, FD free of charge, KB / KE / KA / KR consignment) and item category determination (VOV4: TAN, TAD, TAS, TANN, REN, KBN, KEN); Odoo has one order kind
Usually different per customer: which types are used (most firms: standard, returns, credit requests); their number formats
SO-30As a sales rep, I want each line priced by the base price from our price lists and then the customer's agreed discounts and surcharges found automatically, so that the price is the one agreed without me looking it up.
Given pricing procedure STANDARD: 10 BASE (product find_price), 20 DISC_PCT (access sequence: customer + product, then customer + category, then price group + category), 30 SURCH_PCT (category); records: 7311 + COLA-075 5% from 2026-11-01; 7311 + category drinks 3%; price group TRADE + drinks 2% (4% from 100 C62); drinks surcharge 2%; base 1.20 a bottle for COLA-075 and 1.80 for COLA-150; DISC_PCT manual limit 10% · when on 2026-11-02 I order 120 C62 of COLA-075 and 120 C62 of COLA-150 for 7311, then type a DISC_PCT of 12% on the second line, then confirm · then COLA-075: BASE 144.00, DISC_PCT -7.20 (customer + product found first: the access stops at the first hit), SURCH_PCT +2.74 on 136.80, net 139.54; COLA-150: BASE 216.00, DISC_PCT -6.48 (customer + category), SURCH_PCT +4.19, net 213.71; each condition is a line_condition row naming its record (priced_from per condition) and rounded once, half up, to the minor unit; 12% is refused ("DISC_PCT may be changed by hand up to 10%") and 8% is accepted and recorded as manual with who; confirming freezes every condition; an amendment re-prices only the changed line; a record dated today or earlier cannot be added (records start after today); a NUMERIC overflow (a rate or amount above its bound) is a 422 with the reason
Sales · screen: Order · reference: SAP condition technique (V/06 condition types, V/07 access sequences, V/08 pricing procedure, VK11 records with scales, KONV / PRCD_ELEMENTS on the item); Odoo pricelist rules and a line discount
Usually different per customer: whether any discount or surcharge is agreed per customer, group or category (many small firms: none, the price list is enough)
SO-31As a sales rep, I want an order-level discount and the freight charged once for the whole order and spread over its lines, so that the invoice shows the customer's deal and our carriage cost without arithmetic by hand.
Given the order of SO-30 (net 139.54 and 213.71 = 353.25) for ship-to 7313 in GB; condition FREIGHT for country GB: 0.12 per KGM of gross weight, at least 15.00; the bottles weigh 0.79 KGM (COLA-075) and 1.60 KGM (COLA-150) gross (product measures in force today) · when I add a header discount HDR_DISC of 2% and confirm · then HDR_DISC 7.07 (2% of 353.25 rounded once) spread by net: 2.79 on line 1 and the remainder 4.28 on line 2; FREIGHT 34.42 (286.8 KGM x 0.12) spread by gross weight: 11.38 on line 1 and the remainder 23.04 on the heaviest line; nets 148.13 and 232.47, order net 380.60, exactly the sum; every share lands on a line so invoicing bills and taxes it with the goods; a line with an unknown weight leaves FREIGHT uncomputable and confirmation refused (gate freight_computable, fix "record the unit's weight in Products"); the weights used are copied on the line with their valid_from
Sales · screen: Order · reference: SAP header conditions (HA00 percentage, HB00 absolute) distributed by net value, freight KF00 by weight, group conditions; Odoo has delivery carriers adding a freight line
Usually different per customer: whether freight is charged, and by weight, by order value or flat
SO-32As sales operations, I want a rebate agreement with a customer (a year's purchases, tiers, paid back at the end), so that the year-end rebate is calculated from the invoices instead of a spreadsheet.
Given customer 7311; drinks invoiced to them in 2027 will earn 1% from 0, 2% from 50,000.00 and 3% from 100,000.00, retroactive to the first pound; expected tier 2% · when on 2026-12-10 I open agreement RB-2027-7311 for 2027-01-01 to 2027-12-31, basis invoiced net of category drinks, accrual rate 2%, and activate it; then try one starting 2026-12-01, and change the scale after the first accrual · then RB-2027-7311 is active from 2027-01-01; the back-dated one is refused (gate starts_after_today); the scale change is refused once an accrual exists ("end it and open a new agreement from a later date"); an agreement names the customer (or a price group) and the products, categories or all; the basis is invoice net less credit notes, by the invoice's issue date in business_timezone
Sales operations / the owner · screen: Rebates · reference: SAP rebate processing / settlement management (condition contracts, WCOCO; formerly VBO1 rebate agreements with BO01-BO03 conditions, retroactive scales, accruals, VBOF / partial settlement); Odoo has no rebates (loyalty programs only)
Usually different per customer: whether rebates are agreed at all; basis (volume, value, category); retroactive or tier-by-tier
SO-34As the finance controller, I want a rebate settlement calculated and checked before the credit goes to the customer, so that we pay back exactly what the agreement earned, once.
Given RB-2027-7311 ended 2027-12-31; invoiced drinks net 120,000.00 less credits; accrued 2,400.00; a partial settlement of 1,000.00 credited in July · when on 2028-01-05 the order admin asks for the final settlement; the order admin approves it under a second account; then I approve it · then the settlement is 3,600.00 (3% of 120,000.00, the tier reached, retroactive) less 1,000.00 already settled = 2,600.00; the order admin's second account is refused (same email or same sign-in subject); my approval posts the true-up of the accrual (1,200.00) to the ledger and asks invoicing for one credit note to 7311 keyed rebate:RB-2027-7311:2, with lines per tax category of the basis and the account purpose rebate (so invoicing debits the accrued rebates, not revenue again); approving twice credits once; the agreement closes, its accrual nets to exactly 0.00
A second person for money going back (the finance controller, the owner) · screen: Rebates · reference: SAP rebate settlement (VBOF, final settlement credit memo request B1 / B2, accrual reversal)
SO-35As a sales rep, I want each line to show when it can be delivered from stock and what is coming in, so that I promise the customer a date we can keep.
Given today 2026-11-02; COLA-075 at WH1 360 LTR unrestricted, 180 LTR reserved; PO-0101 brings 720 LTR on 2026-11-09 (goods-in 1 day, product site WH1); pick and pack 1 day; ship-to 7313 is 1 day from WH1 · when I order 480 C62 (360 LTR) for delivery on 2026-11-04 · then inventory's ATP answers 180 LTR now and 720 from 2026-11-10; the line gets two schedule lines: 240 C62 confirmed for 2026-11-04 and 240 C62 for 2026-11-12; the order shows "partly confirmed: 240 on 4 Nov, 240 on 12 Nov" and the confirmation document prints both; confirmation is never blocked by a shortfall; a lot expiring before the delivery date is not counted (the customer's minimum shelf life); with complete delivery (SO-37) the whole line is promised for 2026-11-12; without inventory installed the requested date is kept and the answer says nothing was checked
Sales · screen: Order · reference: SAP availability check with ATP quantity and delivery scheduling (backward and forward: pick-pack, loading, transit), schedule lines VBEP with confirmed quantities; Odoo shows forecasted quantity and a commitment date
Usually different per customer: whether dates are promised from stock and receipts, or only from stock on hand
SO-37As a sales rep, I want each customer's delivery rules (part deliveries allowed or not, how many, what tolerance), so that the warehouse ships the way the customer wants without a phone call.
Given 7311: part deliveries allowed, at most 3 per line, under-delivery tolerance 2%, over-delivery 0%; 8420: complete order only · when inventory asks how to deliver an order for each; 8420's order has one line short; 7311's line of 100 is delivered 98, then a fourth part delivery is tried on another line, and 101 on a line of 100 · then GET /sales-orders/{sales_order_id}/fulfilment answers each order's rule (copied from the customer's policy at confirmation, changeable on the order by the rep before the first delivery); inventory holds 8420's delivery until every line is reserved in full; 98 of 100 closes the line (within 2%): nothing is back-ordered and invoicing bills 98; the fourth part delivery is refused (gate max_partials) and 101 (gate within_tolerance); lines to two ship-tos or from two warehouses become two deliveries; orders of one ship-to may go in one delivery where the customer allows combination
Sales · screen: Order · reference: SAP complete delivery (KZAZU), partial delivery agreement per item (KZTLF: up to 9 partials, A / B / C / D), under / over-delivery tolerance (UNTTO / UEBTO), order combination, delivery split by ship-to and shipping point
Usually different per customer: whether customers accept part deliveries; tolerances for bulk goods
SO-38As sales operations, I want to say what an order of each type must contain before it is confirmed, delivered or billed, so that an incomplete order stops at the right step and says what is missing.
Given incompletion rules: STANDARD: delivery_terms for a ship-to outside the company's country blocks delivery, customer_po_ref blocks billing where the customer's policy asks; RETURNS: return_reason blocks confirmation; CREDIT_REQ: reference_invoice blocks confirmation · when a rep confirms an export order with no delivery terms, inventory asks to deliver it, and the biller asks to invoice it without a PO · then the order's readiness lists {gate: incomplete:delivery_terms, met: false, reason: "an export order needs its delivery terms (Incoterms)", fix: "Order: delivery terms"} under delivery, and incomplete:customer_po_ref under billing; confirmation is allowed (the rule blocks delivery only); inventory's fulfilment answer says delivery blocked by incompletion; the invoice request is refused naming the field; the Orders screen filters incomplete orders by what they block; the rules are dated config rows per order type
Sales operations / the owner · screen: Settings · reference: SAP incompletion procedure (OVA2 / VUA2: fields per procedure with status groups blocking delivery, billing or saving; incompletion log V.02)
SO-39As sales operations, I want to stop an order from being delivered or billed for a reason, and release it, so that a dispute or a check holds the right step and nothing else.
Given block reasons CHECK_TERMS (delivery) and PRICE_DISPUTE (billing); confirmed order SO-2026-0020 · when I set the delivery block CHECK_TERMS with a note; inventory raises the delivery; I release it; I set PRICE_DISPUTE and the biller asks for the invoice; a rep tries to release a block · then the block is an appended row with who and why; inventory still reserves but the delivery does not reach the pick list (fulfilment: delivery_blocked) until the release, also appended; the invoice request is refused (gate billing_block, "on hold: PRICE_DISPUTE"); the rep is refused (so:order:block); a CREDIT_REQ or FREE_OF_CHARGE order starts with its type's default block APPROVAL, released only by approval (SO-42, SO-43)
Sales operations / the owner · screen: Order · reference: SAP delivery block (LIFSK) and billing block (FAKSK) on the header and item, with reasons (OVLS, OVV3)
SO-40As a sales rep, I want an order to know who ordered, where it goes, who gets the invoice and who pays, so that the depot gets the goods, head office gets the bill and the right account's credit is checked.
Given sold-to 7311 Acme Ltd; partner rows from 2026-10-01: ship-to 7312 Acme Leeds depot (default) and 7313 Acme York, bill-to 7311, payer 7400 Acme Group Treasury; 7400 is on credit hold, mode block · when I raise an order for 7311, pick ship-to 7313, try ship-to 9999, and confirm · then the order defaults ship-to 7312, bill-to 7311 and payer 7400 from the rows in force on the order date and copies them; 7313 is accepted; 9999 is refused ("9999 is not a ship-to of 7311"); the credit gate reads the PAYER (payments GET /customers/7400/credit-ok) and refuses; tax is computed for the ship-to's country and the sold-to's VAT status; invoicing receives bp_id = 7400 (the payer, whose receivable it is), sold_to 7311, ship_to 7313 and bill_to 7311 (whose billing profile addresses the invoice); each partner must be an active business partner with the customer role (ship-to: the ship_to role); a partner change after the first delivery is refused; partner rows are dated, from tomorrow
Sales · screen: Order · reference: SAP partner functions SP sold-to, SH ship-to, BP bill-to, PY payer (KNVP, partner determination procedure); Odoo partner_invoice_id and partner_shipping_id
Usually different per customer: whether any customer ships to depots or is paid for by a group company
SO-41As a sales rep, I want to authorise a customer's return with an RMA number before the goods come back, and credit only what the warehouse accepts, so that returns are expected, checked and refunded once.
Given SO-2026-0012 line 1 delivered 24 C62 of COLA-075 (inv:WH1/OUT/00001), invoiced on INV-2026-0040 at 1.20; return reasons DAMAGED and WRONG_ITEM (inspect, full credit), CHANGED_MIND (inspect, 10% restocking fee); return_credit_on inspection · when I raise a RETURNS order for 6 C62 referencing SO-2026-0012 line 1, reason DAMAGED, and confirm it; the goods arrive and inventory reports 5 accepted (4 back to stock, 1 scrapped) and 1 rejected; I also try a return of 30 · then RE-2026-0001 is the RMA number on the confirmation sent to the customer; the line copies the original's price, unit and tax category (never re-priced) and names the original order line, delivery and invoice; inventory is told to expect it (POST /expected-returns); 30 is refused (gate within_delivered, "24 delivered, 0 returned: at most 24"); on the inspection result the order asks invoicing for one credit note against INV-2026-0040 for 5 C62 (6.00 plus VAT), keyed so:RE-2026-0001:1 and carrying the returns order's line, so the original order still reads 24 delivered, 24 invoiced; the rejected 1 is shown with inventory's reason and credited nothing; return_credit_on receipt credits at receipt instead; a serial-tracked product returns only a serial delivered to this customer (inventory's gate)
Sales · screen: Returns · reference: SAP returns order RE / advanced returns management (RMA, returns delivery, inspection, logistical follow-up: restock, scrap, return to supplier; refund determination, credit memo); Odoo stock.return.picking and the RMA apps
Usually different per customer: whether returns are authorised first; restocking fees; credit on receipt or after inspection
SO-42As the finance controller, I want a credit or a debit to a customer raised as a request and approved by me before invoicing sees it, so that money only moves on an approved reason.
Given INV-2026-0040 to 7311: 24 C62 at 1.20 (28.80 net); the price should have been 1.10 · when a rep raises CREDIT_REQ for 24 C62 at 0.10 (2.40) referencing INV-2026-0040 line 1, reason PRICE_ERROR, and DEBIT_REQ for freight forgotten (15.00); the rep approves the credit under a second account; then I approve both · then CR-2026-0001 and DR-2026-0001 are confirmed with the billing block APPROVAL; the rep's second account is refused (same email or same sign-in subject); my approval releases the block: invoicing receives POST /credit-notes against INV-2026-0040 keyed so:CR-2026-0001:1, its lines carrying CR-2026-0001's line (the original order's billed quantity is untouched), and a debit draft keyed so:DR-2026-0001:1 naming INV-2026-0040 in its text; a credit above the invoice line's net less earlier credits is refused (gate within_invoiced, claim rows per invoice line so two requests cannot both take the last pound); neither is delivery-relevant
A second person for money going back (the finance controller, the owner) · screen: Returns · reference: SAP credit memo request G2 and debit memo request L2 with billing block 08 until released (V.23), credit memo G2 / debit memo L2 billing
SO-43As a sales rep, I want to send free samples and replacements as orders that are delivered and costed but never billed, so that stock and cost are right and nobody invoices a gift by mistake.
Given FREE_OF_CHARGE approval limit 250.00 of statistical value; samples of 12 C62 COLA-075 for prospect 7311; a replacement DRILL-500 (base price 320.00) referencing RE-2026-0002 · when I raise both and confirm · then every line is priced by the procedure for statistics only (12 x 1.20 = 14.40 shown, net 0.00) and its item category FREE is not billing-relevant; the samples confirm; the replacement waits for a controller (gate free_of_charge_approval, 320.00 above 250.00; the requester never approves, by email and sub); inventory delivers both with purpose free_of_charge, so the cost goes to the samples account (inventory's account map), not to cost of sales; nothing is ever requested from invoicing; the order is done when delivered
Sales · screen: Order · reference: SAP free-of-charge delivery FD / subsequent free-of-charge delivery SDF, item category KLN / TANN (not billing relevant, statistical pricing)
SO-44As someone at the trade counter, I want a rush order that ships today and a cash sale that is delivered, invoiced and paid on the spot, so that a walk-in customer leaves with the goods and a receipt.
Given types RUSH (delivery created at confirmation, priority 1) and CASH (delivery and invoice at confirmation, paid on the spot); invoicing's owner control auto_issue_sources contains sales_order:cash · when I confirm a RUSH order for 7311 at 10:00, and a CASH order of 6 C62 COLA-075 for a walk-in customer · then the RUSH order's reservation asks inventory for a delivery today with priority rush, first on the pick list; the CASH order skips the credit gate (paid now), inventory's delivery is validated at the counter (a service line is recorded by hand), the invoice is requested and issued in the same step, and the cashier records the payment in payments against that invoice; a CASH order takes no deposit and no billing plan; both follow the normal readiness gates otherwise
Sales · screen: Order · reference: SAP rush order SO (immediate delivery) and cash sale BV (immediate delivery and billing, cash receipt); Odoo Point of Sale (outside these bricks)
Usually different per customer: whether there is a trade counter at all
SO-45As a sales rep, I want to keep our stock at a customer's site and bill only what they use, so that the customer has goods at hand and we invoice consumption, not shipments.
Given 7311 keeps consignment stock of COLA-075 at its site (inventory location UK1:CONSIGNMENT:7311, ours and valued by us) · when I raise CONS_FILL for 240 C62; 7311 reports using 60: CONS_ISSUE for 60; then CONS_PICKUP of 24; then CONS_RETURN of 6 of the used ones; then CONS_ISSUE for 200 · then CONS_FILL is delivered by inventory into 7311's consignment stock: not invoiced, not available to other orders; CONS_ISSUE takes 60 out of it to the customer, costed then, and is invoiced at the price on the issue date (find_price priced_on the issue date); CONS_PICKUP moves 24 back to WH1 and bills nothing; CONS_RETURN credits 6 against the issue's invoice (a return, SO-41); CONS_ISSUE for 200 is refused (gate consignment_on_hand, "7311 holds 162 C62 on consignment"); the consignment stock is read from inventory, never kept here
Sales · screen: Order · reference: SAP customer consignment KB fill-up, KE issue, KA pick-up, KR return, special stock W; Odoo has consignment only for supplier stock (owner on quants)
Usually different per customer: whether any customer holds our stock
SO-46As the biller, I want a big job invoiced in stages (on order, on installation, on acceptance), and repeating lines billed by period, so that cash comes in as the work progresses and no stage is billed twice.
Given order SO-2026-0030: line 1 PROJ-INSTALL 20,000.00 with milestones M1 30% on confirmation, M2 40% on installed, M3 30% on accepted; line 2 12 x HOST-M monthly · when the order is confirmed, the fulfiller releases M2 when installed, M3 is released, and the invoice is requested after each · then M1 is due at once: a request of 6,000.00 (an invoice line naming the order line, "Milestone 1 of 3: on order (30%)"); line 2 goes to invoicing as a schedule (POST /schedules, SO-20); M2 holds a billing block until released, then 8,000.00; M3 takes the remainder (20,000.00 - 6,000.00 - 8,000.00 = 6,000.00) so the stages sum exactly even when percentages do not divide evenly; confirming with milestones that do not total 100% is refused (gate plan_complete); a milestone line is billed by value: its billed net never exceeds its released milestones; amending its price re-spreads only unreleased milestones; equal instalments of a fixed total go to invoicing as a schedule with billing_kind instalment
Whoever invoices · screen: Order · reference: SAP billing plans: milestone billing (billing plan type 01, milestones from the project or by date, billing block per date) and periodic billing (type 02); Odoo down payments by percentage, and subscriptions
Usually different per customer: whether large jobs are billed in stages; on what events
SO-47As the biller, I want each invoice to take off part of a deposit in proportion, or the whole of it, so that the deposit is used up exactly by the end and the tax on it is right.
Given order of 10,000.00 net, standard rated; deposit invoice D1 5,000.00 (tax category standard) and D2 1,000.00 (standard), both issued; deduction mode proportional (the order's default) · when a first part invoice of 4,000.00 of goods is requested, then the final invoice of 6,000.00 · then the first invoice deducts 2,400.00 (the deposits' share, 6,000 / 10,000 x 4,000 = 2,400.00, taken oldest first: 2,400.00 from D1) with one deduction line per deposit naming deducts_invoice_id and carrying the deposit's tax category; D1 has 2,600.00 left, D2 1,000.00; the final invoice deducts everything left (2,600.00 from D1 and 1,000.00 from D2); a deduction above a deposit's remaining, or from a deposit still a draft, is refused; two concurrent requests cannot deduct the same amount twice (a claim row per (deposit, seq), plain INSERT); modes full_first (each invoice deducts as much as it can) and manual (the biller types an amount per deposit) exist per order; cancelling an order with deposit left asks invoicing for a credit note against the deposit invoice
Whoever invoices · screen: Order · reference: SAP down payment requests (FAZ) and clearing on the final invoice (partial clearing allowed, by the down payment's tax code); ar AR-15 keeps the same rule
SO-48As a sales rep, I want an item the supplier ships straight to the customer ordered from them when I confirm, and delivered when they ship, so that we sell what we never stock without anyone re-keying it.
Given PRINTER-X (TRADING) sold to 7311 for ship-to 7313, usage drop_ship (item category THIRD_PARTY); purchasing installed · when I confirm the order; purchasing later records the supplier's shipping notice SN-55 for 2; a fulfiller tries to record a delivery by hand; I try to cancel after purchasing ordered it · then confirmation asks purchasing once for a purchase request for 2 PRINTER-X delivered to 7313 (POST /purchase-requests/from-sales-order, keyed so:<sales_order_id>:<line_no>@r<revision>), and nothing is reserved in inventory; purchasing records the shipment and calls record_delivery with source purchasing and delivery_ref pur:SN-55, so the line is delivered and invoiceable per its policy; the hand delivery is refused ("a third-party line is delivered by the supplier"); the cancellation is refused with purchasing's reason ("PO-0144 is confirmed with the supplier") until purchasing cancels it
Sales · screen: Order · reference: SAP third-party order processing (item category TAS, automatic purchase requisition, statistical goods receipt, billing on the supplier's invoice or shipment); Odoo dropship route
Usually different per customer: whether any supplier drop-ships
SO-27As a sales rep, I want a product priced per 100 to stay priced per 100 on the order, so that a line of screws bills to the penny the customer was quoted.
Given SCREW-M4, base C62, at 2.4500 per 100 C62 on the customer's list (PRD-31); the customer's discount 10% on the line · when I order 250 C62, then add a line of 3 BX500 (a box of 500 with no price row of its own), then amend the first line to 400 · then line 1 holds unit_price 2.4500, pricing_quantity 100, pricing_unit_code C62 with its conversion, and net 5.51 (250 x 2.4500 / 100 = 6.125, less 10% = 5.5125, rounded once); line 2 is in BX500 but priced in C62 per 100 (the row's unit, as find_price answered), quantity_priced 1 500 and net 36.75 before discount; nothing is divided down to a piece price; the amendment re-prices line 1 only (9.80 before discount, 8.82 after); invoicing receives the pricing quantity on each line so the invoice nets the same
Sales · screen: Order · reference: SAP condition pricing unit carried on the sales item (KOMV-KPEIN / KMEIN, VBAP net value); Odoo has none
SO-28As a sales rep, I want to be told when a quantity breaks the product's delivery unit, so that we do not promise 20 bottles that ship in sixes.
Given COLA-075 delivery rule multiples of 6 C62 (PRD-30); delivery_multiple_mode warn (the default) · when I confirm an order of 20 C62; then the owner sets block from tomorrow and I confirm another order of 20 C62, and one of 2 PK24, and amend the first order to 22 · then the first confirms with the gate met in warn mode and its reason shown and recorded on the order {gate: delivery_multiple, met: true, reason: "COLA-075 is delivered in multiples of 6 C62: 20 is not one (18 or 24)", fix: "change to 18 or 24, or confirm as it is"}; under block the second is refused with met false and the same reason; 2 PK24 (48 C62) passes; the amendment to 22 is checked the same way under the mode in force on its date; an order from an accepted quote meets the same gate; a line of a product with no delivery rule always passes
Sales · screen: Order · reference: SAP delivery unit and minimum delivery quantity in the sales item (MVKE-SCHME, MVKE-LFMNG), the rounding message in VA01
Usually different per customer: whether a broken pack is a warning or not allowed at all
SO-52when a rep orders goods worth less than the owner's minimum order value, at confirmation, and on an amendmentA shop owner sets a minimum order value per currency, so that orders too small to be worth picking, packing and invoicing are topped up, held or flagged instead of losing money.
Given a policy of 100.00 GBP for orders in GBP (set by the owner, so:settings:controls, from a later date: mode surcharge, block or warn; optional price group); a draft in GBP with goods worth 40.00 net · when the rep prices and confirms the order; in block mode, an order admin who is not the order's owner calls POST /sales-orders/{sales_order_id}/override-minimum-order with a reason; the rep later amends the confirmed order · then surcharge: ONE MIN_ORDER header condition of 60.00 (minimum - net goods, before header conditions) tops the order up to 100.00, spread over the lines and taxed like the goods, recalculated on every re-price: an amendment that lifts the order to or over the minimum removes it, one that lowers it below adds it; exactly at the minimum no surcharge. block: confirmation is refused 409 {gate: minimum_order, reason, fix} until a holder of so:order:approve who is not the owner overrides it with a reason (recorded on the order; the owner's own override is refused); an amendment below the minimum applies only by another person's approval. warn: the same gate, met, with the warning. Returns, credit and debit requests, free-of-charge orders and consignment fill and pick-up never trigger it; no policy, or a policy in another currency, is no effect. Policies are dated, append-only rows (POST /minimum-order-policies, GET /minimum-order-policies, so:settings:controls to set, so:order:read to list)
Sales · owned by sales-order · reference: not built
SO-53when a rep enters a line for a product that has a substitution recordA distributor replaces a discontinued or short product with its successor at line entry, so that customers get what ships instead of an order line nobody can fill.
Given a record (so:settings:write, from 1 Dec) replacing COLA-075 with COLA-150 for reason discontinued, mode automatic or propose, optional price group, optional valid_to, priority · when a rep enters COLA-075 on a draft (by hand, add_order_line, or an accepted AI suggestion); in propose mode the rep calls accept_substitute with COLA-150 or keep_original · then automatic: the line is COLA-150 at COLA-150's own price (find_price and the pricing procedure, never the original's), keeping COLA-075 as the product entered (entered_product_id) and discontinued as the reason (substitution_reason); both survive an amendment. propose: the line stays COLA-075 and offers COLA-150; the rep accepts it (re-priced) or keeps the original, and an open offer never blocks confirmation. A group's own record wins over the general one, then the lowest priority; A to B to C resolves to C and a cycle stops before it repeats. Outside its dates no effect; out_of_stock applies only while inventory's GET /atp says the original is short (no inventory, warehouse or answer = not short). The substitute is ordered in the unit the customer entered; one not counted in that unit refuses the line 422 naming it. Returns, credit and debit requests, consignment movements, quote-priced and Odoo-imported lines are never substituted. Records: POST /substitutions (so:settings:write, dated, append-only), GET /substitutions (so:order:read), POST /sales-orders/{sales_order_id}/lines/{line_no}/accept-substitute (so:order:write)
Sales · owned by sales-order · reference: not built
Things that happen on their own
SO-12on read (derived)The system works out fulfilment and invoice status from quantities, so that "delivered" and "invoiced" are never stale.
Given a line of 12, 5 delivered, 5 invoiced · when anyone opens the order · then fulfilment partly delivered, invoice status partly invoiced, to invoice 0 (delivered policy) or 7 (ordered policy); nothing stored but the quantities
· reference: not built
SO-13when the last line is fully delivered and invoicedThe system locks a finished order, so that a done order cannot be edited by accident.
Given an order whose every line is delivered and invoiced in full · when the last invoice is issued · then the order is done; an edit is refused ("done: raise a new order"); this runs once however often it is triggered
· reference: not built
SO-14when a customer's purchase order arrives by emailThe system drafts an order from the customer's purchase order, so that the rep checks instead of types.
Given a PDF purchase order from a known customer quoting quote Q-2026-0042 · when it is read · then a suggestion (lines matched to product_id and unit_code with a confidence, the PO number, differences from the quote) shown on an empty draft for the rep (SO-16); nothing is on the order until a person accepts it, and nothing is confirmed without a person
· reference: not built
SO-33every night for the previous business day's issued invoices and approved credit notes (and on demand)The system accrues each rebate agreement as invoices are issued, so that the books carry what we will owe the customer before the year ends.
Given RB-2027-7311 active, accrual rate 2%; on 2027-02-03 invoicing issued INV-2027-0101 to 7311 with 10,000.00 of drinks; on 2027-02-10 a credit note of 500.00 against it · when the nightly accrual runs for 2027-02-03 and 2027-02-10, and again for 2027-02-03 · then an accrual row of 200.00 keyed (agreement, invoice_id, line_no) and a journal to the ledger (rebate expense 200.00 debit / accrued rebates 200.00 credit, journal_id derived from (agreement, source document)); the credit note reverses 10.00 the same way; the re-run writes nothing; the basis is read from invoicing (GET /billed-lines), never from ar_ tables; the business date is today in business_timezone, never the UTC date, and a run never goes back past a signed migration or a closed period (the journal is refused by the ledger and kept pending with its reason)
· reference: SAP rebate accruals posted with each billing document (BO01 accrual condition, ERB / ERU accounts)
SO-36every business day at the start of the day (the composition's clock), and when an order is cancelledThe system re-promises every quantity not yet delivered against the stock and receipts it can see, so that a later supply date reaches the rep before it reaches the customer.
Given SO-2026-0041 line 1 has 240 C62 confirmed for 2026-11-12 against PO-0101 arriving 2026-11-09; purchasing moves PO-0101 to 2026-11-16; another order's cancellation frees 90 LTR today · when the re-promise runs on 2026-11-05, and runs again the same day · then open schedule lines are re-checked in order of priority (rush first) then order date (first come, first served); the 240 C62 now confirm 120 for 2026-11-07 (from the freed 90 LTR) and 120 for 2026-11-19, appended as a new schedule version with the reason; inventory's reservation is re-sent for the same revision with schedule version 2; the order's owner gets a task "tell 7311: 120 C62 now 19 Nov"; an EARLIER date is applied only to quantities not yet promised to the customer and is otherwise offered, never pushed; the second run the same day writes nothing
· reference: SAP backorder processing and rescheduling (V_V2, ATP re-check, BOP in aATP)
SO-26when a delivery or a correction is recorded (v3)A delivered quantity converts exactly to the product's base unit, so that the order, the stock and the invoice agree to the last unit.
Given line 1 in bottles (unit_numerator 3 / unit_denominator 4 of a LTR, base LTR to 3 decimals) · when 24 bottles are delivered, then 0.3333 of a bottle · then 24 bottles are recorded as 18 LTR in the base unit beside the line's unit; 0.3333 is refused ("0.3333 bottles is not an exact quantity of LTR to 3 decimals") and nothing is recorded; never rounded
· reference: not built
Things that cross into other modules
SO-01when a quote version is accepted (brick-quote decision)An accepted quote becomes a draft order in one step, so that nothing is re-typed.
Given quote Q-2026-0042 version 2 accepted, with three lines and a customer · when the acceptance is handed over · then one draft order keyed sales_order_id = "quote:Q-2026-0042@v2" with the version's lines copied as accepted: product_id, description, quantity, unit_code (the quote line's, or the product's sales unit for a quote line written before units), list_price and unit_price, and priced_from = the quote line (quote:Q-2026-0042@v2#1) with the quote's own source and priced_on; the order never re-prices an accepted line; tax is computed by the tax module for the order date; handing it over twice returns the same order; where the control says so it is confirmed at once, through the same readiness gates as a person. v5, the exact seam: the composition's adapter is the ONE caller of brick-quote's POST /quotes/{quote_id}/versions/{version}/decision for an acceptance; on its 2xx with outcome ACCEPTED it reads GET /quotes/{quote_id} (the accepted version) and calls POST /sales-orders/from-quote; a quote line not priced by product (its priced_from does not name a product price list row, PRD-20) is refused (409, gate priced_by_product, fix "re-price the quote from product before it is sent"), so a price from a second price book never reaches an order; the order's partners (SO-40) and type STANDARD are defaulted as for a hand order
· owned by sales-order · reference: the route exists (erp-brick-sales-order POST /sales-orders/from-quote, idempotent on the key); the adapter is not built, and brick-quote still prices from its own book (l2c leftovers): until quote reads find_price (product PRD-20), the composition does not install SO-01
SO-20when an order is confirmed and a line is recurring or meteredA repeating line becomes a billing schedule in invoicing, so that monthly lines bill themselves.
Given a confirmed order with a recurring line of 12 periods at 120.00 · when it is confirmed · then invoicing receives plan_billing for that line, keyed "{sales_order_id}|{line_no}"; repeating the call creates nothing
· owned by ar · reference: not built
SO-21when the biller asks for an invoice or a deposit (SO-08, SO-09)The order asks invoicing for a draft; invoicing owns the invoice.
Given invoiceable quantities on an order · when the request is made · then invoicing raises one draft per request, keyed "so:{sales_order_id}:{request_no}", each line carrying sales_order_id and line_no; the order reads invoiced quantities back from invoicing and never writes ar_ tables
· owned by ar · reference: not built
SO-22before confirmationThe order reads whether the customer is on credit hold.
Given payments derives a hold for the customer · when the rep confirms · then the hold, its reason and the hold mode (warn | block) come from payments' read route (credit holds are payments', decided 2026-10-18); the order refuses or warns as that mode says
· owned by payments · reference: not built
SO-23when inventory validates a delivery or a customer return (milestone M4; v3)With inventory installed, a stocked goods line is delivered only from inventory, so that the warehouse and the order agree and nobody keys a delivery twice.
Given inventory installed; an order with line 1 of 48 bottles of COLA-075 (stocked) and line 2 of 3 HUR installation (a service) · when inventory validates WH1/OUT/00001 for 24 bottles of line 1, and a fulfiller records 5 delivered by hand on line 1 and 3 HUR on line 2 · then inventory's call (POST /sales-orders/{sales_order_id}/deliveries, source inventory, delivery_ref inv:WH1/OUT/00001) records 24 on line 1 once, however often it is retried; the hand delivery on line 1 is refused ("COLA-075 is stocked: its deliveries come from inventory"); the 3 HUR on line 2 are recorded by hand as in v2; the order's rules (no over-delivery, idempotent per reference) apply unchanged; without inventory every line is delivered by hand
· owned by sales-order · reference: not built
SO-24on the one-off Odoo migration (milestone M8), after business-partner, product and tax have migratedThe customer's Odoo sales orders arrive once, open ones live and the rest as history, and can be re-run safely.
Given an Odoo database with 40 confirmed orders, 6 of them open (part delivered or part invoiced), 3 cancelled · when the migration runs twice · then orders keyed "odoo:<company_id>:<sale.order name>" keep their Odoo number and prices; open orders are confirmed with an opening delivery per line of qty_delivered; the rest are done or cancelled, read-only, never re-priced or re-taxed, and ask invoicing for nothing; the second run changes nothing; the reconciliation (migration.odoo.reconcile) shows zero unexplained differences before the customer signs it
· owned by sales-order · reference: not built
SO-25when an order is confirmed, amended or cancelled with inventory installed (v3)The order reserves its stocked lines in inventory, so that what is promised to one customer is not sold to another.
Given inventory installed; an order of 48 bottles of COLA-075 and 3 HUR installation · when it is confirmed (revision 1), amended to 60 bottles (revision 2), then cancelled · then confirm calls POST /reservations/sales-orders/{sales_order_id} with revision 1 and line 1 only as stocked (inventory ignores and names the service line, and the order keeps stocked false on it); the amendment calls it again with revision 2 and 60; cancel calls POST /reservations/sales-orders/{sales_order_id}/release with the reason; a retry of any call changes nothing; a short reservation is shown on the order, and never blocks confirmation
· owned by inventory · reference: not built
SO-49when inventory receives and inspects a returned line (inventory INV-14)Inventory reports what came back and what passed inspection on the returns order, so that the credit follows the warehouse's decision.
Given RE-2026-0001 line 1 expects 6 C62 of COLA-075 · when inventory records the receipt (record_delivery on the returns order: 6, source inventory, delivery_ref inv:WH1/RET/00001) and then POST /sales-orders/RE-2026-0001/return-inspections with 5 accepted (4 restock, 1 scrap) and 1 rejected, twice · then the returns line reads received 6, accepted 5, rejected 1, recorded once however often it is repeated; accepted + rejected never exceed received (409 within_received); with return_credit_on inspection the credit request for 5 is made (SO-41); the returns order is done when every line is inspected and its credit issued
· owned by sales-order · reference: not built
SO-50when manufacturing's MRP-lite reads demand (MFG-23)Planning reads the open quantity of every order for a product, a warehouse and a date range in one call, so that production is planned from what customers ordered without reading orders one by one.
Given open lines for BAG-ETH-250 from ROASTERY: SO-2026-0100 line 1, 40 C62 requested 2026-11-20 with 10 delivered; SO-2026-0104 line 2, 24 C62 requested 2026-11-22, confirmed for 2026-11-23; a draft order for 50; a cancelled order for 12 · when manufacturing calls GET /demand?product_id=BAG-ETH-250&warehouse_id=ROASTERY&from=2026-11-16&to=2026-11-29 · then two rows: (2026-11-20, open 30 C62 = 30 base) and (2026-11-23, open 24 C62), each with its order and line, dated by the latest schedule line's confirmed date, else the requested date; open = ordered - delivered - closed short, in the line's unit and in the base unit; only confirmed orders of goods lines delivered from that warehouse are demand (drafts, quotes, cancelled and THIRD_PARTY lines are not); no price, customer name or amount is answered
· owned by sales-order · reference: not built
SO-51when timesheets approves billable hours on a project planned from this order (timesheets TS-12)Approved hours are delivered on the order's service line by timesheets, so that time and materials are invoiced by the order at the price it was sold at.
Given order quote:Q-2026-0042@v2 line 2: 120 HUR of CONSULT-SR at 95.0000, invoicing policy delivered, 40 HUR delivered · when timesheets calls POST /sales-orders/quote:Q-2026-0042@v2/deliveries {line_no 2, quantity "19.0000", source timesheets, delivery_ref "ts:4410:2026-W47:r1:1"} twice, then a correction {quantity "-2.0000", delivery_ref "ts:4410:2026-W47:r2:1", corrects_ref "ts:4410:2026-W47:r1:1"} · then the line reads 59 HUR delivered once, then 57; the order invoices delivered quantities by its own policy (SO-21); a delivery on a goods line is refused 409 {gate: service_line}; above the ordered quantity 409 {gate: within_tolerance} unless the line allows over-delivery (v11: one gate name, the signed workflow's, for every source; the story and two routes said within_ordered); a correction that would take delivered below what is already invoiced is refused 409 {gate: not_below_invoiced, fix: "credit the invoice in invoicing"}; the order never reads ts_ tables
· owned by sales-order · reference: not built
How things move
sales_order
draft → confirmed → done → cancelled
- none → draft by system · when a quote version was accepted; readiness: priced_by_product (every quote line priced by product's find_price, v5) · type STANDARD; partners defaulted (v5); lines copied, keyed quote:{quote_id}@v{version}; a second hand-over returns the same order
- none → draft by sales_rep · when ordered_on is today in business_timezone; every unit is one the product sells in; an order type (v5); readiness: partners_valid (sold-to, ship-to, bill-to, payer, v5), reference_required (returns, memo requests, consignment issue: the order line or invoice referenced, v5) · each line's item category determined from its type and the product's type (v5), priced by the pricing procedure, the BASE condition from find_price (priced_on today); taxed by the tax module for the ship-to
- none → draft by system · when a purchase order arrived and the owner turned the step on · an empty draft with a suggestion: lines matched to product and unit, the PO number, differences from the quote; nothing on the order yet
- draft → draft by sales_rep · accepted lines priced by the pricing procedure; what was accepted, changed or rejected, by whom, logged in so_suggestion
- draft → draft by customer · when the customer requires a PO
- draft → draft by system · when a PO document is attached · price, quantity and term differences listed for the rep
- draft → draft by system · when v12 SO-53: a so_substitution record is in force on that date for the entered product (the order's price group's own records before the general ones, then lowest priority; A to B to C resolves to C, a cycle stops before it repeats); reason out_of_stock only where inventory's GET /atp says the original is short (no inventory, warehouse or answer = not short); not returns, credit or debit requests, consignment movements, quote-priced or Odoo-imported lines · automatic mode: the line takes the substitute and keeps the entered product (entered_product_id) and the reason (substitution_reason), priced by the substitute's own conditions, never the original's; propose mode: the line keeps the original and carries the offers; both survive an amendment
- draft → draft by sales_rep · when the line has a substitute waiting (an offer); the chosen product is one of the offers; not a line billed by milestones · the line takes the chosen substitute, re-priced by its own conditions, keeping the entered product and the reason; or keep_original closes the offer; an open offer never blocks confirmation
- draft → draft by sales_rep · when readiness: base_price_found (find_price answered every line), manual_within_limit (a typed condition within its type's limit), freight_computable (every line's weight known where FREIGHT applies) · line_condition rows per line and the header's shares, each naming its record; nets rounded once and summed exactly (v5); v12 SO-52 surcharge mode: where the net goods value (before header conditions) is below the minimum order value in force for the order's currency and price group (a dated so_minimum_order row, set with so:settings:controls), ONE MIN_ORDER header condition = minimum minus net goods is spread over the lines and taxed like the others, recalculated on every re-price (an amendment over the minimum drops it, under it adds it); exactly at the minimum no surcharge; no policy or another currency no effect; returns, credit and debit requests, free-of-charge and consignment fill/pick-up orders are exempt
- draft → draft by system · when inventory installed and the line is stocked (else the requested date is kept and said so) · schedule lines per line from inventory's GET /atp: confirmed quantities and dates (v5); a shortfall never blocks
- draft → draft by sales_rep
- draft → draft by order_admin · when v12 SO-52: readiness minimum_order is unmet (block mode, net goods below the minimum); approver_not_owner (a holder of so:order:approve who is not the order's owner, compared by email AND sign-in subject) · needs reason · the override and its reason recorded on the order; the minimum_order gate is then met at confirmation
- draft → confirmed by sales_rep · when readiness all met: customer_active, lines_priced (every line has priced_from), units_valid, lines_taxed, credit (the PAYER not on hold, or an admin overrode it with a reason; mode warn is met with its reason; skipped for CASH, v5), po_ref (where the customer's policy on that date requires one), no_open_suggestion, delivery_multiple (v4: each line a multiple of its product's delivery rule; mode warn is met with its reason, block is not), incomplete:* (v5: every field the type's incompletion rules require for confirmation), minimum_order (v12 SO-52: block mode, the net goods value reaches the minimum order value in force, or an approver other than the owner overrode it with a reason; warn mode is met with its warning; surcharge mode has no gate; exempt order types and no policy are met), site_allows_sale (v5: product site status at the delivering warehouse), plan_complete (v5: milestones total 100%), reference_required (v5) · numbered from the order type's series (v5); prices, conditions and tax frozen; repeating lines handed to invoicing as schedules; with inventory installed, its goods lines reserved with their schedule lines (POST /reservations/sales-orders/{sales_order_id}, revision 1) and each line's stocked flag kept from the answer; third-party lines sent to purchasing as purchase requests (v5); RUSH asks for a delivery today; CASH has its delivery and invoice made at once; CREDIT_REQ, DEBIT_REQ and FREE_OF_CHARGE above the limit take the type's APPROVAL block; RETURNS follow the return_order workflow
- draft → cancelled by sales_rep
- confirmed → confirmed by sales_rep · the document from the frozen order, with the promised dates per schedule line (v5); the send recorded
- confirmed → confirmed by customer
- confirmed → confirmed by sales_controller · when readiness: approver_not_requester (neither the rep who raised it nor anyone with the same email or sign-in subject), within_invoiced (a credit never above the invoice line's net less earlier credits) · the APPROVAL block released; a credit request asks invoicing for a credit note against the referenced invoice, a debit request for a draft; a free-of-charge order may be delivered (v5)
- confirmed → confirmed by order_admin · when a block reason of the right kind (delivery | billing) · needs reason · a block row appended; the fulfilment answer or the invoice request stops at it (v5)
- confirmed → confirmed by order_admin · when the block is set; an APPROVAL block only by approve_memo_request · needs reason · a release row appended
- confirmed → confirmed by system · when an open schedule line not yet delivered; once per business date · a new schedule version with the reason; a later date raises a task for the owner; the reservation re-sent with the same revision and the new schedule version (v5)
- confirmed → confirmed by biller · when readiness: deposit_set (the order's deposit percentage is above zero), within_total (deposits never exceed the order total); not CASH · invoicing raises a deposit draft; later invoices deduct it in part or in full (v5)
- confirmed → confirmed by fulfiller · when delivered_on not after today nor before the confirmation; no line beyond its ordered quantity plus its over-delivery tolerance (v5); a correction never below what is invoiced; the quantity converts exactly to the base unit (v3); with inventory installed, a stocked line only with source inventory (v3); a third-party line only with source purchasing (v5); max_partials (v5); no delivery block (v5) · delivered quantities per line, with the base quantity beside them, a correction as a new row; a line within its under-delivery tolerance is closed (v5); fulfilment status derived
- confirmed → confirmed by system · when inventory installed; the line is stocked; delivery_ref inv:<delivery number> · record_delivery with source inventory, called inside inventory's validation; a repeat with the same delivery_ref records once
- confirmed → confirmed by system · when the line's item category is THIRD_PARTY; delivery_ref pur:<shipping notice> · record_delivery with source purchasing, called by purchasing; a repeat records once (v5)
- confirmed → confirmed by fulfiller · when the milestone's event happened (or its date is today or past); not released before · the milestone's billing block released; its value becomes due (v5)
- confirmed → confirmed by biller · when readiness: something_due (a line has quantity or milestone value to invoice, per its policy), billing_block (none set, v5), incomplete:* (the fields the type requires for billing, v5), billing_relevant (not a FREE_OF_CHARGE or CONS_FILL order, v5), deduction_within_remaining (no deposit deducted beyond what is left, v5) · one draft request with its deposit deductions per deposit, each carrying the deposit's tax category (v5); invoice status derived
- confirmed → confirmed by sales_rep · when readiness: not_done, not_below_done (no line below what is delivered or invoiced), approver_not_amender (where amendment_needs_approval), minimum_order (v12 SO-52, block mode: an amendment that leaves the order below the minimum applies only by another person's approval; the surcharge is recalculated by the re-price), delivery_multiple (v4, on changed lines), partners_unchanged_after_delivery (v5) · needs reason · revision n+1; only changed lines re-priced by the pricing procedure (priced_on today), the header shares re-spread; changed lines re-promised; a new confirmation can be sent; with inventory installed, the reservation re-sent with revision n+1
- confirmed → done by system · when every line delivered (or closed within tolerance) and invoiced in full, or not billing-relevant · edits refused
- confirmed → cancelled by order_admin · when readiness: nothing_delivered, nothing_invoiced, third_party_cancellable (purchasing agreed, v5) · needs reason · drafts it requested are cancelled in invoicing; an unused deposit is credited (v5); with inventory installed, the reservation released (POST /reservations/sales-orders/{sales_order_id}/release)
return_order
draft → authorised → received → closed → cancelled
- none → draft by sales_rep · when readiness: reference_required (the original order line, its delivery and invoice), within_delivered (no more than delivered less already returned on that line), return_reason · a sales_order of type RETURNS; each line copies the original line's price, unit and tax category, never re-priced
- draft → authorised by sales_rep · when readiness: incomplete:* (the RETURNS type's rules) · numbered RE-{yyyy}-{seq:4}: the RMA the customer quotes; the confirmation sent; inventory told to expect it (POST /expected-returns)
- authorised → received by system · when inventory received them against the RMA; a serial is one delivered to this customer · record_delivery on the return line with source inventory (positive, received)
- received → received by system · when accepted + rejected never above received · accepted and rejected quantities per line with the decision (restock, scrap, to supplier) and reason (POST /sales-orders/{sales_order_id}/return-inspections)
- received → received by system · when readiness: credit_point_reached (return_credit_on receipt, or the line inspected), within_invoiced (never above the original invoice line's net less earlier credits) · one credit note against the original invoice for what is accepted, less a restocking fee where the reason has one, keyed so:{sales_order_id}:{request_no}, its lines carrying the returns order's line
- received → closed by system · when every line inspected, and credited or rejected · edits refused
- draft / authorised → cancelled by sales_rep · when nothing received · needs reason · inventory's expected return withdrawn
rebate_agreement
draft → active → ended → settled → cancelled
- none → draft by order_admin · when a customer or price group; a basis (products, categories or all); a validity period · the agreement and its scale, editable
- draft → active by order_admin · when readiness: starts_after_today, scale_valid (tiers ascending, rates from 0 to 100 percent) · invoices from its start accrue against it
- active → active by system · when an invoice or credit note in the basis issued on the business date · accrual rows keyed (agreement, document, line) and the accrual journal posted to the ledger
- active → active by order_admin · needs reason · a settlement draft: the rate reached so far on the basis so far, less settled
- active → active by sales_controller · when readiness: approver_not_requester (by email and sign-in subject) · a credit note in invoicing keyed rebate:{agreement_id}:{settlement_no}; the accrual released by its amount
- active → ended by system · when valid_to is before today · no further accruals; the final basis fixed once the last day's invoices are accrued
- ended → ended by order_admin · the tier reached on the whole basis, retroactive, less what partial settlements paid
- ended → settled by sales_controller · when readiness: approver_not_requester · the accrual trued up in the ledger, one credit note in invoicing, the accrual account for the agreement nets to 0.00
- draft → cancelled by order_admin
What it keeps
| Thing | Meaning | Identified by | Shared? |
|---|---|---|---|
| sales order | what a customer has committed to buy, and on what terms | sales_order_id: VARCHAR, derived from its source ("quote:<quote_id>@v<version>", "po:<bp_id>:<customer PO>") or a uuid for an order by hand (shared.yaml keys.sales_order_id). The order NUMBER is stamped at confirmation, never the key | module-owned |
| order line | one product, quantity and price on the order | sales_order_idline_no | module-owned |
| line condition | one condition on a line (BASE, a discount, a surcharge, a share of a header condition, freight, a rebate accrual rate) as priced (v5) | sales_order_idline_nosteprevision | module-owned (append per revision; frozen at confirmation) |
| schedule line | a quantity of a line promised for a date, from inventory's ATP (v5) | sales_order_idline_noschedule_versionseq | module-owned (append-only: a re-promise is a new schedule_version; the latest version is in force) |
| billing milestone | one stage of a line billed by milestone: a percent or an amount, on a date or an event (v5) | sales_order_idline_nomilestone_no | module-owned |
| deposit deduction | how much of one deposit invoice an invoice request deducts (v5; the claim row two concurrent requests race for) | sales_order_iddeposit_request_noseq | module-owned (append-only; seq claimed with a plain INSERT: the loser re-reads what is left) |
| return inspection | what inventory found when a returned line was inspected (v5) | sales_order_idline_noinspection_ref | module-owned (append-only; written only by inventory's service client) |
| credit claim | how much of an invoice line a credit or return request takes (v5; stops two requests crediting the last pound twice) | invoice_idinvoice_line_noseq | module-owned (append-only; plain INSERT on (invoice_id, invoice_line_no, seq)) |
| order block | a delivery or billing block set or released on an order, with why (v5) | sales_order_idseq | module-owned (append-only); a block is in force while its last row is set |
| delivery | a record that some quantity of a line was delivered or done | sales_order_idline_nodelivery_ref | module-owned |
| invoice request | what the order asked invoicing to bill, and when | sales_order_idrequest_no | module-owned |
| revision | a change to a confirmed order, with why and who approved it | sales_order_idrevision | module-owned |
| send | a record that the confirmation went out | sales_order_idsent_at | module-owned |
| number series | the counter behind order numbers (state, not a setting); v5 one series per order type | series_id | module-owned (state) |
| number claim | one order number claimed from a type's series (v5) | series_idnumber | module-owned (a claim row per number, plain INSERT in the confirmation's own write) |
| suggestion | what an AI step suggested on an order, and what a person did with it (the audit of an AI step) | sales_order_idstepsuggestion_no | module-owned |
| minimum order policy | the smallest order value worth taking in a currency, and what happens below it (v12, SO-52) | currencycustomer_groupvalid_from | module-owned (configuration) |
| substitution record | one product that replaces another, from a date, and how (v12, SO-53) | original_product_idsubstitute_product_idcustomer_groupvalid_from | module-owned (configuration) |
| customer order policy | how one customer orders (PO required, default deposit), from a date | bp_idvalid_from | module-owned (configuration) |
| order type | what kind of order this is and how it behaves (v5, SAP sales document type) | order_type_code (STANDARD, RUSH, CASH, RETURNS, CREDIT_REQ, DEBIT_REQ, FREE_OF_CHARGE, CONS_FILL, CONS_ISSUE, CONS_PICKUP, CONS_RETURN seeded) | module-owned (configuration, dated; seeded) |
| item category | how one line behaves (v5, SAP item category): delivered from stock, a service, third party, free, returned | item_category_code (STD_STOCK, STD_SERVICE, THIRD_PARTY, FREE, RETURN, CONS_FILL, CONS_ISSUE seeded) | module-owned (configuration, seeded) |
| item category rule | which item category a line gets from its order type, its product's type and its usage, and which others the rep may choose (v5, SAP VOV4) | order_type_codeproduct_type_codeusagevalid_from | module-owned (configuration, dated) |
| condition type | a kind of price element: BASE, DISC_PCT, DISC_ABS, SURCH_PCT, SURCH_ABS, HDR_DISC, FREIGHT, REBATE (v5) | condition_type_code | module-owned (configuration) |
| access sequence | the order in which condition records are looked for, most specific first; the first hit wins (v5) | access_sequence_codestep | module-owned (configuration) |
| condition record | an agreed discount, surcharge or freight rate for a key (customer 7311 + COLA-075: 5%), with validity and an optional scale (v5) | condition_type_codekey_fieldskey_valuesvalid_from | module-owned (append-only; valid_from after today; a correction is a new row from a later date) |
| pricing procedure | the steps a line's price is built from, in order, with their subtotals (v5) | pricing_procedure_codestep | module-owned (configuration) |
| customer partner | who ships, bills and pays for a sold-to: its ship-tos, bill-to and payer (v5, SAP partner functions) | sold_to_bp_idfunction (ship_to | bill_to | payer)partner_bp_idvalid_from | module-owned (append-only; valid_from after today); every partner is a business partner (business-partner's bp_id) |
| incompletion rule | a field an order of a type must have before it is confirmed, delivered or billed (v5, SAP incompletion procedure) | order_type_codefieldvalid_from | module-owned (configuration, dated) |
| block reason | why an order is held for delivery or billing (v5) | block_reason_code | module-owned (configuration; APPROVAL seeded) |
| return reason | why goods come back and what that means for the credit (v5) | return_reason_code | module-owned (configuration) |
| rebate agreement | what a customer earns back on a period's purchases (v5) | rebate_agreement_id (RB-{yyyy}-{bp_id}, or the customer's own code) | module-owned |
| rebate accrual | the accrual one invoice or credit note line adds to an agreement (v5) | rebate_agreement_iddocument_idline_no | module-owned (append-only) |
| rebate settlement | a partial or final payout of an agreement, with who asked and who approved (v5) | rebate_agreement_idsettlement_no | module-owned |
| posting | what was asked of the ledger for a rebate accrual or true-up, and its answer (v5) | document_idevent | module-owned |
| task | something a person should do because the system changed a promise (tell the customer a new date) (v5) | sales_order_idkindraised_on | module-owned |
| settings | how this business takes orders | keyvalid_from | module-owned (configuration) |
An order system that also writes invoices is how a part-delivered order bills in full. The order asks; invoicing decides and owns the invoice.
What runs on its own
| Story | When | What |
|---|---|---|
| SO-12 | on read | fulfilment and invoice status |
| SO-13 | when the last invoice issues (invoicing's event) or the last delivery is recorded | lock the order |
| SO-33 | nightly, for the previous business day (the composition's clock worker, --reserved 1 --max-replicas 1, or an external scheduler) | rebate accruals from invoicing's GET /billed-lines and their journals |
| SO-36 | at the start of each business day, and when an order is cancelled | re-promise of open schedule lines through inventory's GET /atp |
| SO-14 | when a PO arrives in the order inbox | the PO extraction (DataK3 invoice-intake recipe shape over the order inbox bucket prefix), as a suggestion only |
Questions that shape your version
Read these out and let the customer correct one — people rarely recall a policy on demand and can always react to one. Standard is a named authority you can look up and hold us to. Commonly seen is exactly that: arrangements we have met, with no survey behind them. A customer doing none of them is not doing it wrong.
- When the customer says yes to a quote, is that the order, or do you wait for their PO?
- b2b services
- the signed quote is the order
- larger customers
- nothing starts without their PO number on the invoice
- Do you invoice when the order is confirmed, or when you deliver?
- subscriptions and fixed fees
- on order
- goods and time and materials
- on delivery
- Do you take a deposit up front?
Standard HMRC VAT Notice 700 section 14: a payment received before the basic tax point creates a tax point for the amount received
- Should an overdue customer be able to order?
- small firms
- a warning, the owner decides
- distributors
- block above the credit limit
- Can a confirmed order change, and who agrees?
- Which kinds of order do you have besides a normal sale (rush, cash at a counter, returns, credit requests, free samples, stock held at customers)?
- b2b services
- standard, credit requests
- wholesale
- standard, rush, returns, credit and debit requests, free of charge
- trade counter
- cash sales as well
- Besides the price list, do customers have agreed discounts, surcharges or freight?
- most small firms
- the price list only (BASE and a manual line discount)
- distributors
- customer and group discounts by category, freight by weight
- Do customers earn year-end rebates?
- Does any customer have goods delivered to depots, invoiced to head office, or paid by a group company?
- How are returns handled: authorised first, inspected, credited when?
- Are large jobs billed in stages?
- Do you sign contracts for what you sell (a subscription, a retainer)?
- reference
- the active contract bills directly through invoicing (no order), decided 2026-10-18
- firms that report on orders
- a draft order per contract, confirmed by a person
What you can change yourself
These are settings, not code: someone in your team changes them on a screen, without a developer and without a release.
- how this business takes orders
- each AI step's mode (ai_steps: off | suggest); so:settings:controls, and turning a step on is recorded as the owner's consent
- per customer, from a date after today: PO required, deposit percentage and deduction mode, delivery terms, part deliveries and tolerances, price group, minimum shelf life
- the order types, their series, billing, reference, default block, pricing procedure, approval limit (v5)
- how each kind of line behaves (v5)
- which item category a line gets per order type, product type and usage (v5)
- discounts, surcharges, header conditions, freight: how each is calculated, its manual limit, its account purpose (v5)
- where each condition type looks for a record, most specific first (v5)
- the agreed discounts, surcharges and freight rates per key, with validity and scales (v5); so:pricing:write
- the steps a price is built from (v5)
- each customer's ship-tos (and their transit days), bill-to and payer, from a date (v5)
- what each order type needs before confirmation, delivery or billing (v5)
- the reasons for delivery and billing blocks (v5)
- return reasons: inspect or not, restocking fee, credit on receipt or inspection (v5)
For builders
- Module spec — this page, for agents
- The lifecycle and the design template
Code
Public repositories, anonymous clone, one release tag each. Read README.md and AGENTS.md first.
- erp-brick-sales-order (brick, v0.2.0)
git clone --depth 1 --branch v0.2.0 https://git.dodil.io/dodil/erp-brick-sales-order.git
ssh:[email protected]:dodil/erp-brick-sales-order.git - erp-brick-product (brick, v0.2.2)
git clone --depth 1 --branch v0.2.2 https://git.dodil.io/dodil/erp-brick-product.git
ssh:[email protected]:dodil/erp-brick-product.git - brick-business-partner (brick, v0.4.0)
git clone --depth 1 --branch v0.4.0 https://git.dodil.io/dodil/erp-brick-business-partner.git
ssh:[email protected]:dodil/erp-brick-business-partner.git - erp-platform (platform, v0.9.13)
git clone --depth 1 --branch v0.9.13 https://git.dodil.io/dodil/erp-platform.git
ssh:[email protected]:dodil/erp-platform.git
Known gaps in the reference
- no picking or shipping here: with inventory installed (v3) stocked lines are reserved and delivered by inventory; without it, deliveries are recorded by a person
- no back-order documents: a part-delivered line simply has quantity left to deliver, with its schedule lines (v5)
- no margin on the order: cost is inventory's valuation (or the product's standard cost), shown only to the order admin
- no customer portal view of the order; the confirmation is emailed
- no optional products, upsell or order templates; quote templates belong to the quote brick
- no blanket orders or call-offs against a quantity or value contract: a signed contract bills through invoicing (contracts); scheduling agreements with delivery schedules are not modelled
- version 5 (order types, the pricing procedure, rebates, ATP dates, partner functions, returns, memo requests, free of charge, cash, consignment, milestones, part deposits, third party) is specified, not built
- cross-module, assumed by v5 and not yet in the other specs: business-partner addresses (ship-to), tax's place of supply by ship_to_country, invoicing's credit notes keyed by source_id with the caller's order lines and an account purpose, deductions by amount, issue_hint cash, GET /billed-lines; purchasing's POST /purchase-requests/from-sales-order; inventory's GET /atp, GET /sales-orders/{id}/fulfilment use, POST /expected-returns, GET /consignment-stock (inventory v3 specifies them)
- version 4 (pricing quantity on the line, the delivery multiple gate) is specified, not built
- catch weight on deliveries (the actual kilograms of pieces shipped, invoiced by weight) is designed in inventory and deferred to M7 (`deferred:`)
- the AI-step marker in the BPMN is a task name until erp-platform draws dodil:ai / dodil:mode (M0 AI-step contract)