Skip to content

Commit

Permalink
[9.0][IMP][auth_supplier] Remove useless group. Mark as customer.
Browse files Browse the repository at this point in the history
The whole purpose of this module was to be able to separate a customer and a supplier portals.

Given the status of the upstream implementations of portals, it is not possible to have a supplier portal without portal permissions. Thus, it would be required to make the group this module was creating inherit from `base.group_portal`, which would give suppliers access to all customers portal. As such, that group becomes useless.

From now on, this distinction should be made with simply checking if `user.customer` or `user.supplier` is `True`. This means no additional problems since `ir.rule` domains can use the `user` variable. To allow that, I'm implementing what was discussed at OCA#434 (diff).

Tests had to be removed because odoo/odoo#12237 makes the created record to disappear, so there's no way to actually check the created user was created with customer or supplier flag on.
  • Loading branch information
yajo committed Jun 28, 2016
1 parent c12b5a0 commit c5b18d5
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 89 deletions.
22 changes: 5 additions & 17 deletions auth_supplier/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ Auth Supplier
=============

This module was written to extends the functionality of auth signup and allows
the user to create an account as a supplier, marking him as with permissions
for a supplier portal (although nothing is implemented for that portal, other
modules should do that).
the user to create an account as a supplier or customer, marking his related
created partner as such.

Configuration
=============
Expand All @@ -29,18 +28,9 @@ To use this module, you need to:
* Log out.
* If you have a website, in home page press *Sign in*.
* Press *Sign up* to go to `the sign up page </web/signup>`_.
* Select *Supplier* in account type.
* Select *Supplier* or *Customer* in account type.
* Fill the form.

If you want to give permissions to anybody for the supplier portal:

#. Go to *Contacts*.
#. Choose a supplier.
#. Go to *Action > Portal Access Management*.
#. Choose *Other Extra Rights / Supplier Portal*.
#. Choose contacts to be *In Portal*.
#. Press *Apply*.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/149/9.0
Expand All @@ -50,10 +40,8 @@ Known issues / Roadmap

* If you have nothing in the portal, the user will be redirected to an empty
page.
* When the user signs up as *Customer*, it is not really marked as such in the
backend, it's just not marked as supplier. Is this expected behavior or bug?
`Relevant discussion
<https://github.com/OCA/server-tools/pull/434#discussion-diff-64883758>`_.
* Tests are not possible due to https://github.com/odoo/odoo/issues/12237.
They should be added when that is fixed.

Bug Tracker
===========
Expand Down
1 change: 0 additions & 1 deletion auth_supplier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import models
from . import controllers
3 changes: 1 addition & 2 deletions auth_supplier/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
{
'name': "Auth Supplier",
'category': 'Portal',
'version': '9.0.1.1.0',
'version': '9.0.2.0.0',
'depends': [
'auth_signup',
],
'data': [
'security/auth_supplier_security.xml',
'views/auth_supplier_view.xml',
],
'author': 'Antiun Ingeniería S.L., '
Expand Down
4 changes: 3 additions & 1 deletion auth_supplier/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@

class AuthSignupHome(AuthSignupHome):
def _signup_with_values(self, token, values):
values.update(account_type=request.params.get('account_type', False))
account_type = request.params.get('account_type')
if account_type in {"customer", "supplier"}:
values.setdefault(account_type, True)
return super(AuthSignupHome, self)._signup_with_values(token, values)
6 changes: 0 additions & 6 deletions auth_supplier/models/__init__.py

This file was deleted.

23 changes: 0 additions & 23 deletions auth_supplier/models/res_users.py

This file was deleted.

9 changes: 0 additions & 9 deletions auth_supplier/security/auth_supplier_security.xml

This file was deleted.

6 changes: 0 additions & 6 deletions auth_supplier/tests/__init__.py

This file was deleted.

24 changes: 0 additions & 24 deletions auth_supplier/tests/test_auth_supplier.py

This file was deleted.

0 comments on commit c5b18d5

Please sign in to comment.