Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
00fa179
[ADD] sale_substate 12.0
mourad-ehm Oct 4, 2019
05e8687
[FIX] base.substate.mixin model name
mourad-ehm Oct 17, 2019
d501170
[IMP] add data, demo and tests
mourad-ehm Oct 25, 2019
5171ed9
[FIX] pylint, oca_dependency & add readme files
mourad-ehm Oct 28, 2019
b5b6edf
[FIX] pep8
mourad-ehm Oct 28, 2019
846f76d
[FIX] Typo
mourad-ehm Oct 28, 2019
be5b7a0
[FIX] pylint
mourad-ehm Jan 3, 2020
5e15bfa
[FIX] Demo (to validate test)
mourad-ehm Jan 6, 2020
7ef9580
[FIX] substate position
Saran440 Sep 3, 2020
977e566
[FIX] Typo
mourad-ehm Sep 3, 2020
814ddf8
[IMP] add substate on tree/search view & update oca_dependencies.txt…
mourad-ehm Oct 9, 2020
c8a32ff
[FIX] typo
mourad-ehm Oct 12, 2020
f255319
Apply suggestions from code review
mourad-ehm Jan 8, 2021
2f9bec8
[IMP] sale_substate: black, isort, prettier
mourad-ehm Jan 29, 2021
a871a8a
[MIG] sale_substate: Migration to 14.0
mourad-ehm Jan 29, 2021
ff571f9
[FIX] mail template & selction fields
mourad-ehm Jan 29, 2021
535d1d2
[MIG] sale_substate: Migration to 15.0
alexeirivera87 Dec 23, 2021
fc5f69d
[MIG] sale_substate: Migration to 16.0
Dec 14, 2022
22be686
Added translation using Weblate (Spanish)
Ivorra78 Aug 21, 2023
7d13f63
Added translation using Weblate (Italian)
mymage Dec 7, 2023
0d5d896
[IMP] sale_substate: apply pre-commit auto fixes
Nov 20, 2024
9c1864c
[MIG] sale_substate: Migration to 17.0
Nov 20, 2024
19f8859
[UPD] Update sale_substate.pot
Nov 29, 2024
55c1424
[BOT] post-merge updates
OCA-git-bot Nov 29, 2024
2fea56a
Update translation files
weblate Nov 29, 2024
ef0a381
[IMP] sale_substate: pre-commit auto fixes
Alexgars73 Feb 12, 2025
c829ceb
[MIG] sale_substate: Migration to 18.0
Alexgars73 Feb 13, 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
93 changes: 93 additions & 0 deletions sale_substate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
==============
Sale Sub State
==============

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

.. |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/licence-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/18.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-18-0/sale-workflow-18-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=18.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:%2018.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 <mourad.elhadj.mimoune@akretion.com>
- Alexei Rivera <arivera@archeti.com> (migration to 15.0)

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/18.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
21 changes: 21 additions & 0 deletions sale_substate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2019 Akretion (<http://www.akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Sub State",
"version": "18.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",
],
"demo": [
"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