Skip to content

Commit e73e393

Browse files
authored
Merge pull request OCA#311 from OCA/15.0
Syncing from upstream OCA/server-auth (15.0)
2 parents 3c6e8d3 + d98ffa7 commit e73e393

File tree

16 files changed

+594
-1
lines changed

16 files changed

+594
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ addon | version | maintainers | summary
2929
[auth_oidc](auth_oidc/) | 15.0.1.0.1 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Allow users to login through OpenID Connect Provider
3030
[auth_saml](auth_saml/) | 15.0.1.1.1 | | SAML2 Authentication
3131
[auth_session_timeout](auth_session_timeout/) | 15.0.1.0.0 | | This module disable all inactive sessions since a given delay
32+
[auth_signup_partner_company](auth_signup_partner_company/) | 15.0.1.0.0 | | Auth Signup Partner Company
3233
[auth_signup_verify_email](auth_signup_verify_email/) | 15.0.1.0.0 | | Force uninvited users to use a good email for signup
3334
[auth_user_case_insensitive](auth_user_case_insensitive/) | 15.0.1.0.0 | | Makes the user login field case insensitive
3435
[password_security](password_security/) | 15.0.1.1.1 | | Allow admin to set password security requirements.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
===========================
2+
Auth Signup Partner Company
3+
===========================
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
15+
:alt: License: AGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
17+
:target: https://github.com/OCA/server-auth/tree/15.0/auth_signup_partner_company
18+
:alt: OCA/server-auth
19+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20+
:target: https://translation.odoo-community.org/projects/server-auth-15-0/server-auth-15-0-auth_signup_partner_company
21+
:alt: Translate me on Weblate
22+
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23+
:target: https://runbot.odoo-community.org/runbot/251/15.0
24+
:alt: Try me on Runbot
25+
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
27+
28+
This module assigns company to the user and its partner newly created through portal signup.
29+
30+
Odoo's standard behavior when a new portal user signs up:
31+
32+
* User's company is taken from the template user.
33+
* Partner which links to the new user does not have a company assigned.
34+
35+
This behavior is problematic under multi-company, multi-website settings where partners
36+
should be seggregated between the companies, and this module intends to fix this issue.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Bug Tracker
44+
===========
45+
46+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
47+
In case of trouble, please check there if your issue has already been reported.
48+
If you spotted it first, help us smashing it by providing a detailed and welcomed
49+
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_signup_partner_company%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
50+
51+
Do not contact contributors directly about support or help with technical issues.
52+
53+
Credits
54+
=======
55+
56+
Authors
57+
~~~~~~~
58+
59+
* Quartile Limited
60+
61+
Maintainers
62+
~~~~~~~~~~~
63+
64+
This module is maintained by the OCA.
65+
66+
.. image:: https://odoo-community.org/logo.png
67+
:alt: Odoo Community Association
68+
:target: https://odoo-community.org
69+
70+
OCA, or the Odoo Community Association, is a nonprofit organization whose
71+
mission is to support the collaborative development of Odoo features and
72+
promote its widespread use.
73+
74+
This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/15.0/auth_signup_partner_company>`_ project on GitHub.
75+
76+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2023 Quartile Limited
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Auth Signup Partner Company",
5+
"version": "15.0.1.0.0",
6+
"author": "Quartile Limited, Odoo Community Association (OCA)",
7+
"website": "https://github.com/OCA/server-auth",
8+
"depends": ["auth_signup"],
9+
"license": "AGPL-3",
10+
"installable": True,
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * auth_signup_partner_company
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: auth_signup_partner_company
17+
#: model:ir.model,name:auth_signup_partner_company.model_res_users
18+
msgid "Users"
19+
msgstr ""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import res_users
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2023 Quartile Limited
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class ResUsers(models.Model):
8+
_inherit = "res.users"
9+
10+
def _create_user_from_template(self, values):
11+
values["company_ids"] = [self.env.company.id]
12+
values["company_id"] = self.env.company.id
13+
return super()._create_user_from_template(values)
14+
15+
def _signup_create_user(self, values):
16+
user = super()._signup_create_user(values)
17+
user.partner_id.company_id = self.env.company
18+
return user
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This module assigns company to the user and its partner newly created through portal signup.
2+
3+
Odoo's standard behavior when a new portal user signs up:
4+
5+
* User's company is taken from the template user.
6+
* Partner which links to the new user does not have a company assigned.
7+
8+
This behavior is problematic under multi-company, multi-website settings where partners
9+
should be seggregated between the companies, and this module intends to fix this issue.
9.23 KB
Loading

0 commit comments

Comments
 (0)