From 943b4d34135cd6046eb4b7ba0b2cd847f1d759dd Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Fri, 26 Jul 2013 14:36:58 +0100 Subject: [PATCH 01/21] ADD Module to use email from LDAP records ADD defsult and sugegsted values; auto-install --- users_ldap_mail/__init__.py | 22 +++++++ users_ldap_mail/__openerp__.py | 39 ++++++++++++ users_ldap_mail/i18n/users_ldap_mail.pot | 16 +++++ users_ldap_mail/users_ldap_model.py | 76 ++++++++++++++++++++++++ users_ldap_mail/users_ldap_view.xml | 18 ++++++ 5 files changed, 171 insertions(+) create mode 100644 users_ldap_mail/__init__.py create mode 100644 users_ldap_mail/__openerp__.py create mode 100644 users_ldap_mail/i18n/users_ldap_mail.pot create mode 100644 users_ldap_mail/users_ldap_model.py create mode 100644 users_ldap_mail/users_ldap_view.xml diff --git a/users_ldap_mail/__init__.py b/users_ldap_mail/__init__.py new file mode 100644 index 0000000000..a6d454183f --- /dev/null +++ b/users_ldap_mail/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Daniel Reis. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import users_ldap_model diff --git a/users_ldap_mail/__openerp__.py b/users_ldap_mail/__openerp__.py new file mode 100644 index 0000000000..25d3320662 --- /dev/null +++ b/users_ldap_mail/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013 Daniel Reis (https://launchpad.com/~dreis-pt) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': "LDAP mapping for user name and e-mail", + 'version': "1.0", + 'depends': ["auth_ldap"], + 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)", + 'description': """\ +Allows to define the LDAP attributes to use to retrieve user name and e-mail address. + +The default attribute used for the name is "cn". +For Active Directory, you might prefer to use "displayName" instead. +AD also supports the "mail" attribute, so it can be mapped into OpenERP. +""", + 'category': "Tools", + 'data': [ + 'users_ldap_view.xml', + ], + 'installable': True, +} diff --git a/users_ldap_mail/i18n/users_ldap_mail.pot b/users_ldap_mail/i18n/users_ldap_mail.pot new file mode 100644 index 0000000000..c83ab22af5 --- /dev/null +++ b/users_ldap_mail/i18n/users_ldap_mail.pot @@ -0,0 +1,16 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-14 17:41+0000\n" +"PO-Revision-Date: 2014-03-14 17:41+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + diff --git a/users_ldap_mail/users_ldap_model.py b/users_ldap_mail/users_ldap_model.py new file mode 100644 index 0000000000..e4a8bd815b --- /dev/null +++ b/users_ldap_mail/users_ldap_model.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Daniel Reis +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import fields, orm + +import logging +_log = logging.getLogger(__name__) + + +class CompanyLDAP(orm.Model): + _inherit = 'res.company.ldap' + _columns = { + 'name_attribute': fields.char( + 'Name Attribute', size=64, + help="By default 'cn' is used. " + "For ActiveDirectory you might use 'displayName' instead."), + 'mail_attribute': fields.char( + 'E-mail attribute', size=64, + help="LDAP attribute to use to retrieve em-mail address."), + } + _defaults = { + 'name_attribute': 'cn', + 'mail_attribute': 'mail', + } + + def get_ldap_dicts(self, cr, ids=None): + """ + Copy of auth_ldap's funtion, changing only the SQL, so that it returns + all fields in the table. + """ + if ids: + id_clause = 'AND id IN (%s)' + args = [tuple(ids)] + else: + id_clause = '' + args = [] + cr.execute(""" + SELECT * + FROM res_company_ldap + WHERE ldap_server != '' """ + id_clause + """ ORDER BY sequence + """, args) + return cr.dictfetchall() + + def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): + values = super(CompanyLDAP, self).map_ldap_attributes(cr, uid, conf, + login, ldap_entry) + mapping = [ + ('name', 'name_attribute'), + ('email', 'mail_attribute'), + ] + for value_key, conf_name in mapping: + try: + if conf[conf_name]: + values[value_key] = ldap_entry[1][conf[conf_name]][0] + except KeyError: + _log.warning('No LDAP attribute "%s" found for login "%s"' % ( + conf.get(conf_name), values.get('login'))) + return values diff --git a/users_ldap_mail/users_ldap_view.xml b/users_ldap_mail/users_ldap_view.xml new file mode 100644 index 0000000000..9395e602f3 --- /dev/null +++ b/users_ldap_mail/users_ldap_view.xml @@ -0,0 +1,18 @@ + + + + + res.company.form.inherit.users_ldap_mail + res.company + + + + + + + + + + + + From 44825430e32dc09db1f52446d4dd7c3885390155 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Tue, 2 Sep 2014 16:16:03 +0100 Subject: [PATCH 02/21] Port users_ldap_mail to v8 Fix PEP8 --- users_ldap_mail/__init__.py | 2 +- users_ldap_mail/__openerp__.py | 9 ++++++--- users_ldap_mail/static/description/icon.png | Bin 0 -> 9455 bytes users_ldap_mail/users_ldap_model.py | 11 ++++++----- 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 users_ldap_mail/static/description/icon.png diff --git a/users_ldap_mail/__init__.py b/users_ldap_mail/__init__.py index a6d454183f..1956c281a0 100644 --- a/users_ldap_mail/__init__.py +++ b/users_ldap_mail/__init__.py @@ -19,4 +19,4 @@ # ############################################################################## -import users_ldap_model +from . import users_ldap_model diff --git a/users_ldap_mail/__openerp__.py b/users_ldap_mail/__openerp__.py index 25d3320662..350f05f4a2 100644 --- a/users_ldap_mail/__openerp__.py +++ b/users_ldap_mail/__openerp__.py @@ -21,11 +21,14 @@ { 'name': "LDAP mapping for user name and e-mail", - 'version': "1.0", + 'version': "8.0.1.0.0", 'depends': ["auth_ldap"], - 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)", + 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)," + "Odoo Community Association (OCA)", + 'license': 'AGPL-3', 'description': """\ -Allows to define the LDAP attributes to use to retrieve user name and e-mail address. +Allows to define the LDAP attributes to use to retrieve user name and e-mail +address. The default attribute used for the name is "cn". For Active Directory, you might prefer to use "displayName" instead. diff --git a/users_ldap_mail/static/description/icon.png b/users_ldap_mail/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o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yrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/users_ldap_mail/users_ldap_model.py b/users_ldap_mail/users_ldap_model.py index e4a8bd815b..731e7c6bb0 100644 --- a/users_ldap_mail/users_ldap_model.py +++ b/users_ldap_mail/users_ldap_model.py @@ -35,11 +35,12 @@ class CompanyLDAP(orm.Model): 'mail_attribute': fields.char( 'E-mail attribute', size=64, help="LDAP attribute to use to retrieve em-mail address."), - } + } + _defaults = { 'name_attribute': 'cn', 'mail_attribute': 'mail', - } + } def get_ldap_dicts(self, cr, ids=None): """ @@ -60,12 +61,12 @@ def get_ldap_dicts(self, cr, ids=None): return cr.dictfetchall() def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): - values = super(CompanyLDAP, self).map_ldap_attributes(cr, uid, conf, - login, ldap_entry) + values = super(CompanyLDAP, self).map_ldap_attributes( + cr, uid, conf, login, ldap_entry) mapping = [ ('name', 'name_attribute'), ('email', 'mail_attribute'), - ] + ] for value_key, conf_name in mapping: try: if conf[conf_name]: From 7d486ad8cb291cc50fe7e0c3573de9f41614312e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Sun, 13 Dec 2015 16:11:50 +0100 Subject: [PATCH 03/21] Fix 9.0 version --- users_ldap_mail/__openerp__.py | 2 +- users_ldap_mail/i18n/de.po | 46 +++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/en.po | 45 ++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/es.po | 47 ++++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/fr.po | 45 ++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/hr_HR.po | 46 +++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/pt_BR.po | 46 +++++++++++++++++++++++++++++++++ users_ldap_mail/i18n/sl.po | 46 +++++++++++++++++++++++++++++++++ 8 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 users_ldap_mail/i18n/de.po create mode 100644 users_ldap_mail/i18n/en.po create mode 100644 users_ldap_mail/i18n/es.po create mode 100644 users_ldap_mail/i18n/fr.po create mode 100644 users_ldap_mail/i18n/hr_HR.po create mode 100644 users_ldap_mail/i18n/pt_BR.po create mode 100644 users_ldap_mail/i18n/sl.po diff --git a/users_ldap_mail/__openerp__.py b/users_ldap_mail/__openerp__.py index 350f05f4a2..496c38cc37 100644 --- a/users_ldap_mail/__openerp__.py +++ b/users_ldap_mail/__openerp__.py @@ -21,7 +21,7 @@ { 'name': "LDAP mapping for user name and e-mail", - 'version': "8.0.1.0.0", + 'version': "9.0.1.0.0", 'depends': ["auth_ldap"], 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)," "Odoo Community Association (OCA)", diff --git a/users_ldap_mail/i18n/de.po b/users_ldap_mail/i18n/de.po new file mode 100644 index 0000000000..4938122a98 --- /dev/null +++ b/users_ldap_mail/i18n/de.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-17 12:15+0000\n" +"PO-Revision-Date: 2016-04-21 09:16+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-9-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "'cn' wird per Vorgabe benutzt. Bei ActiveDirectory können Sie stattdessen 'displayName' verwenden." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "Email-Attribut" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "LDAP-Attribut, um eine Email-Adresse zu erhalten." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Namens-Attribut" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/en.po b/users_ldap_mail/i18n/en.po new file mode 100644 index 0000000000..bbc0319573 --- /dev/null +++ b/users_ldap_mail/i18n/en.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-15 01:55+0000\n" +"PO-Revision-Date: 2015-12-13 15:21+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-server-tools-9-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "By default 'cn' is used. For ActiveDirectory you might use 'displayName' instead." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "E-mail attribute" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "LDAP attribute to use to retrieve em-mail address." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Name Attribute" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/es.po b/users_ldap_mail/i18n/es.po new file mode 100644 index 0000000000..65a20dfa81 --- /dev/null +++ b/users_ldap_mail/i18n/es.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Antonio Trueba, 2016 +# Antonio Trueba, 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:46+0000\n" +"PO-Revision-Date: 2016-02-16 12:32+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-9-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "Por defecto se usa «cn». En Directorio Activo se podría usar «displayName» en su lugar." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "Atributo e-mail" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "Atributo LDAP a utilizar para recumerar la dirección em-mail." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Atributo Nombre" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/fr.po b/users_ldap_mail/i18n/fr.po new file mode 100644 index 0000000000..8b2c5f4c3d --- /dev/null +++ b/users_ldap_mail/i18n/fr.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:46+0000\n" +"PO-Revision-Date: 2015-12-13 15:21+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-9-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/hr_HR.po b/users_ldap_mail/i18n/hr_HR.po new file mode 100644 index 0000000000..6bf7fe7aa9 --- /dev/null +++ b/users_ldap_mail/i18n/hr_HR.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 20:13+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "Zadano koristi 'cn'. Za ActiveDirectory možete koristiti i 'displayName'." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "E-mail atribut" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "LDAP atribut za dohvaćanje e-mail adrese." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Atribut Naziv" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/pt_BR.po b/users_ldap_mail/i18n/pt_BR.po new file mode 100644 index 0000000000..ace20535f1 --- /dev/null +++ b/users_ldap_mail/i18n/pt_BR.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Armando Vulcano Junior , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-15 01:55+0000\n" +"PO-Revision-Date: 2015-12-13 15:21+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "Por padrão 'cn' é usado. Para ActiveDirectory você pode usar 'displayName'" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "Atributo E-mail" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "Use o atributo LDAP para recuperar o endereço de e-mail" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Atributo Nome" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "" diff --git a/users_ldap_mail/i18n/sl.po b/users_ldap_mail/i18n/sl.po new file mode 100644 index 0000000000..04d9bb081a --- /dev/null +++ b/users_ldap_mail/i18n/sl.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-15 01:55+0000\n" +"PO-Revision-Date: 2015-12-14 06:46+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-9-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "Privzeto se uporablja 'cn'. Za aktivni imenik bi lahko namesto tega uporabili 'displayName'." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "E-poštni atribut" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "LDAP atribut za uporabo pri pridobivanju e-poštnih naslovov." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Naziv atributa" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" From 446d28766d8989e5c1e4e400417b398288c51063 Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 27 Dec 2016 23:12:37 +0100 Subject: [PATCH 04/21] 10.0 Migrate users_ldap_mail module (#651) * [ADD] Add README.rst to users_ldap_mail * [MIG] Migrate users_ldap_mail to 10.0 * [FIX] Fixes in code style in module users_ldap_mail Changes in models/users_ldap_mail include: - remove unused imports - indentation of too long lines * [FIX] users_ldap_mail: Fix copyright notice * [FIX] users_ldap_mail: set UTF-8 encoding users_ldap_mail/models/__init__.py should be UTF-8 encoded * [FIX] users_ldap_mail: remove size argument from Char fields * [FIX] users_ldap_mail: return value can be combined in one line * [FIX] Update read me Fixes included: - Make module name human readable - Instead of numbering steps, use # - Update broken link --- users_ldap_mail/README.rst | 67 +++++++++++++++++++ users_ldap_mail/__init__.py | 24 ++----- users_ldap_mail/__manifest__.py | 25 +++++++ users_ldap_mail/__openerp__.py | 42 ------------ users_ldap_mail/i18n/hr.po | 49 ++++++++++++++ users_ldap_mail/i18n/zh_CN.po | 46 +++++++++++++ users_ldap_mail/models/__init__.py | 6 ++ users_ldap_mail/models/users_ldap_model.py | 44 +++++++++++++ users_ldap_mail/users_ldap_model.py | 77 ---------------------- users_ldap_mail/users_ldap_view.xml | 18 ----- users_ldap_mail/views/users_ldap_view.xml | 14 ++++ 11 files changed, 255 insertions(+), 157 deletions(-) create mode 100644 users_ldap_mail/README.rst create mode 100644 users_ldap_mail/__manifest__.py delete mode 100644 users_ldap_mail/__openerp__.py create mode 100644 users_ldap_mail/i18n/hr.po create mode 100644 users_ldap_mail/i18n/zh_CN.po create mode 100644 users_ldap_mail/models/__init__.py create mode 100644 users_ldap_mail/models/users_ldap_model.py delete mode 100644 users_ldap_mail/users_ldap_model.py delete mode 100644 users_ldap_mail/users_ldap_view.xml create mode 100644 users_ldap_mail/views/users_ldap_view.xml diff --git a/users_ldap_mail/README.rst b/users_ldap_mail/README.rst new file mode 100644 index 0000000000..1c1819275b --- /dev/null +++ b/users_ldap_mail/README.rst @@ -0,0 +1,67 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=============== +Users LDAP Mail +=============== + +This module extends the functionality of the auth_ldap module to support mail +from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo +users. + +Usage +===== + +To use this module, you need to: + +#. Open Odoo in your browser +#. Go to Settings +#. Go to General Settings +#. In The General Settings form go to LDAP Parameters +#. In a LDAP Parameters item there are two new fields: mail and name, the name + These items will correspond with a new user that is created, when a user + logs in via LDAP in Odoo. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/repo/149 + +.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt +.. branch is "8.0" for example + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Daniel Reis (https://launchpad.com/~dreis-pt), + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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 https://odoo-community.org. diff --git a/users_ldap_mail/__init__.py b/users_ldap_mail/__init__.py index 1956c281a0..a0bd913cdc 100644 --- a/users_ldap_mail/__init__.py +++ b/users_ldap_mail/__init__.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2013 Daniel Reis. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). + +from . import models -from . import users_ldap_model diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py new file mode 100644 index 0000000000..ffcd4daf33 --- /dev/null +++ b/users_ldap_mail/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# © Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). + +{ + 'name': "LDAP mapping for user name and e-mail", + 'version': "10.0.1.0.0", + 'depends': ["auth_ldap"], + 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)," + "Odoo Community Association (OCA)", + 'license': 'AGPL-3', + 'description': """\ +Allows to define the LDAP attributes to use to retrieve user name and e-mail +address. + +The default attribute used for the name is "cn". +For Active Directory, you might prefer to use "displayName" instead. +AD also supports the "mail" attribute, so it can be mapped into OpenERP. +""", + 'category': "Tools", + 'data': [ + 'views/users_ldap_view.xml', + ], + 'installable': True, +} diff --git a/users_ldap_mail/__openerp__.py b/users_ldap_mail/__openerp__.py deleted file mode 100644 index 496c38cc37..0000000000 --- a/users_ldap_mail/__openerp__.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2013 Daniel Reis (https://launchpad.com/~dreis-pt) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': "LDAP mapping for user name and e-mail", - 'version': "9.0.1.0.0", - 'depends': ["auth_ldap"], - 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)," - "Odoo Community Association (OCA)", - 'license': 'AGPL-3', - 'description': """\ -Allows to define the LDAP attributes to use to retrieve user name and e-mail -address. - -The default attribute used for the name is "cn". -For Active Directory, you might prefer to use "displayName" instead. -AD also supports the "mail" attribute, so it can be mapped into OpenERP. -""", - 'category': "Tools", - 'data': [ - 'users_ldap_view.xml', - ], - 'installable': True, -} diff --git a/users_ldap_mail/i18n/hr.po b/users_ldap_mail/i18n/hr.po new file mode 100644 index 0000000000..ad52be2a2b --- /dev/null +++ b/users_ldap_mail/i18n/hr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# OCA Transbot , 2017 +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-10 00:47+0000\n" +"PO-Revision-Date: 2017-05-10 00:47+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "" +"Zadano se koristi 'CN'. za ActiveDirectory možete koristiti 'displayName' " +"umjesto zadanog." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "Atribut e-mail" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "LDAP atribut za dohvat email adresa." + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "Atribut naziva" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/zh_CN.po b/users_ldap_mail/i18n/zh_CN.po new file mode 100644 index 0000000000..df0d6174df --- /dev/null +++ b/users_ldap_mail/i18n/zh_CN.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-31 11:58+0000\n" +"PO-Revision-Date: 2016-09-04 06:11+0000\n" +"Last-Translator: Jeffery Chenn \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "" +"By default 'cn' is used. For ActiveDirectory you might use 'displayName' " +"instead." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "E-mail 属性" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "名称属性" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "" diff --git a/users_ldap_mail/models/__init__.py b/users_ldap_mail/models/__init__.py new file mode 100644 index 0000000000..22a4466178 --- /dev/null +++ b/users_ldap_mail/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# © Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). + +from . import users_ldap_model + diff --git a/users_ldap_mail/models/users_ldap_model.py b/users_ldap_mail/models/users_ldap_model.py new file mode 100644 index 0000000000..1d625a3dc1 --- /dev/null +++ b/users_ldap_mail/models/users_ldap_model.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# © Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). + +from odoo import models, fields + +import logging +_log = logging.getLogger(__name__) + + +class CompanyLDAP(models.Model): + _inherit = 'res.company.ldap' + + name_attribute = fields.Char( + 'Name Attribute', _defaults='cn', + help="By default 'cn' is used. " + "For ActiveDirectory you might use 'displayName' instead.") + mail_attribute = fields.Char( + 'E-mail attribute', _defaults='mail', + help="LDAP attribute to use to retrieve em-mail address.") + + def get_ldap_dicts(self): + """ + Copy of auth_ldap's funtion, changing only the SQL, so that it returns + all fields in the table. + """ + return self.sudo().search([('ldap_server', '!=', False)], + order='sequence').read([]) + + def map_ldap_attributes(self, conf, login, ldap_entry): + values = super(CompanyLDAP, self).map_ldap_attributes(conf, login, + ldap_entry) + mapping = [ + ('name', 'name_attribute'), + ('email', 'mail_attribute'), + ] + for value_key, conf_name in mapping: + try: + if conf[conf_name]: + values[value_key] = ldap_entry[1][conf[conf_name]][0] + except KeyError: + _log.warning('No LDAP attribute "%s" found for login "%s"' % ( + conf.get(conf_name), values.get('login'))) + return values diff --git a/users_ldap_mail/users_ldap_model.py b/users_ldap_mail/users_ldap_model.py deleted file mode 100644 index 731e7c6bb0..0000000000 --- a/users_ldap_mail/users_ldap_model.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2013 Daniel Reis -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import fields, orm - -import logging -_log = logging.getLogger(__name__) - - -class CompanyLDAP(orm.Model): - _inherit = 'res.company.ldap' - _columns = { - 'name_attribute': fields.char( - 'Name Attribute', size=64, - help="By default 'cn' is used. " - "For ActiveDirectory you might use 'displayName' instead."), - 'mail_attribute': fields.char( - 'E-mail attribute', size=64, - help="LDAP attribute to use to retrieve em-mail address."), - } - - _defaults = { - 'name_attribute': 'cn', - 'mail_attribute': 'mail', - } - - def get_ldap_dicts(self, cr, ids=None): - """ - Copy of auth_ldap's funtion, changing only the SQL, so that it returns - all fields in the table. - """ - if ids: - id_clause = 'AND id IN (%s)' - args = [tuple(ids)] - else: - id_clause = '' - args = [] - cr.execute(""" - SELECT * - FROM res_company_ldap - WHERE ldap_server != '' """ + id_clause + """ ORDER BY sequence - """, args) - return cr.dictfetchall() - - def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): - values = super(CompanyLDAP, self).map_ldap_attributes( - cr, uid, conf, login, ldap_entry) - mapping = [ - ('name', 'name_attribute'), - ('email', 'mail_attribute'), - ] - for value_key, conf_name in mapping: - try: - if conf[conf_name]: - values[value_key] = ldap_entry[1][conf[conf_name]][0] - except KeyError: - _log.warning('No LDAP attribute "%s" found for login "%s"' % ( - conf.get(conf_name), values.get('login'))) - return values diff --git a/users_ldap_mail/users_ldap_view.xml b/users_ldap_mail/users_ldap_view.xml deleted file mode 100644 index 9395e602f3..0000000000 --- a/users_ldap_mail/users_ldap_view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - res.company.form.inherit.users_ldap_mail - res.company - - - - - - - - - - - - diff --git a/users_ldap_mail/views/users_ldap_view.xml b/users_ldap_mail/views/users_ldap_view.xml new file mode 100644 index 0000000000..44fc9b7337 --- /dev/null +++ b/users_ldap_mail/views/users_ldap_view.xml @@ -0,0 +1,14 @@ + + + + Add name and email attributes to ldap view + base.config.settings + + + + + + + + + From eedee981aac1e04a45f4d03df018bcbe864b741e Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Mon, 9 Oct 2017 15:14:49 +0200 Subject: [PATCH 05/21] users_ldap_mail --- users_ldap_mail/README.rst | 2 +- users_ldap_mail/__init__.py | 1 - users_ldap_mail/__manifest__.py | 15 +++------------ users_ldap_mail/i18n/users_ldap_mail.pot | 16 ---------------- users_ldap_mail/models/__init__.py | 1 - users_ldap_mail/models/users_ldap_model.py | 1 - users_ldap_mail/views/res_company_ldap.xml | 15 +++++++++++++++ users_ldap_mail/views/users_ldap_view.xml | 14 -------------- 8 files changed, 19 insertions(+), 46 deletions(-) delete mode 100644 users_ldap_mail/i18n/users_ldap_mail.pot create mode 100644 users_ldap_mail/views/res_company_ldap.xml delete mode 100644 users_ldap_mail/views/users_ldap_view.xml diff --git a/users_ldap_mail/README.rst b/users_ldap_mail/README.rst index 1c1819275b..2f4c8d27b9 100644 --- a/users_ldap_mail/README.rst +++ b/users_ldap_mail/README.rst @@ -1,5 +1,5 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 =============== diff --git a/users_ldap_mail/__init__.py b/users_ldap_mail/__init__.py index a0bd913cdc..d75858919a 100644 --- a/users_ldap_mail/__init__.py +++ b/users_ldap_mail/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py index ffcd4daf33..d9db65419f 100644 --- a/users_ldap_mail/__manifest__.py +++ b/users_ldap_mail/__manifest__.py @@ -1,25 +1,16 @@ -# -*- coding: utf-8 -*- # © Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). { 'name': "LDAP mapping for user name and e-mail", - 'version': "10.0.1.0.0", + 'version': "11.0.1.0.0", 'depends': ["auth_ldap"], - 'author': "Daniel Reis (https://launchpad.com/~dreis-pt)," + 'author': "Daniel Reis," "Odoo Community Association (OCA)", 'license': 'AGPL-3', - 'description': """\ -Allows to define the LDAP attributes to use to retrieve user name and e-mail -address. - -The default attribute used for the name is "cn". -For Active Directory, you might prefer to use "displayName" instead. -AD also supports the "mail" attribute, so it can be mapped into OpenERP. -""", 'category': "Tools", 'data': [ - 'views/users_ldap_view.xml', + 'views/res_company_ldap.xml', ], 'installable': True, } diff --git a/users_ldap_mail/i18n/users_ldap_mail.pot b/users_ldap_mail/i18n/users_ldap_mail.pot deleted file mode 100644 index c83ab22af5..0000000000 --- a/users_ldap_mail/i18n/users_ldap_mail.pot +++ /dev/null @@ -1,16 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-14 17:41+0000\n" -"PO-Revision-Date: 2014-03-14 17:41+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - diff --git a/users_ldap_mail/models/__init__.py b/users_ldap_mail/models/__init__.py index 22a4466178..42c6293ea9 100644 --- a/users_ldap_mail/models/__init__.py +++ b/users_ldap_mail/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). diff --git a/users_ldap_mail/models/users_ldap_model.py b/users_ldap_mail/models/users_ldap_model.py index 1d625a3dc1..a319ea183f 100644 --- a/users_ldap_mail/models/users_ldap_model.py +++ b/users_ldap_mail/models/users_ldap_model.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). diff --git a/users_ldap_mail/views/res_company_ldap.xml b/users_ldap_mail/views/res_company_ldap.xml new file mode 100644 index 0000000000..ec9f7d89c9 --- /dev/null +++ b/users_ldap_mail/views/res_company_ldap.xml @@ -0,0 +1,15 @@ + + + + res.company.ldap.form + res.company.ldap + + + + + + + + + diff --git a/users_ldap_mail/views/users_ldap_view.xml b/users_ldap_mail/views/users_ldap_view.xml deleted file mode 100644 index 44fc9b7337..0000000000 --- a/users_ldap_mail/views/users_ldap_view.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Add name and email attributes to ldap view - base.config.settings - - - - - - - - - From b1159fcb7e344b58517f19d5a149f0139db6486f Mon Sep 17 00:00:00 2001 From: Artem Kostyuk Date: Thu, 25 Oct 2018 13:53:31 +0300 Subject: [PATCH 06/21] users_ldap_mail: Provide defaults to attributes properly Forward-port https://github.com/OCA/server-tools/pull/1405. --- users_ldap_mail/i18n/de.po | 11 +++--- users_ldap_mail/i18n/es.po | 11 +++--- users_ldap_mail/i18n/fr.po | 7 ++-- users_ldap_mail/i18n/hr.po | 7 ++-- users_ldap_mail/i18n/hr_HR.po | 13 ++++--- users_ldap_mail/i18n/pt_BR.po | 10 +++--- users_ldap_mail/i18n/sl.po | 14 +++++--- users_ldap_mail/i18n/users_ldap_mail.pot | 40 ++++++++++++++++++++++ users_ldap_mail/i18n/zh_CN.po | 7 ++-- users_ldap_mail/models/users_ldap_model.py | 12 ++++--- 10 files changed, 97 insertions(+), 35 deletions(-) create mode 100644 users_ldap_mail/i18n/users_ldap_mail.pot diff --git a/users_ldap_mail/i18n/de.po b/users_ldap_mail/i18n/de.po index 4938122a98..c7e0297717 100644 --- a/users_ldap_mail/i18n/de.po +++ b/users_ldap_mail/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Rudolf Schnapka , 2016 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2016-04-17 12:15+0000\n" "PO-Revision-Date: 2016-04-21 09:16+0000\n" "Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-9-0/language/de/)\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-9-0/" +"language/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: users_ldap_mail @@ -23,7 +24,9 @@ msgstr "" msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." -msgstr "'cn' wird per Vorgabe benutzt. Bei ActiveDirectory können Sie stattdessen 'displayName' verwenden." +msgstr "" +"'cn' wird per Vorgabe benutzt. Bei ActiveDirectory können Sie stattdessen " +"'displayName' verwenden." #. module: users_ldap_mail #: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute diff --git a/users_ldap_mail/i18n/es.po b/users_ldap_mail/i18n/es.po index 65a20dfa81..64583845d8 100644 --- a/users_ldap_mail/i18n/es.po +++ b/users_ldap_mail/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Antonio Trueba, 2016 # Antonio Trueba, 2016 @@ -12,11 +12,12 @@ msgstr "" "POT-Creation-Date: 2016-01-19 14:46+0000\n" "PO-Revision-Date: 2016-02-16 12:32+0000\n" "Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-9-0/language/es/)\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-9-0/" +"language/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: users_ldap_mail @@ -24,7 +25,9 @@ msgstr "" msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." -msgstr "Por defecto se usa «cn». En Directorio Activo se podría usar «displayName» en su lugar." +msgstr "" +"Por defecto se usa «cn». En Directorio Activo se podría usar «displayName» " +"en su lugar." #. module: users_ldap_mail #: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute diff --git a/users_ldap_mail/i18n/fr.po b/users_ldap_mail/i18n/fr.po index 8b2c5f4c3d..ac43b824c4 100644 --- a/users_ldap_mail/i18n/fr.po +++ b/users_ldap_mail/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: msgid "" msgstr "" @@ -10,11 +10,12 @@ msgstr "" "POT-Creation-Date: 2016-01-19 14:46+0000\n" "PO-Revision-Date: 2015-12-13 15:21+0000\n" "Last-Translator: <>\n" -"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-9-0/language/fr/)\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-9-0/" +"language/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: users_ldap_mail diff --git a/users_ldap_mail/i18n/hr.po b/users_ldap_mail/i18n/hr.po index ad52be2a2b..38c53685db 100644 --- a/users_ldap_mail/i18n/hr.po +++ b/users_ldap_mail/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # OCA Transbot , 2017 # Bole , 2017 @@ -13,11 +13,12 @@ msgstr "" "PO-Revision-Date: 2017-05-10 00:47+0000\n" "Last-Translator: Bole , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: users_ldap_mail #: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute diff --git a/users_ldap_mail/i18n/hr_HR.po b/users_ldap_mail/i18n/hr_HR.po index 6bf7fe7aa9..d3509508d3 100644 --- a/users_ldap_mail/i18n/hr_HR.po +++ b/users_ldap_mail/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Bole , 2016 msgid "" @@ -11,19 +11,22 @@ msgstr "" "POT-Creation-Date: 2016-06-09 12:31+0000\n" "PO-Revision-Date: 2016-05-31 20:13+0000\n" "Last-Translator: Bole \n" -"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/hr_HR/)\n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-" +"tools-9-0/language/hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: users_ldap_mail #: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." -msgstr "Zadano koristi 'cn'. Za ActiveDirectory možete koristiti i 'displayName'." +msgstr "" +"Zadano koristi 'cn'. Za ActiveDirectory možete koristiti i 'displayName'." #. module: users_ldap_mail #: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute diff --git a/users_ldap_mail/i18n/pt_BR.po b/users_ldap_mail/i18n/pt_BR.po index ace20535f1..5fc2b6d9ac 100644 --- a/users_ldap_mail/i18n/pt_BR.po +++ b/users_ldap_mail/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Armando Vulcano Junior , 2015 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2015-12-15 01:55+0000\n" "PO-Revision-Date: 2015-12-13 15:21+0000\n" "Last-Translator: OCA Transbot \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-" +"tools-9-0/language/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: users_ldap_mail @@ -23,7 +24,8 @@ msgstr "" msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." -msgstr "Por padrão 'cn' é usado. Para ActiveDirectory você pode usar 'displayName'" +msgstr "" +"Por padrão 'cn' é usado. Para ActiveDirectory você pode usar 'displayName'" #. module: users_ldap_mail #: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute diff --git a/users_ldap_mail/i18n/sl.po b/users_ldap_mail/i18n/sl.po index 04d9bb081a..3092037bb4 100644 --- a/users_ldap_mail/i18n/sl.po +++ b/users_ldap_mail/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Matjaž Mozetič , 2015 msgid "" @@ -11,19 +11,23 @@ msgstr "" "POT-Creation-Date: 2015-12-15 01:55+0000\n" "PO-Revision-Date: 2015-12-14 06:46+0000\n" "Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-9-0/language/sl/)\n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-9-0/" +"language/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: users_ldap_mail #: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." -msgstr "Privzeto se uporablja 'cn'. Za aktivni imenik bi lahko namesto tega uporabili 'displayName'." +msgstr "" +"Privzeto se uporablja 'cn'. Za aktivni imenik bi lahko namesto tega " +"uporabili 'displayName'." #. module: users_ldap_mail #: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute diff --git a/users_ldap_mail/i18n/users_ldap_mail.pot b/users_ldap_mail/i18n/users_ldap_mail.pot new file mode 100644 index 0000000000..c578c91f4d --- /dev/null +++ b/users_ldap_mail/i18n/users_ldap_mail.pot @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * users_ldap_mail +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "By default 'cn' is used. For ActiveDirectory you might use 'displayName' instead." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "E-mail attribute" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +msgid "Name Attribute" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "res.company.ldap" +msgstr "" + diff --git a/users_ldap_mail/i18n/zh_CN.po b/users_ldap_mail/i18n/zh_CN.po index df0d6174df..f217c1462d 100644 --- a/users_ldap_mail/i18n/zh_CN.po +++ b/users_ldap_mail/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * users_ldap_mail -# +# # Translators: # Jeffery Chenn , 2016 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2016-08-31 11:58+0000\n" "PO-Revision-Date: 2016-09-04 06:11+0000\n" "Last-Translator: Jeffery Chenn \n" -"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/zh_CN/)\n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-" +"tools-9-0/language/zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: users_ldap_mail diff --git a/users_ldap_mail/models/users_ldap_model.py b/users_ldap_mail/models/users_ldap_model.py index a319ea183f..77f4a2d705 100644 --- a/users_ldap_mail/models/users_ldap_model.py +++ b/users_ldap_mail/models/users_ldap_model.py @@ -11,12 +11,16 @@ class CompanyLDAP(models.Model): _inherit = 'res.company.ldap' name_attribute = fields.Char( - 'Name Attribute', _defaults='cn', + 'Name Attribute', + default='cn', help="By default 'cn' is used. " - "For ActiveDirectory you might use 'displayName' instead.") + "For ActiveDirectory you might use 'displayName' instead.", + ) mail_attribute = fields.Char( - 'E-mail attribute', _defaults='mail', - help="LDAP attribute to use to retrieve em-mail address.") + 'E-mail attribute', + default='mail', + help="LDAP attribute to use to retrieve em-mail address.", + ) def get_ldap_dicts(self): """ From 236ec896e792490d45c1deba6ed2f6615b0c5f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Wed, 18 Dec 2019 14:42:41 +0100 Subject: [PATCH 07/21] users_ldap_mail: Migration to 12.0 --- users_ldap_mail/README.rst | 78 ++-- users_ldap_mail/__init__.py | 3 +- users_ldap_mail/__manifest__.py | 4 +- users_ldap_mail/i18n/de.po | 19 +- users_ldap_mail/i18n/es.po | 19 +- users_ldap_mail/i18n/fr.po | 19 +- users_ldap_mail/i18n/hr.po | 19 +- users_ldap_mail/i18n/hr_HR.po | 19 +- users_ldap_mail/i18n/pt_BR.po | 18 +- users_ldap_mail/i18n/sl.po | 19 +- users_ldap_mail/i18n/users_ldap_mail.pot | 20 +- users_ldap_mail/i18n/zh_CN.po | 18 +- users_ldap_mail/models/__init__.py | 5 +- users_ldap_mail/models/users_ldap_model.py | 18 +- users_ldap_mail/readme/CONTRIBUTORS.rst | 4 + users_ldap_mail/readme/DESCRIPTION.rst | 3 + users_ldap_mail/readme/USAGE.rst | 9 + users_ldap_mail/static/description/index.html | 439 ++++++++++++++++++ 18 files changed, 614 insertions(+), 119 deletions(-) create mode 100644 users_ldap_mail/readme/CONTRIBUTORS.rst create mode 100644 users_ldap_mail/readme/DESCRIPTION.rst create mode 100644 users_ldap_mail/readme/USAGE.rst create mode 100644 users_ldap_mail/static/description/index.html diff --git a/users_ldap_mail/README.rst b/users_ldap_mail/README.rst index 2f4c8d27b9..20c86b76b2 100644 --- a/users_ldap_mail/README.rst +++ b/users_ldap_mail/README.rst @@ -1,15 +1,39 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=============== -Users LDAP Mail -=============== +===================================== +LDAP mapping for user name and e-mail +===================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fserver--auth-lightgray.png?logo=github + :target: https://github.com/OCA/server-auth/tree/12.0/users_ldap_mail + :alt: OCA/server-auth +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-users_ldap_mail + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/251/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module extends the functionality of the auth_ldap module to support mail from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo users. +**Table of contents** + +.. contents:: + :local: + Usage ===== @@ -23,45 +47,45 @@ To use this module, you need to: These items will correspond with a new user that is created, when a user logs in via LDAP in Odoo. -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/repo/149 - -.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt -.. branch is "8.0" for example - Bug Tracker =========== -Bugs are tracked on `GitHub 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. +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Daniel Reis Contributors ------------- +~~~~~~~~~~~~ * Daniel Reis (https://launchpad.com/~dreis-pt), +* `Tecnativa `_: -Maintainer ----------- + * Alexandre Díaz + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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 https://odoo-community.org. +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/users_ldap_mail/__init__.py b/users_ldap_mail/__init__.py index d75858919a..6740cf15fd 100644 --- a/users_ldap_mail/__init__.py +++ b/users_ldap_mail/__init__.py @@ -1,5 +1,4 @@ -# © Daniel Reis (https://launchpad.com/~dreis-pt) +# Copyright Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). from . import models - diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py index d9db65419f..47cd72c0e9 100644 --- a/users_ldap_mail/__manifest__.py +++ b/users_ldap_mail/__manifest__.py @@ -1,9 +1,9 @@ -# © Daniel Reis (https://launchpad.com/~dreis-pt) +# Copyright Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). { 'name': "LDAP mapping for user name and e-mail", - 'version': "11.0.1.0.0", + 'version': "12.0.1.0.0", 'depends': ["auth_ldap"], 'author': "Daniel Reis," "Odoo Community Association (OCA)", diff --git a/users_ldap_mail/i18n/de.po b/users_ldap_mail/i18n/de.po index c7e0297717..f0ed06a308 100644 --- a/users_ldap_mail/i18n/de.po +++ b/users_ldap_mail/i18n/de.po @@ -20,7 +20,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -29,21 +29,24 @@ msgstr "" "'displayName' verwenden." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "Email-Attribut" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "LDAP-Attribut, um eine Email-Adresse zu erhalten." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Namens-Attribut" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/es.po b/users_ldap_mail/i18n/es.po index 64583845d8..f37fcb8e11 100644 --- a/users_ldap_mail/i18n/es.po +++ b/users_ldap_mail/i18n/es.po @@ -21,7 +21,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -30,21 +30,24 @@ msgstr "" "en su lugar." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "Atributo e-mail" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "Atributo LDAP a utilizar para recumerar la dirección em-mail." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Atributo Nombre" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/fr.po b/users_ldap_mail/i18n/fr.po index ac43b824c4..12900bd57c 100644 --- a/users_ldap_mail/i18n/fr.po +++ b/users_ldap_mail/i18n/fr.po @@ -19,28 +19,31 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/hr.po b/users_ldap_mail/i18n/hr.po index 38c53685db..ef2b85fbbf 100644 --- a/users_ldap_mail/i18n/hr.po +++ b/users_ldap_mail/i18n/hr.po @@ -21,7 +21,7 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -30,21 +30,24 @@ msgstr "" "umjesto zadanog." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "Atribut e-mail" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "LDAP atribut za dohvat email adresa." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Atribut naziva" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/hr_HR.po b/users_ldap_mail/i18n/hr_HR.po index d3509508d3..97257cab78 100644 --- a/users_ldap_mail/i18n/hr_HR.po +++ b/users_ldap_mail/i18n/hr_HR.po @@ -21,7 +21,7 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -29,21 +29,24 @@ msgstr "" "Zadano koristi 'cn'. Za ActiveDirectory možete koristiti i 'displayName'." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "E-mail atribut" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "LDAP atribut za dohvaćanje e-mail adrese." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Atribut Naziv" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/pt_BR.po b/users_ldap_mail/i18n/pt_BR.po index 5fc2b6d9ac..dfef3d82f1 100644 --- a/users_ldap_mail/i18n/pt_BR.po +++ b/users_ldap_mail/i18n/pt_BR.po @@ -20,7 +20,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -28,21 +28,21 @@ msgstr "" "Por padrão 'cn' é usado. Para ActiveDirectory você pode usar 'displayName'" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "Atributo E-mail" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "Use o atributo LDAP para recuperar o endereço de e-mail" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Atributo Nome" - -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "" diff --git a/users_ldap_mail/i18n/sl.po b/users_ldap_mail/i18n/sl.po index 3092037bb4..4f3ceaeb21 100644 --- a/users_ldap_mail/i18n/sl.po +++ b/users_ldap_mail/i18n/sl.po @@ -21,7 +21,7 @@ msgstr "" "%100==4 ? 2 : 3);\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." @@ -30,21 +30,24 @@ msgstr "" "uporabili 'displayName'." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "E-poštni atribut" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "LDAP atribut za uporabo pri pridobivanju e-poštnih naslovov." #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "Naziv atributa" -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "res.company.ldap" +#~ msgid "res.company.ldap" +#~ msgstr "res.company.ldap" diff --git a/users_ldap_mail/i18n/users_ldap_mail.pot b/users_ldap_mail/i18n/users_ldap_mail.pot index c578c91f4d..694899fca0 100644 --- a/users_ldap_mail/i18n/users_ldap_mail.pot +++ b/users_ldap_mail/i18n/users_ldap_mail.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,27 +14,27 @@ msgstr "" "Plural-Forms: \n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "By default 'cn' is used. For ActiveDirectory you might use 'displayName' instead." msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute -msgid "E-mail attribute" +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute -msgid "LDAP attribute to use to retrieve em-mail address." +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute +msgid "E-mail attribute" msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute -msgid "Name Attribute" +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute +msgid "LDAP attribute to use to retrieve em-mail address." msgstr "" #. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute +msgid "Name Attribute" msgstr "" diff --git a/users_ldap_mail/i18n/zh_CN.po b/users_ldap_mail/i18n/zh_CN.po index f217c1462d..1519f47cc0 100644 --- a/users_ldap_mail/i18n/zh_CN.po +++ b/users_ldap_mail/i18n/zh_CN.po @@ -20,28 +20,28 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__name_attribute msgid "" "By default 'cn' is used. For ActiveDirectory you might use 'displayName' " "instead." msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model,name:users_ldap_mail.model_res_company_ldap +msgid "Company LDAP configuration" +msgstr "" + +#. module: users_ldap_mail +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "E-mail attribute" msgstr "E-mail 属性" #. module: users_ldap_mail -#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap_mail_attribute +#: model:ir.model.fields,help:users_ldap_mail.field_res_company_ldap__mail_attribute msgid "LDAP attribute to use to retrieve em-mail address." msgstr "" #. module: users_ldap_mail -#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap_name_attribute +#: model:ir.model.fields,field_description:users_ldap_mail.field_res_company_ldap__name_attribute msgid "Name Attribute" msgstr "名称属性" - -#. module: users_ldap_mail -#: model:ir.model,name:users_ldap_mail.model_res_company_ldap -msgid "res.company.ldap" -msgstr "" diff --git a/users_ldap_mail/models/__init__.py b/users_ldap_mail/models/__init__.py index 42c6293ea9..4a58f52e68 100644 --- a/users_ldap_mail/models/__init__.py +++ b/users_ldap_mail/models/__init__.py @@ -1,5 +1,4 @@ -# © Daniel Reis (https://launchpad.com/~dreis-pt) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). +# Copyright Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import users_ldap_model - diff --git a/users_ldap_mail/models/users_ldap_model.py b/users_ldap_mail/models/users_ldap_model.py index 77f4a2d705..4f76b8acb8 100644 --- a/users_ldap_mail/models/users_ldap_model.py +++ b/users_ldap_mail/models/users_ldap_model.py @@ -1,10 +1,10 @@ -# © Daniel Reis (https://launchpad.com/~dreis-pt) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). +# Copyright Daniel Reis (https://launchpad.com/~dreis-pt) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields import logging -_log = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) class CompanyLDAP(models.Model): @@ -22,7 +22,7 @@ class CompanyLDAP(models.Model): help="LDAP attribute to use to retrieve em-mail address.", ) - def get_ldap_dicts(self): + def _get_ldap_dicts(self): """ Copy of auth_ldap's funtion, changing only the SQL, so that it returns all fields in the table. @@ -30,9 +30,8 @@ def get_ldap_dicts(self): return self.sudo().search([('ldap_server', '!=', False)], order='sequence').read([]) - def map_ldap_attributes(self, conf, login, ldap_entry): - values = super(CompanyLDAP, self).map_ldap_attributes(conf, login, - ldap_entry) + def _map_ldap_attributes(self, conf, login, ldap_entry): + values = super()._map_ldap_attributes(conf, login, ldap_entry) mapping = [ ('name', 'name_attribute'), ('email', 'mail_attribute'), @@ -42,6 +41,7 @@ def map_ldap_attributes(self, conf, login, ldap_entry): if conf[conf_name]: values[value_key] = ldap_entry[1][conf[conf_name]][0] except KeyError: - _log.warning('No LDAP attribute "%s" found for login "%s"' % ( - conf.get(conf_name), values.get('login'))) + _logger.warning( + 'No LDAP attribute "%s" found for login "%s"' % ( + conf.get(conf_name), values.get('login'))) return values diff --git a/users_ldap_mail/readme/CONTRIBUTORS.rst b/users_ldap_mail/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..a6b11bf5e0 --- /dev/null +++ b/users_ldap_mail/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Daniel Reis (https://launchpad.com/~dreis-pt), +* `Tecnativa `_: + + * Alexandre Díaz diff --git a/users_ldap_mail/readme/DESCRIPTION.rst b/users_ldap_mail/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..5298692bde --- /dev/null +++ b/users_ldap_mail/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module extends the functionality of the auth_ldap module to support mail +from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo +users. diff --git a/users_ldap_mail/readme/USAGE.rst b/users_ldap_mail/readme/USAGE.rst new file mode 100644 index 0000000000..aab8f01177 --- /dev/null +++ b/users_ldap_mail/readme/USAGE.rst @@ -0,0 +1,9 @@ +To use this module, you need to: + +#. Open Odoo in your browser +#. Go to Settings +#. Go to General Settings +#. In The General Settings form go to LDAP Parameters +#. In a LDAP Parameters item there are two new fields: mail and name, the name + These items will correspond with a new user that is created, when a user + logs in via LDAP in Odoo. diff --git a/users_ldap_mail/static/description/index.html b/users_ldap_mail/static/description/index.html new file mode 100644 index 0000000000..72a928236e --- /dev/null +++ b/users_ldap_mail/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +LDAP mapping for user name and e-mail + + + +
+

LDAP mapping for user name and e-mail

+ + +

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runbot

+

This module extends the functionality of the auth_ldap module to support mail +from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo +users.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Open Odoo in your browser
  2. +
  3. Go to Settings
  4. +
  5. Go to General Settings
  6. +
  7. In The General Settings form go to LDAP Parameters
  8. +
  9. In a LDAP Parameters item there are two new fields: mail and name, the name +These items will correspond with a new user that is created, when a user +logs in via LDAP in Odoo.
  10. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Daniel Reis
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/server-auth project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From 3913fe17adbd56319d5a297940a02bfff1807368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Thu, 4 Feb 2021 14:23:45 +0000 Subject: [PATCH 08/21] users_ldap_mail: black, isort, prettier --- users_ldap_mail/__manifest__.py | 19 ++++++------- users_ldap_mail/models/users_ldap_model.py | 33 +++++++++++++--------- users_ldap_mail/views/res_company_ldap.xml | 9 +++--- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py index 47cd72c0e9..2f77dba286 100644 --- a/users_ldap_mail/__manifest__.py +++ b/users_ldap_mail/__manifest__.py @@ -2,15 +2,12 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). { - 'name': "LDAP mapping for user name and e-mail", - 'version': "12.0.1.0.0", - 'depends': ["auth_ldap"], - 'author': "Daniel Reis," - "Odoo Community Association (OCA)", - 'license': 'AGPL-3', - 'category': "Tools", - 'data': [ - 'views/res_company_ldap.xml', - ], - 'installable': True, + "name": "LDAP mapping for user name and e-mail", + "version": "12.0.1.0.0", + "depends": ["auth_ldap"], + "author": "Daniel Reis," "Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Tools", + "data": ["views/res_company_ldap.xml",], + "installable": True, } diff --git a/users_ldap_mail/models/users_ldap_model.py b/users_ldap_mail/models/users_ldap_model.py index 4f76b8acb8..f6ff6d9595 100644 --- a/users_ldap_mail/models/users_ldap_model.py +++ b/users_ldap_mail/models/users_ldap_model.py @@ -1,24 +1,25 @@ # Copyright Daniel Reis (https://launchpad.com/~dreis-pt) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields - import logging + +from odoo import fields, models + _logger = logging.getLogger(__name__) class CompanyLDAP(models.Model): - _inherit = 'res.company.ldap' + _inherit = "res.company.ldap" name_attribute = fields.Char( - 'Name Attribute', - default='cn', + "Name Attribute", + default="cn", help="By default 'cn' is used. " - "For ActiveDirectory you might use 'displayName' instead.", + "For ActiveDirectory you might use 'displayName' instead.", ) mail_attribute = fields.Char( - 'E-mail attribute', - default='mail', + "E-mail attribute", + default="mail", help="LDAP attribute to use to retrieve em-mail address.", ) @@ -27,14 +28,17 @@ def _get_ldap_dicts(self): Copy of auth_ldap's funtion, changing only the SQL, so that it returns all fields in the table. """ - return self.sudo().search([('ldap_server', '!=', False)], - order='sequence').read([]) + return ( + self.sudo() + .search([("ldap_server", "!=", False)], order="sequence") + .read([]) + ) def _map_ldap_attributes(self, conf, login, ldap_entry): values = super()._map_ldap_attributes(conf, login, ldap_entry) mapping = [ - ('name', 'name_attribute'), - ('email', 'mail_attribute'), + ("name", "name_attribute"), + ("email", "mail_attribute"), ] for value_key, conf_name in mapping: try: @@ -42,6 +46,7 @@ def _map_ldap_attributes(self, conf, login, ldap_entry): values[value_key] = ldap_entry[1][conf[conf_name]][0] except KeyError: _logger.warning( - 'No LDAP attribute "%s" found for login "%s"' % ( - conf.get(conf_name), values.get('login'))) + 'No LDAP attribute "%s" found for login "%s"' + % (conf.get(conf_name), values.get("login")) + ) return values diff --git a/users_ldap_mail/views/res_company_ldap.xml b/users_ldap_mail/views/res_company_ldap.xml index ec9f7d89c9..a1e2bb2c3e 100644 --- a/users_ldap_mail/views/res_company_ldap.xml +++ b/users_ldap_mail/views/res_company_ldap.xml @@ -1,14 +1,13 @@ - + res.company.ldap.form res.company.ldap - + - - + + From ce525c33efe62c0aea391de0c3a28148f2ae0376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 5 Feb 2021 07:43:40 +0000 Subject: [PATCH 09/21] users_ldap_mail: Migration to 13.0 --- users_ldap_mail/README.rst | 39 ++++++++++---- users_ldap_mail/__manifest__.py | 7 ++- users_ldap_mail/readme/CONTRIBUTORS.rst | 1 + users_ldap_mail/readme/ROADMAP.rst | 2 + users_ldap_mail/readme/USAGE.rst | 14 ++--- users_ldap_mail/static/description/index.html | 52 ++++++++++++------- 6 files changed, 76 insertions(+), 39 deletions(-) create mode 100644 users_ldap_mail/readme/ROADMAP.rst diff --git a/users_ldap_mail/README.rst b/users_ldap_mail/README.rst index 20c86b76b2..b9e9412b65 100644 --- a/users_ldap_mail/README.rst +++ b/users_ldap_mail/README.rst @@ -14,13 +14,13 @@ LDAP mapping for user name and e-mail :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/12.0/users_ldap_mail + :target: https://github.com/OCA/server-auth/tree/13.0/users_ldap_mail :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-users_ldap_mail + :target: https://translation.odoo-community.org/projects/server-auth-13-0/server-auth-13-0-users_ldap_mail :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/251/12.0 + :target: https://runbot.odoo-community.org/runbot/251/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -40,12 +40,20 @@ Usage To use this module, you need to: #. Open Odoo in your browser -#. Go to Settings -#. Go to General Settings -#. In The General Settings form go to LDAP Parameters -#. In a LDAP Parameters item there are two new fields: mail and name, the name - These items will correspond with a new user that is created, when a user - logs in via LDAP in Odoo. +#. Go to **Settings > General Settings** +#. In the **Integrations** section click on **LDAP Server** under + **LDAP Authentication**. This will allow you to create your LDAP integration + settings. +#. When creating or editing a record, under the **Process Parameter** section + there are two new fields: mail and name, the name of these items will + correspond with a new user that is created, when a user logs in via LDAP in + Odoo. + +Known issues / Roadmap +====================== + + +* Add tests (use LDAP Mocking through something like https://mockldap.readthedocs.io/en/latest/overview.html) Bug Tracker =========== @@ -53,7 +61,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -72,6 +80,7 @@ Contributors * `Tecnativa `_: * Alexandre Díaz + * João Marques Maintainers ~~~~~~~~~~~ @@ -86,6 +95,14 @@ 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/server-auth `_ project on GitHub. +.. |maintainer-joao-p-marques| image:: https://github.com/joao-p-marques.png?size=40px + :target: https://github.com/joao-p-marques + :alt: joao-p-marques + +Current `maintainer `__: + +|maintainer-joao-p-marques| + +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py index 2f77dba286..45bb841119 100644 --- a/users_ldap_mail/__manifest__.py +++ b/users_ldap_mail/__manifest__.py @@ -1,13 +1,16 @@ # Copyright Daniel Reis (https://launchpad.com/~dreis-pt) +# Copyright 2021 Tecnativa - João Marques # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). { "name": "LDAP mapping for user name and e-mail", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "depends": ["auth_ldap"], "author": "Daniel Reis," "Odoo Community Association (OCA)", + "maintainers": ["joao-p-marques"], + "website": "https://github.com/OCA/server-auth", "license": "AGPL-3", "category": "Tools", - "data": ["views/res_company_ldap.xml",], + "data": ["views/res_company_ldap.xml"], "installable": True, } diff --git a/users_ldap_mail/readme/CONTRIBUTORS.rst b/users_ldap_mail/readme/CONTRIBUTORS.rst index a6b11bf5e0..8eefba611f 100644 --- a/users_ldap_mail/readme/CONTRIBUTORS.rst +++ b/users_ldap_mail/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * `Tecnativa `_: * Alexandre Díaz + * João Marques diff --git a/users_ldap_mail/readme/ROADMAP.rst b/users_ldap_mail/readme/ROADMAP.rst new file mode 100644 index 0000000000..e9bdebcf5f --- /dev/null +++ b/users_ldap_mail/readme/ROADMAP.rst @@ -0,0 +1,2 @@ + +* Add tests (use LDAP Mocking through something like https://mockldap.readthedocs.io/en/latest/overview.html) diff --git a/users_ldap_mail/readme/USAGE.rst b/users_ldap_mail/readme/USAGE.rst index aab8f01177..9c70b69317 100644 --- a/users_ldap_mail/readme/USAGE.rst +++ b/users_ldap_mail/readme/USAGE.rst @@ -1,9 +1,11 @@ To use this module, you need to: #. Open Odoo in your browser -#. Go to Settings -#. Go to General Settings -#. In The General Settings form go to LDAP Parameters -#. In a LDAP Parameters item there are two new fields: mail and name, the name - These items will correspond with a new user that is created, when a user - logs in via LDAP in Odoo. +#. Go to **Settings > General Settings** +#. In the **Integrations** section click on **LDAP Server** under + **LDAP Authentication**. This will allow you to create your LDAP integration + settings. +#. When creating or editing a record, under the **Process Parameter** section + there are two new fields: mail and name, the name of these items will + correspond with a new user that is created, when a user logs in via LDAP in + Odoo. diff --git a/users_ldap_mail/static/description/index.html b/users_ldap_mail/static/description/index.html index 72a928236e..650ea3ac65 100644 --- a/users_ldap_mail/static/description/index.html +++ b/users_ldap_mail/static/description/index.html @@ -3,7 +3,7 @@ - + LDAP mapping for user name and e-mail -
-

