diff --git a/portal_partner_select_all/README.rst b/portal_partner_select_all/README.rst new file mode 100644 index 000000000..309a70c98 --- /dev/null +++ b/portal_partner_select_all/README.rst @@ -0,0 +1,91 @@ +========================= +Portal Partner Select All +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fpartner--contact-lightgray.png?logo=github + :target: https://github.com/OCA/partner-contact/tree/12.0/portal_partner_select_all + :alt: OCA/partner-contact +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-portal_partner_select_all + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/134/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +When a user wants invite a lot of custumers to the portal it can be a pain to +select them all one by one. + +This module adds a helper in the wizard to toggle between all selected and only +the ones that already exist. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. Go to *Contacts* and choose the tree view. +#. Filter the ones you want to invite to the portal. +#. Click on *Action > Portal Access Management* +#. In the wizard there's now a check box to invite to all the contacts in the + list. +#. Set it on and a warning will appear advising all of them will be invited. +#. Set it off again and only the already existing users will be checked. + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `__: + + * David Vidal + +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/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/portal_partner_select_all/__init__.py b/portal_partner_select_all/__init__.py new file mode 100644 index 000000000..40272379f --- /dev/null +++ b/portal_partner_select_all/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/portal_partner_select_all/__manifest__.py b/portal_partner_select_all/__manifest__.py new file mode 100644 index 000000000..9633ff2c9 --- /dev/null +++ b/portal_partner_select_all/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': 'Portal Partner Select All', + 'version': '12.0.1.0.1', + 'category': 'Custom', + 'author': 'Tecnativa,' + 'Odoo Community Association (OCA)', + 'website': 'https://www.github.com/OCA/partner-contact', + "license": "AGPL-3", + 'depends': [ + 'portal', + ], + 'data': [ + 'wizard/portal_wizard.xml', + ], + 'installable': True, +} diff --git a/portal_partner_select_all/i18n/portal_partner_select_all.pot b/portal_partner_select_all/i18n/portal_partner_select_all.pot new file mode 100644 index 000000000..1eca76bbb --- /dev/null +++ b/portal_partner_select_all/i18n/portal_partner_select_all.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * portal_partner_select_all +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: portal_partner_select_all +#: model:ir.ui.view,arch_db:portal_partner_select_all.portal_wizard +msgid " You're about to invite to portal all the contacts list below." +msgstr "" + +#. module: portal_partner_select_all +#: model:ir.model.fields,field_description:portal_partner_select_all.field_portal_wizard_set_all_users +msgid "Invite all the contacts" +msgstr "" + +#. module: portal_partner_select_all +#: model:ir.model,name:portal_partner_select_all.model_portal_wizard +msgid "Portal Access Management" +msgstr "" + diff --git a/portal_partner_select_all/readme/CONTRIBUTORS.rst b/portal_partner_select_all/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..e5276b375 --- /dev/null +++ b/portal_partner_select_all/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `__: + + * David Vidal diff --git a/portal_partner_select_all/readme/DESCRIPTION.rst b/portal_partner_select_all/readme/DESCRIPTION.rst new file mode 100644 index 000000000..6281e8dd6 --- /dev/null +++ b/portal_partner_select_all/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +When a user wants invite a lot of custumers to the portal it can be a pain to +select them all one by one. + +This module adds a helper in the wizard to toggle between all selected and only +the ones that already exist. diff --git a/portal_partner_select_all/readme/USAGE.rst b/portal_partner_select_all/readme/USAGE.rst new file mode 100644 index 000000000..0df9ccf3e --- /dev/null +++ b/portal_partner_select_all/readme/USAGE.rst @@ -0,0 +1,7 @@ +#. Go to *Contacts* and choose the tree view. +#. Filter the ones you want to invite to the portal. +#. Click on *Action > Portal Access Management* +#. In the wizard there's now a check box to invite to all the contacts in the + list. +#. Set it on and a warning will appear advising all of them will be invited. +#. Set it off again and only the already existing users will be checked. diff --git a/portal_partner_select_all/static/description/icon.png b/portal_partner_select_all/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/portal_partner_select_all/static/description/icon.png differ diff --git a/portal_partner_select_all/static/description/index.html b/portal_partner_select_all/static/description/index.html new file mode 100644 index 000000000..cdd31b173 --- /dev/null +++ b/portal_partner_select_all/static/description/index.html @@ -0,0 +1,438 @@ + + + + + + +Portal Partner Select All + + + +
+

Portal Partner Select All

+ + +

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

When a user wants invite a lot of custumers to the portal it can be a pain to +select them all one by one.

+

This module adds a helper in the wizard to toggle between all selected and only +the ones that already exist.

+

Table of contents

+ +
+

Usage

+
    +
  1. Go to Contacts and choose the tree view.
  2. +
  3. Filter the ones you want to invite to the portal.
  4. +
  5. Click on Action > Portal Access Management
  6. +
  7. In the wizard there’s now a check box to invite to all the contacts in the +list.
  8. +
  9. Set it on and a warning will appear advising all of them will be invited.
  10. +
  11. Set it off again and only the already existing users will be checked.
  12. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/partner-contact project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/portal_partner_select_all/wizard/__init__.py b/portal_partner_select_all/wizard/__init__.py new file mode 100644 index 000000000..b922ddc32 --- /dev/null +++ b/portal_partner_select_all/wizard/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import portal_wizard diff --git a/portal_partner_select_all/wizard/portal_wizard.py b/portal_partner_select_all/wizard/portal_wizard.py new file mode 100644 index 000000000..aabdb8038 --- /dev/null +++ b/portal_partner_select_all/wizard/portal_wizard.py @@ -0,0 +1,25 @@ +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class PortalWizard(models.TransientModel): + _inherit = "portal.wizard" + + set_all_users = fields.Boolean( + string="Invite all the contacts", + default=False, + ) + + @api.onchange('set_all_users') + def onchange_set_all_users(self): + """Toggle between select all partners and the default""" + if not self.set_all_users: + for user in self.user_ids: + user.in_portal = ( + user.partner_id.user_ids and + self.portal_id in user.partner_id.user_ids[0].groups_id + ) + else: + not_in_portal = self.user_ids.filtered(lambda x: not x.in_portal) + not_in_portal.update({'in_portal': True}) diff --git a/portal_partner_select_all/wizard/portal_wizard.xml b/portal_partner_select_all/wizard/portal_wizard.xml new file mode 100644 index 000000000..3623de060 --- /dev/null +++ b/portal_partner_select_all/wizard/portal_wizard.xml @@ -0,0 +1,21 @@ + + + + + portal.wizard + + + + + + +
+
+ You're about to invite to portal all the contacts list below. +
+
+
+
+
+ +