Skip to content

Commit c8dd1fc

Browse files
committed
Merge PR #580 into 18.0
Signed-off-by sebastienbeau
2 parents 71ec29b + 39f8536 commit c8dd1fc

33 files changed

Lines changed: 3289 additions & 0 deletions

auth_partner/README.rst

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
============
2+
Partner Auth
3+
============
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:33a8bc75dc8127331753aa9a54fe3a5b56f7d51a23cc7e9eb0000cc55f78c689
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
20+
:target: https://github.com/OCA/rest-framework/tree/18.0/auth_partner
21+
:alt: OCA/rest-framework
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-auth_partner
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module adds to the partners the ability to authenticate through
32+
directories.
33+
34+
This module does not implement any routing, it only provides the basic
35+
mechanisms in a directory for:
36+
37+
- Registering a partner and sending an welcome email (to validate
38+
email address): \_signup
39+
- Authenticating a partner: \_login
40+
- Validating a partner email using a token: \_validate_email
41+
- Impersonating: \_impersonate, \_impersonating
42+
- Resetting the password with a unique token sent by mail:
43+
\_request_reset_password, \_set_password
44+
- Sending an invite mail when registering a partner from odoo
45+
interface for the partner to enter a password: \_send_invite,
46+
\_set_password
47+
48+
For a routing implementation, see the
49+
`fastapi_auth_partner <../fastapi_auth_partner>`__ module.
50+
51+
**Table of contents**
52+
53+
.. contents::
54+
:local:
55+
56+
Usage
57+
=====
58+
59+
This module isn't meant to be used standalone but you can still see the
60+
directories and authenticable partners in:
61+
62+
Settings > Technical > Partner Authentication > Partner
63+
64+
and
65+
66+
Settings > Technical > Partner Authentication > Directory
67+
68+
Bug Tracker
69+
===========
70+
71+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.
72+
In case of trouble, please check there if your issue has already been reported.
73+
If you spotted it first, help us to smash it by providing a detailed and welcomed
74+
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20auth_partner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
75+
76+
Do not contact contributors directly about support or help with technical issues.
77+
78+
Credits
79+
=======
80+
81+
Authors
82+
-------
83+
84+
* Akretion
85+
86+
Contributors
87+
------------
88+
89+
- `Akretion <https://www.akretion.com>`__:
90+
91+
- Sébastien Beau
92+
- Florian Mounier
93+
94+
Maintainers
95+
-----------
96+
97+
This module is maintained by the OCA.
98+
99+
.. image:: https://odoo-community.org/logo.png
100+
:alt: Odoo Community Association
101+
:target: https://odoo-community.org
102+
103+
OCA, or the Odoo Community Association, is a nonprofit organization whose
104+
mission is to support the collaborative development of Odoo features and
105+
promote its widespread use.
106+
107+
.. |maintainer-paradoxxxzero| image:: https://github.com/paradoxxxzero.png?size=40px
108+
:target: https://github.com/paradoxxxzero
109+
:alt: paradoxxxzero
110+
111+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
112+
113+
|maintainer-paradoxxxzero|
114+
115+
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/18.0/auth_partner>`_ project on GitHub.
116+
117+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

auth_partner/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizards

auth_partner/__manifest__.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2024 Akretion (http://www.akretion.com).
2+
# @author Sébastien BEAU <sebastien.beau@akretion.com>
3+
# @author Florian Mounier <florian.mounier@akretion.com>
4+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5+
6+
{
7+
"name": "Partner Auth",
8+
"summary": "Implements the base features for a authenticable partner",
9+
"version": "18.0.1.0.0",
10+
"license": "AGPL-3",
11+
"author": "Akretion,Odoo Community Association (OCA)",
12+
"website": "https://github.com/OCA/rest-framework",
13+
"depends": [
14+
"auth_signup",
15+
"mail",
16+
"queue_job",
17+
"server_environment",
18+
],
19+
"data": [
20+
"security/res_group.xml",
21+
"security/ir.model.access.csv",
22+
"data/email_data.xml",
23+
"wizards/wizard_auth_partner_force_set_password_view.xml",
24+
"wizards/wizard_auth_partner_reset_password_view.xml",
25+
"views/auth_partner_view.xml",
26+
"views/auth_directory_view.xml",
27+
"views/res_partner_view.xml",
28+
],
29+
"demo": [
30+
"demo/res_partner_demo.xml",
31+
"demo/auth_directory_demo.xml",
32+
"demo/auth_partner_demo.xml",
33+
],
34+
"maintainers": ["paradoxxxzero"],
35+
"external_dependencies": {
36+
"python": ["itsdangerous", "pyjwt"],
37+
},
38+
}

auth_partner/data/email_data.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo noupdate="1">
3+
<record id="email_reset_password" model="mail.template">
4+
<field name="name">Auth Directory: Reset Password</field>
5+
<field name="email_from">noreply@example.org</field>
6+
<field name="subject">Reset Password</field>
7+
<field name="partner_to">{{object.partner_id.id}}</field>
8+
<field name="model_id" ref="model_auth_partner" />
9+
<field name="auto_delete" eval="True" />
10+
<field name="lang">{{object.partner_id.lang}}</field>
11+
<field name="body_html" type="html">
12+
<div>
13+
Hi <t t-out="object.partner_id.name or ''" />
14+
Click on the following link to reset your password
15+
<a
16+
t-attf-href="https://example.org/password/reset?token={{ object.env.context['token']}}"
17+
target="_blank"
18+
style="color:#FFFFFF; text-decoration:none;"
19+
>Reset Password</a>
20+
</div>
21+
</field>
22+
</record>
23+
24+
<record id="email_set_password" model="mail.template">
25+
<field name="name">Auth Directory: Set Password</field>
26+
<field name="email_from">noreply@example.org</field>
27+
<field name="subject">Welcome</field>
28+
<field name="partner_to">{{object.partner_id.id}}</field>
29+
<field name="model_id" ref="model_auth_partner" />
30+
<field name="auto_delete" eval="True" />
31+
<field name="lang">{{object.partner_id.lang}}</field>
32+
<field name="body_html" type="html">
33+
<div>
34+
Hi <t t-out="object.partner_id.name or ''" />
35+
Welcome, your account have been created
36+
Click on the following link to set your password
37+
<a
38+
t-attf-href="https://example.org/password/reset?token={{ object.env.context['token']}}"
39+
target="_blank"
40+
style="color:#FFFFFF; text-decoration:none;"
41+
>Set Password</a>
42+
</div>
43+
</field>
44+
</record>
45+
46+
<record id="email_validate_email" model="mail.template">
47+
<field name="name">Auth Directory: Validate Email</field>
48+
<field name="email_from">noreply@example.org</field>
49+
<field name="subject">Welcome</field>
50+
<field name="partner_to">{{object.partner_id.id}}</field>
51+
<field name="model_id" ref="model_auth_partner" />
52+
<field name="auto_delete" eval="True" />
53+
<field name="lang">{{object.partner_id.lang}}</field>
54+
<field name="body_html" type="html">
55+
<div>
56+
Hi <t t-out="object.partner_id.name or ''" />
57+
Welcome to the site, please click on the following link to verify your email
58+
<a
59+
t-attf-href="https://example.org/email/validate?token={{ object.env.context['token']}}"
60+
target="_blank"
61+
style="color:#FFFFFF; text-decoration:none;"
62+
>Validate Email</a>
63+
</div>
64+
</field>
65+
</record>
66+
</odoo>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<record id="demo_directory" model="auth.directory">
4+
<field name="name">Demo Auth Directory</field>
5+
<field name="reset_password_template_id" ref="email_reset_password" />
6+
<field name="set_password_template_id" ref="email_set_password" />
7+
<field name="validate_email_template_id" ref="email_validate_email" />
8+
</record>
9+
</odoo>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<record id="auth_partner_demo" model="auth.partner">
4+
<field name="partner_id" ref="res_partner_auth_demo" />
5+
<field name="directory_id" ref="demo_directory" />
6+
<field name="password">Super-secret$1</field>
7+
</record>
8+
</odoo>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<record id="res_partner_auth_demo" model="res.partner">
4+
<field name="name">Demo auth partner</field>
5+
<field name="email">partner-auth@example.org</field>
6+
</record>
7+
</odoo>

0 commit comments

Comments
 (0)