Deltatech Purchase Order Stage
by Terrabit https://www.terrabit.ro , Dorin Hongu https://www.terrabit.ro
Odoo
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Purchase (purchase)
• Invoicing (account) • Discuss (mail) • Inventory (stock) |
| Lines of code | 167 |
| Technical Name |
deltatech_purchase_phase |
| License | OPL-1 |
| Website | https://www.terrabit.ro |
| Versions | 17.0 18.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Purchase (purchase)
• Invoicing (account) • Discuss (mail) • Inventory (stock) |
| Lines of code | 167 |
| Technical Name |
deltatech_purchase_phase |
| License | OPL-1 |
| Website | https://www.terrabit.ro |
| Versions | 17.0 18.0 |
Deltatech Purchase Order Stage

Overview
This module adds a lightweight phase/stage tracking on purchase orders. It introduces configurable phases and keeps the current phase on each purchase.order, with optional automatic transitions aligned with Odoo’s document state.
Key features
- Phase on Purchase Orders
- New field phase_id on purchase.order (tracked in the chatter) to indicate the current phase of the document.
- Helper field phase_ids (Many2many with compute/inverse) to enable flexible UI widgets and search domains that expect a multi-value relation, while still storing a single effective phase via phase_id.
- Automatic phase changes
- When the RFQ is sent (state = sent), the phase is set to the phase with code rfq.
- When the PO is confirmed (state = purchase), the phase is set to the phase with code purchase_confirm.
- If a referenced phase code does not exist, it will be created on the fly with the same code and name.
- Manual control and auditing
- Users can manually change the phase on the Purchase Order form.
- Changes to phase_id are tracked for auditability.
Configuration
- Go to: Purchase → Configuration → Purchase Order Phases
- Create or adjust the phases you need:
- Code: unique technical key (e.g., draft, rfq, purchase_confirm, done).
- Name: human-readable label shown to users.
Usage
- Open any Purchase Order and set the Phase. The field is tracked in the chatter.
- On sending an RFQ or confirming the order, the phase may update automatically as described above. You can still override it manually afterwards.
- For data loads or special flows where you want to skip auto-updates, pass context {"skip_phase_update": True} to writes on purchase.order.
Technical notes
- Models/fields
- purchase.order:
- phase_id = fields.Many2one("purchase.order.phase", tracking=True, copy=False)
- phase_ids = fields.Many2many("purchase.order.phase", compute=..., inverse=...) The compute mirrors phase_id to a single-item M2M; the inverse writes back the first selected phase into phase_id.
- Helper API: set_phase(code) sets/creates the phase by its code and writes it on the current order(s).
- purchase.order:
- Behavior hooks
- write() override updates the phase when state transitions to sent or purchase.
- Context key skip_phase_update prevents automatic changes during programmatic writes.
Dependencies and compatibility
- Depends on purchase_stock (Odoo 18)
- Designed to be non-invasive: it does not alter the standard state machine of Purchase Orders; it only adds complementary phase tracking.
Limitations and extensions
- Out of the box, automatic transitions are defined for rfq and purchase_confirm. You can extend this behavior via studio, server actions, or small Python overrides to cover additional states (e.g., done, cancel).
Licensing
- License: OPL-1 (see addon root README for details)
Credits
- Author/Maintainer: Dorin Hongu (@ Terrabit / Deltatech)
Table of contents
Bug Tracker
Bugs are tracked on Terrabit Issues. In case of trouble, please check there if your issue has already been reported.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- Terrabit
- Dorin Hongu
Maintainers
Current maintainer:

This module is part of the dhongu/deltatech project on GitHub.
You are welcome to contribute.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module