LDAP mapping for user name and e-mail

+
+ + +Odoo Community Association + +
+

LDAP mapping for user name and e-mail

-

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

This module extends the functionality of the auth_ldap module to support mail from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo users.

@@ -388,7 +393,7 @@

LDAP mapping for user name and e-mail

-

Usage

+

Usage

To use this module, you need to:

  1. Open Odoo in your browser
  2. @@ -403,14 +408,14 @@

    Usage

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -418,15 +423,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • Daniel Reis
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -452,5 +457,6 @@

Maintainers

+
From 7db02779da24637c59c80dd0f9d92a4b733bda93 Mon Sep 17 00:00:00 2001 From: owen_chen Date: Mon, 20 Oct 2025 03:20:15 +0000 Subject: [PATCH 21/21] docs: update version references from 18.0 to 17.0 in documentation and manifest files --- users_ldap_mail/README.rst | 8 ++++---- users_ldap_mail/__manifest__.py | 2 +- users_ldap_mail/i18n/users_ldap_mail.pot | 2 +- users_ldap_mail/static/description/index.html | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/users_ldap_mail/README.rst b/users_ldap_mail/README.rst index fa379371a2..6e4ab61606 100644 --- a/users_ldap_mail/README.rst +++ b/users_ldap_mail/README.rst @@ -21,13 +21,13 @@ LDAP mapping for user name and e-mail :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github - :target: https://github.com/OCA/server-auth/tree/18.0/users_ldap_mail + :target: https://github.com/OCA/server-auth/tree/17.0/users_ldap_mail :alt: OCA/server-auth .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/server-auth-18-0/server-auth-18-0-users_ldap_mail :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=18.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -68,7 +68,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -110,6 +110,6 @@ Current `maintainer `__: |maintainer-joao-p-marques| -This module is part of the `OCA/server-auth `_ project on GitHub. +This module is part of the `OCA/server-auth `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/users_ldap_mail/__manifest__.py b/users_ldap_mail/__manifest__.py index acd8ba2bd8..6a66bfae82 100644 --- a/users_ldap_mail/__manifest__.py +++ b/users_ldap_mail/__manifest__.py @@ -4,7 +4,7 @@ { "name": "LDAP mapping for user name and e-mail", - "version": "18.0.1.0.0", + "version": "17.0.1.0.0", "depends": ["auth_ldap"], "author": "Daniel Reis," "Odoo Community Association (OCA)", "maintainers": ["joao-p-marques"], diff --git a/users_ldap_mail/i18n/users_ldap_mail.pot b/users_ldap_mail/i18n/users_ldap_mail.pot index e72fe29cfe..87c00da545 100644 --- a/users_ldap_mail/i18n/users_ldap_mail.pot +++ b/users_ldap_mail/i18n/users_ldap_mail.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 18.0\n" +"Project-Id-Version: Odoo Server 17.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/users_ldap_mail/static/description/index.html b/users_ldap_mail/static/description/index.html index fe40e67146..45a2d8e08c 100644 --- a/users_ldap_mail/static/description/index.html +++ b/users_ldap_mail/static/description/index.html @@ -374,7 +374,7 @@

LDAP mapping for user name and e-mail

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:884c0f40475b56edbbe58a469af7199aca71ce970676c1b15cdea31aa7fcb5c2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

This module extends the functionality of the auth_ldap module to support mail from LDAP and to allow you to get an e-mail address from LDAP accounts to Odoo users.

@@ -419,7 +419,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -452,7 +452,7 @@

Maintainers

promote its widespread use.

Current maintainer:

joao-p-marques

-

This module is part of the OCA/server-auth project on GitHub.

+

This module is part of the OCA/server-auth project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.