Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c3b5b86
[ADD] sale_substate 12.0
mourad-ehm Oct 4, 2019
c4b2e7a
[FIX] base.substate.mixin model name
mourad-ehm Oct 17, 2019
5c18723
[IMP] add data, demo and tests
mourad-ehm Oct 25, 2019
399eed5
[FIX] pylint, oca_dependency & add readme files
mourad-ehm Oct 28, 2019
722c9be
[FIX] pep8
mourad-ehm Oct 28, 2019
a50f9e2
[FIX] Typo
mourad-ehm Oct 28, 2019
3383a32
[FIX] pylint
mourad-ehm Jan 3, 2020
0f25b60
[FIX] Demo (to validate test)
mourad-ehm Jan 6, 2020
63c8073
[FIX] substate position
Saran440 Sep 3, 2020
e35f51f
[FIX] Typo
mourad-ehm Sep 3, 2020
6acfebb
[IMP] add substate on tree/search view & update oca_dependencies.txt…
mourad-ehm Oct 9, 2020
aea8ad2
[FIX] typo
mourad-ehm Oct 12, 2020
bf8727f
Apply suggestions from code review
mourad-ehm Jan 8, 2021
fc4bb5a
[IMP] sale_substate: black, isort, prettier
mourad-ehm Jan 29, 2021
e2de25f
[MIG] sale_substate: Migration to 14.0
mourad-ehm Jan 29, 2021
32b8bad
[FIX] mail template & selction fields
mourad-ehm Jan 29, 2021
92587ef
[MIG] sale_substate: Migration to 15.0
alexeirivera87 Dec 23, 2021
3c04124
[MIG] sale_substate: Migration to 16.0
Dec 14, 2022
3ddf2dd
Added translation using Weblate (Spanish)
Ivorra78 Aug 21, 2023
1e2e010
Added translation using Weblate (Italian)
mymage Dec 7, 2023
7832502
[IMP] sale_substate: apply pre-commit auto fixes
Nov 20, 2024
90b118c
[MIG] sale_substate: Migration to 17.0
Nov 20, 2024
335170d
[UPD] Update sale_substate.pot
Nov 29, 2024
ecbb0a0
[BOT] post-merge updates
OCA-git-bot Nov 29, 2024
1304b32
Update translation files
weblate Nov 29, 2024
a79e468
[IMP] sale_substate: pre-commit auto fixes
Alexgars73 Feb 12, 2025
b791f32
[MIG] sale_substate: Migration to 18.0
Alexgars73 Feb 13, 2025
524095a
[UPD] Update sale_substate.pot
Jul 23, 2025
8b321ea
[BOT] post-merge updates
OCA-git-bot Jul 23, 2025
0fe2c30
[MIG] sale_substate: Migration to 19.0
np-oerp Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions sale_substate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==============
Sale Sub State
==============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:03f178d144b98915d3ba6b8ff0cbc71939c38af1dca237fc931936cc3e1552ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/19.0/sale_substate
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_substate
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to add a substate to sale order. For each sale order
state you can define a substate. With this module substates can be
defined allowing to extend the sales workflow. For example, you can add
substate "waiting for legal documents" if the order cannot be validated
without this document (sell a car for example).

**Table of contents**

.. contents::
:local:

Usage
=====

1. | Go to \*\* Settings > Technical > Sub State Configuration \*\* and
Add "Base Substate".
| If necessary you can add "Target State values" (ex define a
substate for "cancel" state). Substate sequence is very important.

2. Create a sale order and check if the substate are displayed on the
header of form view. Check if you can't set substate defined for sale
if sate is a quotation.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_substate%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion

Contributors
------------

- Mourad EL HADJ MIMOUNE <[email protected]>
- Alexei Rivera <[email protected]> (migration to 15.0)
- OERP Canada https://www.oerp.ca/:

