Skip to content

Commit ac7f994

Browse files
committed
Merge PR OCA#942 into 16.0
Signed-off-by rvalyi
2 parents 4cf7b87 + 7ae2f33 commit ac7f994

15 files changed

+916
-0
lines changed

confirmation_wizard/README.rst

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
===================
2+
Confirmation Wizard
3+
===================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:efcbab8311be7e220ab27fa46f0fcd4567d0ad071dfc40be6e5aece82b96e299
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
20+
:target: https://github.com/OCA/server-ux/tree/16.0/confirmation_wizard
21+
:alt: OCA/server-ux
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-confirmation_wizard
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
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.
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Usage
39+
=====
40+
41+
To create configuration wizard:
42+
43+
Use confirm wizard which return method (return_type = method):
44+
45+
.. code-block:: python
46+
47+
def change_address(self, address):
48+
# Confirmation wizard
49+
action = (
50+
self.env["confirmation.wizard"]
51+
.confirm_message(
52+
_("Do you want to change the partner's address?"),
53+
records=self.env["res.partner"].browse(1), # One or more records
54+
title="Confirm",
55+
method="change_address",
56+
callback_params={"address": address}
57+
)
58+
)
59+
if action:
60+
return action
61+
... # Your code here
62+
63+
Use confirm wizard which does nothing and closes itself when clicking confirm (return_type = window_close):
64+
65+
.. code-block:: python
66+
67+
def method(self):
68+
...
69+
return (
70+
self.env["confirmation.wizard"]
71+
.with_context(hide_cancel=True)
72+
.confirm_no_action_message(
73+
message="Message",
74+
title="Notification"
75+
)
76+
)
77+
78+
Bug Tracker
79+
===========
80+
81+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
82+
In case of trouble, please check there if your issue has already been reported.
83+
If you spotted it first, help us to smash it by providing a detailed and welcomed
84+
`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**>`_.
85+
86+
Do not contact contributors directly about support or help with technical issues.
87+
88+
Credits
89+
=======
90+
91+
Authors
92+
~~~~~~~
93+
94+
* Cetmix
95+
96+
Contributors
97+
~~~~~~~~~~~~
98+
99+
* `Cetmix <cetmix.com>`_:
100+
* Ivan Sokolov
101+
* Mikhail Lapin
102+
* Maksim Shurupov
103+
104+
Maintainers
105+
~~~~~~~~~~~
106+
107+
This module is maintained by the OCA.
108+
109+
.. image:: https://odoo-community.org/logo.png
110+
:alt: Odoo Community Association
111+
:target: https://odoo-community.org
112+
113+
OCA, or the Odoo Community Association, is a nonprofit organization whose
114+
mission is to support the collaborative development of Odoo features and
115+
promote its widespread use.
116+
117+
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/16.0/confirmation_wizard>`_ project on GitHub.
118+
119+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

confirmation_wizard/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import wizard

confirmation_wizard/__manifest__.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (C) 2024 Cetmix OÜ
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Confirmation Wizard",
5+
"summary": """
6+
This module adds a confirmation wizard that can be called with code.
7+
It does nothing by itself.
8+
""",
9+
"version": "16.0.1.0.0",
10+
"category": "Tools",
11+
"website": "https://github.com/OCA/server-ux",
12+
"author": "Cetmix, Odoo Community Association (OCA)",
13+
"license": "LGPL-3",
14+
"application": False,
15+
"installable": True,
16+
"depends": ["base"],
17+
"data": [
18+
"security/ir.model.access.csv",
19+
"wizard/confirmation_wizard.xml",
20+
],
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* `Cetmix <cetmix.com>`_:
2+
* Ivan Sokolov
3+
* Mikhail Lapin
4+
* Maksim Shurupov
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

confirmation_wizard/readme/USAGE.rst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
To create configuration wizard:
2+
3+
Use confirm wizard which return method (return_type = method):
4+
5+
.. code-block:: python
6+
7+
def change_address(self, address):
8+
# Confirmation wizard
9+
action = (
10+
self.env["confirmation.wizard"]
11+
.confirm_message(
12+
_("Do you want to change the partner's address?"),
13+
records=self.env["res.partner"].browse(1), # One or more records
14+
title="Confirm",
15+
method="change_address",
16+
callback_params={"address": address}
17+
)
18+
)
19+
if action:
20+
return action
21+
... # Your code here
22+
23+
Use confirm wizard which does nothing and closes itself when clicking confirm (return_type = window_close):
24+
25+
.. code-block:: python
26+
27+
def method(self):
28+
...
29+
return (
30+
self.env["confirmation.wizard"]
31+
.with_context(hide_cancel=True)
32+
.confirm_no_action_message(
33+
message="Message",
34+
title="Notification"
35+
)
36+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
access_confirmation_wizard,access.confirmation.wizard,model_confirmation_wizard,base.group_system,1,1,1,1

0 commit comments

Comments
 (0)