Skip to content

Commit

Permalink
[ADD] confirmation_wizard: Module added
Browse files Browse the repository at this point in the history
  • Loading branch information
geomer198 committed Aug 27, 2024
1 parent adcd164 commit af7b05b
Show file tree
Hide file tree
Showing 15 changed files with 869 additions and 0 deletions.
117 changes: 117 additions & 0 deletions confirmation_wizard/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
===================
Confirmation Wizard
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:efcbab8311be7e220ab27fa46f0fcd4567d0ad071dfc40be6e5aece82b96e299
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/16.0/confirmation_wizard
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-confirmation_wizard
: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/server-ux&target_branch=16.0
:alt: Try me on Runboat

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

The module lets the developer trigger a confirmation wizard during any action in Odoo. Based on data passed to the wizard and, based on user input, executes specified methods or close wizard.

**Table of contents**

.. contents::
:local:

Usage
=====

To create configuration wizard:

Use confirm wizard which return method (return_type = method):

.. code-block:: python
def change_address(self, address):
if self._context("skip_confirm", False):
return (
self.env["confirmation.message.wizard"]
.with_context(skip_confirm=True)
.confirm_message(
"Are you ready change partner address",
records=self.env["res.partner"].browse(1), # One or more records
title="Confirm",
method="change_address",
callback_params={"address": address}
)
)
Use confirm wizard which return window close (return_type = window_close):

.. code-block:: python
def method(self):
...
return (
self.env["confirmation.message.wizard"]
.with_context(invisible_cancel=True)
.confirm_no_action_message(
text="Message",
title="Notification"
)
)
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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/server-ux/issues/new?body=module:%20confirmation_wizard%0Aversion:%2016.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
~~~~~~~

* Cetmix

Contributors
~~~~~~~~~~~~

* `Cetmix <cetmix.com>`_:
* Ivan Sokolov
* Mikhail Lapin
* Maksim Shurupov

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/server-ux <https://github.com/OCA/server-ux/tree/16.0/confirmation_wizard>`_ 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 confirmation_wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import wizard
21 changes: 21 additions & 0 deletions confirmation_wizard/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2024 Cetmix OÜ
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Confirmation Wizard",
"summary": """
This module adds a confirmation wizard that can be called with code.
It does nothing by itself.
""",
"version": "16.0.1.0.0",
"category": "Tools",
"website": "https://github.com/OCA/server-ux",
"author": "Cetmix, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"wizard/confirmation_message_wizard.xml",
],
}
4 changes: 4 additions & 0 deletions confirmation_wizard/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Cetmix <cetmix.com>`_:
* Ivan Sokolov
* Mikhail Lapin
* Maksim Shurupov
1 change: 1 addition & 0 deletions confirmation_wizard/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The module lets the developer trigger a confirmation wizard during any action in Odoo. Based on data passed to the wizard and, based on user input, executes specified methods or close wizard.
34 changes: 34 additions & 0 deletions confirmation_wizard/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
To create configuration wizard:

Use confirm wizard which return method (return_type = method):

.. code-block:: python
def change_address(self, address):
if self._context("skip_confirm", False):
return (
self.env["confirmation.message.wizard"]
.with_context(skip_confirm=True)
.confirm_message(
"Are you ready change partner address",
records=self.env["res.partner"].browse(1), # One or more records
title="Confirm",
method="change_address",
callback_params={"address": address}
)
)
Use confirm wizard which return window close (return_type = window_close):

.. code-block:: python
def method(self):
...
return (
self.env["confirmation.message.wizard"]
.with_context(invisible_cancel=True)
.confirm_no_action_message(
text="Message",
title="Notification"
)
)
2 changes: 2 additions & 0 deletions confirmation_wizard/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
access_confirmation_message_wizard,access.confirmation.message.wizard,model_confirmation_message_wizard,base.group_system,1,1,1,1
Loading

0 comments on commit af7b05b

Please sign in to comment.