- Nishi Patel [email protected]

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_substate>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_substate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions sale_substate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2019 Akretion (<http://www.akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Sub State",
"version": "19.0.1.0.0",
"category": "Tools",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"license": "AGPL-3",
"depends": ["base_substate", "sale_management"],
"data": [
"views/sale_views.xml",
"data/sale_substate_mail_template_data.xml",
"data/sale_substate_data.xml",
"data/sale_substate_demo.xml",
],
"installable": True,
}
19 changes: 19 additions & 0 deletions sale_substate/data/sale_substate_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="base_substate_type_sale" model="base.substate.type">
<field name="name">Sale order Substate</field>
<field name="model">sale.order</field>
<field name="target_state_field">state</field>
</record>
<!-- Sale related substate to Sale state (draft, sale) -->
<record id="target_state_value_draft" model="target.state.value">
<field name="name">Quotation</field>
<field name="base_substate_type_id" ref="base_substate_type_sale" />
<field name="target_state_value">draft</field>
</record>
<record id="target_state_value_sale" model="target.state.value">
<field name="name">Sale</field>
<field name="base_substate_type_id" ref="base_substate_type_sale" />
<field name="target_state_value">sale</field>
</record>
</odoo>
47 changes: 47 additions & 0 deletions sale_substate/data/sale_substate_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!--Sale Substate -->
<record id="base_substate_under_nego" model="base.substate">
<field name="name">In negotiation</field>
<field name="sequence">1</field>
<field name="target_state_value_id" ref="target_state_value_draft" />
</record>
<record id="base_substate_won" model="base.substate">
<field name="name">Won</field>
<field name="sequence">2</field>
<field name="target_state_value_id" ref="target_state_value_draft" />
</record>
<record id="base_substate_lost" model="base.substate">
<field name="name">Lost</field>
<field name="sequence">3</field>
<field name="target_state_value_id" ref="target_state_value_draft" />
</record>
<record id="base_substate_wait_docs" model="base.substate">
<field name="name">Waiting for legal documents</field>
<field name="sequence">4</field>
<field name="target_state_value_id" ref="target_state_value_draft" />
<field
name="mail_template_id"
ref="sale_substate.mail_template_data_sale_substate_wait_docs"
/>
</record>
<record id="base_substate_valid_docs" model="base.substate">
<field name="name">To validate legal documents</field>
<field name="sequence">5</field>
<field name="target_state_value_id" ref="target_state_value_sale" />
</record>
<record id="base_substate_in_delivery" model="base.substate">
<field name="name">In delivering</field>
<field name="sequence">6</field>
<field name="target_state_value_id" ref="target_state_value_sale" />
<field
name="mail_template_id"
ref="sale_substate.mail_template_data_sale_substate_delivery"
/>
</record>
<record id="base_substate_delivered" model="base.substate">
<field name="name">Delivered</field>
<field name="sequence">7</field>
<field name="target_state_value_id" ref="target_state_value_sale" />
</record>
</odoo>
63 changes: 63 additions & 0 deletions sale_substate/data/sale_substate_mail_template_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Sample Sale substate -related template -->
<record id="mail_template_data_sale_substate_wait_docs" model="mail.template">
<field name="name">Waiting for legal documents</field>
<field name="model_id" ref="sale.model_sale_order" />
<field name="subject">Reception of {{object.name}}</field>
<field name="use_default_to" eval="True" />
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear
<t t-out="object.partner_id.name or 'customer'">customer</t>
<br />
<br />
Thank you for your order.
<br />
In order to validate your order we need the legal documentation.
<br />
<br />
Thank you,
<br />
<t t-if="user.signature">
<br />
<t t-out="user.signature or ''" />
</t>
</p>
</div>
</field>
<field name="lang">{{ object.partner_id.lang }}</field>
<field name="auto_delete" eval="True" />
</record>
<record id="mail_template_data_sale_substate_delivery" model="mail.template">
<field name="name">In delivery</field>
<field name="model_id" ref="sale.model_sale_order" />
<field name="subject">Reception of {{object.name}}</field>
<field name="use_default_to" eval="True" />
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Dear
<t t-out="object.partner_id.name or 'customer'">customer</t>
<br />
Thank you for your order.
<br />
You order is being prepared for delivery.
You will receive a delivery tracking link to follow it.
<br />
<br />

Thank you,
<br />
<t t-if="user.signature">
<br />
<t t-out="user.signature or ''" />
</t>
</p>
</div>
</field>
<field name="lang">{{ object.partner_id.lang }}</field>
<field name="auto_delete" eval="True" />
</record>
</odoo>
Loading
Loading