Skip to content

Commit

Permalink
[ADD] sale_order_type_confirm_message
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisho99 committed Dec 19, 2024
1 parent 213271c commit 8af17b7
Show file tree
Hide file tree
Showing 21 changed files with 851 additions and 0 deletions.
105 changes: 105 additions & 0 deletions sale_order_type_confirm_message/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
===============================
Sale Order Type Confirm Message
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cde4ce5b80daab597a13812115071dba91e2de486f2fe35145103ff172256c36
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/17.0/sale_order_type_confirm_message
: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-17-0/sale-workflow-17-0-sale_order_type_confirm_message
: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=17.0
:alt: Try me on Runboat

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

This module includes a validation step when confirming a sale order.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to Sales > Configuration > Sales Order Types
2. Select a Sale Order Type and toggle the "Has Confirmation Message"
button.
3. A Confirmation Message field will apear, fill it to include the text
that has to be shown on the confirmation screen.

Usage
=====

To use this module, you need to:

- Create a sales order type with the checkbox "Has Confirmation
Message" activated, and assign a message in the "Confirmation
Message" field.
- Once the user tries to validate a sales quotation that has a
confirmation message in it's sales order type, a warning popup will
be shown.
- If the user selects the Confirm button, this sales quotation will be
confirmed as usual. If the user selects the Cancel button, the popup
will be closed and he will go back to the 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_order_type_confirm_message%0Aversion:%2017.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
-------

* Sygel

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

- Manuel Regidor [email protected]
- Alberto Martínez [email protected]
- Valentin Vinagre [email protected]
- Harald Panten [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/17.0/sale_order_type_confirm_message>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions sale_order_type_confirm_message/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2020 Manuel Regidor <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
20 changes: 20 additions & 0 deletions sale_order_type_confirm_message/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Manuel Regidor <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sale Order Type Confirm Message",
"summary": "Confirmation requirement when validating sale",
"version": "17.0.1.0.0",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
"author": "Sygel, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["sale_order_type"],
"data": [
"security/ir.model.access.csv",
"wizards/sale_order_type_confirm_message_wizard_view.xml",
"views/sale_order_type_view.xml",
],
}
5 changes: 5 additions & 0 deletions sale_order_type_confirm_message/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2021 Manuel Regidor <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import sale_order_type
from . import sale_order
23 changes: 23 additions & 0 deletions sale_order_type_confirm_message/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2021 Manuel Regidor <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, models


class SaleOrder(models.Model):
_inherit = "sale.order"

def action_confirm(self):
if (
not self.env.context.get("bypass_double_confirmation")
and self.type_id.has_confirmation_message
):
return {
"type": "ir.actions.act_window",
"name": _("Confirm Order"),
"res_model": "sale.order.type.confirm.wizard",
"view_type": "form",
"view_mode": "form",
"target": "new",
}
return super().action_confirm()
13 changes: 13 additions & 0 deletions sale_order_type_confirm_message/models/sale_order_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 Manuel Regidor <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class SaleOrderTypology(models.Model):
_inherit = "sale.order.type"

has_confirmation_message = fields.Boolean()
confirmation_message = fields.Text(
translate=True,
)
3 changes: 3 additions & 0 deletions sale_order_type_confirm_message/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions sale_order_type_confirm_message/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To configure this module, you need to:

1. Go to Sales > Configuration > Sales Order Types
2. Select a Sale Order Type and toggle the "Has Confirmation Message" button.
3. A Confirmation Message field will apear, fill it to include the text that has to be shown on the confirmation screen.
4 changes: 4 additions & 0 deletions sale_order_type_confirm_message/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Manuel Regidor <[email protected]>
- Alberto Martínez <[email protected]>
- Valentin Vinagre <[email protected]>
- Harald Panten <[email protected]>
1 change: 1 addition & 0 deletions sale_order_type_confirm_message/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module includes a validation step when confirming a sale order.
5 changes: 5 additions & 0 deletions sale_order_type_confirm_message/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

- Create a sales order type with the checkbox "Has Confirmation Message" activated, and assign a message in the "Confirmation Message" field.
- Once the user tries to validate a sales quotation that has a confirmation message in it's sales order type, a warning popup will be shown.
- If the user selects the Confirm button, this sales quotation will be confirmed as usual. If the user selects the Cancel button, the popup will be closed and he will go back to the quotation.
2 changes: 2 additions & 0 deletions sale_order_type_confirm_message/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
sale_order_type_confirm_wizard_user,sale_order_type_confirm_wizard_user,model_sale_order_type_confirm_wizard,sales_team.group_sale_salesman,1,1,1,1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions sale_order_type_confirm_message/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8af17b7

Please sign in to comment.