PMIS Situation Stock Operations
Connects Situation operational material flows to normal Odoo stock documents. Internal purchase Situations use an Operations Manager consumption route. Final positive sign-off by the customer Control Officer, or a permitted represented signature recorded by an internal presenter, is the delivery-confirmation event for explicitly mapped material quantities on a temporary sale / outside Situation.
Done stock moves and their standard valuation layers provide actual material cost. Automatically valued products create the normal posted stock journal entry selected by Odoo product, category, location, company and Anglo-Saxon configuration. The addon never fabricates quants, valuation layers or accounting moves.
Table of contents
Business timeline
After a temporary sale Situation is submitted, the Control Officer signs directly or through represented evidence. Completion delivers explicitly mapped material, verifies its valuation and stock accounting, accepts the Situation, and applies the company invoice policy. That policy can create or post an invoice during the same completion attempt. Payment is a separate accounting operation.
The certified work quantity is not a material quantity. Every included contractual-work or accepted-variation line must explicitly select either Material delivery applies with a storable product, compatible UoM and positive quantity, or No material applies. Missing classification blocks sign-off preparation; no quantity is inferred from customer-certified work.
Event |
Stock effect |
Accounting effect |
|---|---|---|
Situation submission |
None |
None |
Positive final sign-off |
Delivery requested |
No receivable, revenue, VAT or payment entry |
Completion error |
No partial picking, reservation or delivery survives the failed attempt |
No partial valuation, stock entry or invoice survives; signature remains |
Completed stock valuation |
Done move and normal SVL |
Real-time products post the normal inventory/stock-output entry; manual valuation posts no entry |
Draft invoice |
No repeated stock movement |
Draft only; no posted invoice |
Posted invoice |
No repeated stock movement |
Normal receivable, revenue and tax entry |
Payment |
None |
Normal payment/reconciliation |
Stock return |
Normal linked return move/SVL |
Normal stock reversal entry |
Credit note |
No stock return by itself |
Separate invoice reversal |
Delivery cost is the value from stock valuation layers at FIFO, average or standard cost. It is not the Situation selling price. Draft-invoice policy does not change delivery-cost registration.
Temporary sale delivery
Classify every included line explicitly as material or no-material.
Submit and prepare the immutable Situation revision for sign-off.
The authorized customer Control Officer records final positive sign-off, or an internal presenter with separate represented-signature authority records the Control Officer's in-person or uploaded-paper evidence.
The signature remains durable while one savepoint atomically validates configuration, creates or reuses the outgoing picking and delivery moves, fully reserves and validates the picking, verifies valuation and real-time stock accounting, accepts the Situation, applies invoice policy and completes the case.
Insufficient stock, partial reservation, missing tracking allocation, valuation or invoice failure rolls back all downstream effects and leaves the signed case in completion error.
The configured internal completion responsible uses Complete Signed Situation after correction; retry never creates another signature.
Tracked products complete automatically only when normal reservation supplies explicit lot/serial allocation. No lot, serial, quant, valuation layer or journal entry is fabricated. Measurement Book sign-off, purchase/inside Situations, final Situations, and non-positive outcomes do not invoke customer delivery.
Internal purchase consumption
Internal purchase Situations use an explicit internally confirmed quantity and an internal-to-production picking. Available untracked material validates immediately; unavailable or tracked material stays pending. This quantity remains separate from customer certification.
Configure the project and optional site's consumption locations and operation type. The acting user must be the responsible user on the project and, when present, on the site, with PMIS Operations Manager and Stock User access.
On a purchase Situation, enter Internal Confirmed Quantity for storable material lines with a unit of measure. Only positive quantities are consumed.
Submit the Situation and use Confirm Material Consumption. The action is also available while the Situation is accepted.
Review the Material Consumption tab. For pending stock, resolve availability or tracking on the linked picking. Use Retry Stock Completion to retry automatic completion of available untracked stock; tracked products require the normal warehouse validation workflow.
An unvalidated consumption picking can be cancelled with the Situation by the responsible Operations Manager. A Done picking blocks Situation cancellation and deletion; correct stock through Odoo's return workflow.
Configuration
The module depends on pmis_signoff and stock_account. Configure the temporary Situation sign-off workflow and authorities in pmis_signoff. Project values are defaults; each nonempty site value overrides the matching project value.
For internal purchase consumption configure:
an internal company source;
a company production-type destination;
a company operation type.
For temporary sale delivery configure:
an internal company delivery source;
a company customer-type destination;
a company outgoing operation type;
an internal delivery operator with PMIS Operations Manager and Stock User access.
The locations and operation type must belong to the Situation company, including the customer or production destination. The Situation Completion Responsible must be an internal user allowed for that company. Real-time-valued delivery products also require a stock valuation account, stock output account and stock journal. The prepare-and-post invoice policy requires invoice permissions for the completion responsible.
The customer Control Officer does not receive Stock or Accounting access. A represented signature additionally requires the PMIS Represented Sign-off Presenter group and matching represented-presenter authority configured in pmis_signoff. The authenticated evidence actor and operational stock actor are retained separately.
Availability and retry
A positive customer signature remains stored, but it does not make a failed Situation accepted. A signed completion error exposes separate signature, completion, delivery, valuation, stock-accounting, invoice and payment statuses. When an eligible responsible user is available, one internal activity is assigned and closed after successful retry. Retry revalidates immutable evidence and revision, records retry/success attribution, locks the case and Situation rows, and reuses deterministic records.
The completion responsible remains in case access only while active, internal, allowed for the company, and still holding the Operations Manager, Stock User, and policy-dependent invoice permissions. Responsibility or eligibility changes refresh affected cases under the same deterministic case lock used by signing and retry. An open completion activity is reassigned in place; if no eligible user exists it is closed as a configuration issue while the case remains in completion error. Accounting Manager membership alone grants no case or evidence access.
Stock execution uses a scoped elevated recordset only after company, route, product, valuation and responsible-user validation. It does not impersonate the configured human responsible and does not grant Stock or Accounting groups to the customer signer or presenter. Invoice posting still requires normal Accounting permission from the configured completion responsible.
Invoice policy
The company invoice policy determines what follows successful stock delivery:
certification only: delivery cost is registered and no invoice is created;
prepare draft: delivery cost is registered and one reusable draft invoice is prepared;
prepare and post: delivery cost is registered and the invoice is posted through normal accounting permissions.
Certification-only creates no invoice. Prepare-draft creates one unposted invoice and no receivable/revenue/tax entry. Prepare-and-post verifies stock cost accounting first; a posting failure rolls the whole downstream attempt back. A posted invoice is never rebuilt and successful retry never repeats stock delivery.
Traceability and correction
The Situation links its root picking. Moves link the Situation and Situation line. Standard valuation layers and their posted journal entries retain the normal stock-move links. The UI shows delivery status, error, signer, stock operator, actual cost, picking, invoice and invoice state.
Do not mutate Done moves, valuation layers or posted entries. Use the normal controlled Odoo stock return workflow; returned moves retain Situation, line and route lineage. Gross delivery cost, returned value and net delivery cost come from linked completed valuation layers in company currency. Corrected redelivery creates only missing net quantity on the next uniquely sequenced delivery picking. Invoice credit notes remain separate and do not return material. Signed evidence is not changed by returns or redelivery.
Use Complete Signed Situation on a case in completion error, or Retry Delivery Completion on the Situation, as the configured completion responsible. For an accepted case with a partial return, Retry Delivery Completion delivers only the missing net quantity. A full return sets delivery to cancelled; the server action supports that state, but the current form hides the retry button for cancelled deliveries.
Tests
Tests are organized by model. test_pmis_situation_consumption.py and test_pmis_situation_delivery.py cover the two Situation routes; separate files cover Situation lines, project/site responsibility, cases, pickings and return lines. Shared setup lives in common_consumption.py and common_delivery.py.
Run this addon with the standard PMIverse runner only:
/srv/pmiverse/_pmiconfig/scripts/test/run_pytest_addon.sh \ -a /srv/pmiverse/_pmisuite18/repos/pmiverse/operations/pmis_situation_stock/tests \ -d test_pmis_situation_stock -- -q -r a
Do not use raw pytest or odoo-bin as the standard workflow.
Non-goals
This addon does not automate payments, invoice credit notes or creation of a stock return. Certification remains owned by pmis_signoff and invoice policy remains owned by pmis_assessment.
Bug Tracker
Bugs are tracked on PMISuite Repository Issues.
Credits
Contributors
Matjaž Mozetič



