|
| 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. |
0 commit comments