Browse Source

portal_partner_select_all: New module

14.0
David 6 years ago
committed by skeller1
parent
commit
2d9ce2ae17
  1. 89
      portal_partner_select_all/README.rst
  2. 3
      portal_partner_select_all/__init__.py
  3. 20
      portal_partner_select_all/__manifest__.py
  4. 1
      portal_partner_select_all/readme/CONTRIBUTORS.rst
  5. 5
      portal_partner_select_all/readme/DESCRIPTION.rst
  6. 8
      portal_partner_select_all/readme/USAGE.rst
  7. 4
      portal_partner_select_all/wizard/__init__.py
  8. 27
      portal_partner_select_all/wizard/portal_wizard.py
  9. 19
      portal_partner_select_all/wizard/portal_wizard.xml

89
portal_partner_select_all/README.rst

@ -0,0 +1,89 @@
=========================
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/10.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-10-0/partner-contact-10-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/10.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 <https://github.com/OCA/partner-contact/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 <https://github.com/OCA/partner-contact/issues/new?body=module:%20portal_partner_select_all%0Aversion:%2010.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
~~~~~~~
* Tecnativa
Contributors
~~~~~~~~~~~~
* David Vidal <david.vidal@tecnativa.com>
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 <https://github.com/OCA/partner-contact/tree/10.0/portal_partner_select_all>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

3
portal_partner_select_all/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import wizard

20
portal_partner_select_all/__manifest__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa S.L. - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Portal Partner Select All',
'version': '10.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,
}

1
portal_partner_select_all/readme/CONTRIBUTORS.rst

@ -0,0 +1 @@
* David Vidal <david.vidal@tecnativa.com>

5
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.

8
portal_partner_select_all/readme/USAGE.rst

@ -0,0 +1,8 @@
#. 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.

4
portal_partner_select_all/wizard/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import portal_wizard

27
portal_partner_select_all/wizard/portal_wizard.py

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# 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})

19
portal_partner_select_all/wizard/portal_wizard.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="portal_wizard">
<field name="model">portal.wizard</field>
<field name="inherit_id" ref="portal.wizard_view"/>
<field name="arch" type="xml">
<field name="portal_id" position="after">
<field name="set_all_users"/>
</field>
<field name="user_ids" position="before">
<div class="alert alert-warning alert-dismissable" attrs="{'invisible': [('set_all_users', '=', False)]}">
<i class="fa fa-warning"/> You're about to invite to portal all the contacts list below.
</div>
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save