Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG][9.0][auth_supplier] Migrate. #434

Merged
merged 16 commits into from
May 27, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions auth_supplier/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Configuration

* To enable users to create accounts:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can include here that "Developer mode" should be activated first to have access to "Technical features".


* Go to *Settings > Configuration > General settings*.
* Go to *Settings > General settings*.
* Enable *Allow external users to sign up*.
* Enable *Activate the customer portal*.

Expand All @@ -27,26 +27,25 @@ To use this module, you need to:
* In home page, press *Sign in*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Sign in/Sign up/ (tested on runbot)

* Press *Sign up*.
* Select *Supplier* in account type.
* Fill the form.

.. 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/8.0

For further information, please visit:

* https://www.odoo.com/forum/help-1
:target: https://runbot.odoo-community.org/runbot/149/9.0

Known issues / Roadmap
======================

* If you have nothing in the portal, the user will be redirected to an empty
page.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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
`here <https://github.com/OCA/server-tools/issues/new?body=module:%20auth_supplier%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/server-tools/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.

Credits
=======
Expand All @@ -58,6 +57,7 @@ Contributors
* Pedro M. Baeza <[email protected]>
* Carlos Dauden <[email protected]>
* Sergio Teruel <[email protected]>
* Jairo Llopis <[email protected]>

Maintainer
----------
Expand All @@ -72,4 +72,4 @@ 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.

To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.
4 changes: 3 additions & 1 deletion auth_supplier/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# © 2016 Jairo Llopis <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
'name': "Auth Supplier",
'category': 'Tools',
'version': '8.0.1.0.0',
'version': '9.0.1.0.0',
'depends': [
'auth_signup',
],
Expand All @@ -16,6 +17,7 @@
],
'author': 'Antiun Ingeniería S.L., '
'Incaser Informatica S.L., '
"Tecnativa, "
'Odoo Community Association (OCA)',
'website': 'http://www.incaser.es',
'license': 'AGPL-3',
Expand Down
5 changes: 2 additions & 3 deletions auth_supplier/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# © 2016 Jairo Llopis <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp.addons.auth_signup.controllers.main import AuthSignupHome
from openerp.http import request


class AuthSignupHome(AuthSignupHome):

def _signup_with_values(self, token, values):
qcontext = request.params.copy()
values.update(account_type=qcontext.get('account_type', False))
values.update(account_type=request.params.get('account_type', False))
return super(AuthSignupHome, self)._signup_with_values(token, values)
37 changes: 0 additions & 37 deletions auth_supplier/i18n/auth_supplier.pot

This file was deleted.

7 changes: 3 additions & 4 deletions auth_supplier/models/res_users.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel
# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden
# © 2016 Jairo Llopis <[email protected]>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import models, api
Expand All @@ -11,14 +12,12 @@ class ResUsers(models.Model):

@api.model
def _signup_create_user(self, values):
account_type = values.get('account_type', False)
if 'account_type' in values:
values.pop('account_type')
account_type = values.pop('account_type', False)
res = super(ResUsers, self)._signup_create_user(values)
if isinstance(res, int):
user = self.env['res.users'].browse(res)
if account_type == 'supplier':
user.partner_id.supplier = True
user.groups_id = user.groups_id | self.env.ref(
user.groups_id |= self.env.ref(
'auth_supplier.group_auth_supplier')
return res
1 change: 0 additions & 1 deletion auth_supplier/tests/test_auth_supplier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestSAuthSupplier(TransactionCase):

def setUp(self):
super(TestSAuthSupplier, self).setUp()
ir_config_parameter = self.env['ir.config_parameter']
Expand Down
2 changes: 0 additions & 2 deletions auth_supplier/views/auth_supplier_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to to use the new "cool" tag (and to avoid the need to change it when the other tag will be deprecated)

<data>

<template id="auth_supplier.fields"
inherit_id="auth_signup.fields"
Expand All @@ -16,5 +15,4 @@
</xpath>
</template>

</data>
</openerp>