Browse Source
10.0 migrate users_ldap_populate (#657)
10.0 migrate users_ldap_populate (#657)
* [MIG] migrate users_ldap_populate to 10.0 Changes include: - move views to views folder - move models to models folder - in views rename openerp to odoo - __openerp__.py to __manifest__.py * [FIX] Add read me to module users_ldap_populate * [FIX] users_ldap_populate: cleanup manifest file Cleanup of the author list * [FIX] users_ldap_populate: More modern copyright in .py files * [FIX] users_ldap_populate: Update read me Fixes include: - more human module name - Fix web linkspull/682/head
Stephan
8 years ago
committed by
Daniel Reis
12 changed files with 154 additions and 129 deletions
-
68users_ldap_populate/README.rst
-
6users_ldap_populate/__init__.py
-
35users_ldap_populate/__manifest__.py
-
2users_ldap_populate/model/__init__.py
-
45users_ldap_populate/model/populate_wizard.py
-
6users_ldap_populate/models/__init__.py
-
28users_ldap_populate/models/populate_wizard.py
-
25users_ldap_populate/models/users_ldap.py
-
17users_ldap_populate/view/populate_wizard.xml
-
19users_ldap_populate/view/users_ldap.xml
-
15users_ldap_populate/views/populate_wizard.xml
-
17users_ldap_populate/views/users_ldap.xml
@ -0,0 +1,68 @@ |
|||
.. 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 Populate |
|||
=================== |
|||
|
|||
This module extends the functionality of auth_ldap by adding functionality so |
|||
that users can be populated from a LDAP server. |
|||
|
|||
Installation |
|||
============ |
|||
|
|||
To install this module, you need to: |
|||
|
|||
#. Install the module users_ldap_populate from the module list. |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
To use this module, you need to: |
|||
|
|||
#. Go to 'Settings' -> 'General Settings' |
|||
#. In the LDAP category click on or add a LDAP configuration |
|||
#. In the pop-up enter all the LDAP settings |
|||
#. Click the populate button |
|||
#. A new pop-up will notify you of how many users are added |
|||
|
|||
.. 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 |
|||
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please |
|||
check there if your issue has already been reported. If you spotted it first, |
|||
help us smashing it by providing a detailed and welcomed feedback. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
* Therp BV |
|||
|
|||
Images |
|||
------ |
|||
|
|||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
|||
|
|||
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. |
@ -1 +1,5 @@ |
|||
from . import model |
|||
# -*- coding: utf-8 -*- |
|||
# © 2012 Therp BV (<http://therp.nl>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). |
|||
|
|||
from . import models |
@ -1,2 +0,0 @@ |
|||
from . import users_ldap |
|||
from . import populate_wizard |
@ -1,45 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2012 Therp BV (<http://therp.nl>). |
|||
# |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from openerp import models, fields, api |
|||
|
|||
|
|||
class CompanyLDAPPopulateWizard(models.TransientModel): |
|||
_name = 'res.company.ldap.populate_wizard' |
|||
_description = 'Populate users from LDAP' |
|||
|
|||
name = fields.Char('Name', size=16) |
|||
ldap_id = fields.Many2one( |
|||
'res.company.ldap', |
|||
'LDAP Configuration' |
|||
) |
|||
users_created = fields.Integer( |
|||
'Number of users created', |
|||
readonly=True |
|||
) |
|||
|
|||
@api.model |
|||
@api.returns('self', lambda value: value.id) |
|||
def create(self, vals): |
|||
if 'ldap_id' in vals: |
|||
ldap = self.env['res.company.ldap'].browse(vals['ldap_id']) |
|||
vals['users_created'] = ldap.action_populate() |
|||
return super(CompanyLDAPPopulateWizard, self).create(vals) |
@ -0,0 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2012 Therp BV (<http://therp.nl>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). |
|||
|
|||
from . import users_ldap |
|||
from . import populate_wizard |
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2012 Therp BV (<http://therp.nl>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). |
|||
|
|||
from odoo import models, fields, api |
|||
|
|||
|
|||
class CompanyLDAPPopulateWizard(models.TransientModel): |
|||
_name = 'res.company.ldap.populate_wizard' |
|||
_description = 'Populate users from LDAP' |
|||
|
|||
name = fields.Char('Name', size=16) |
|||
ldap_id = fields.Many2one( |
|||
'res.company.ldap', |
|||
'LDAP Configuration' |
|||
) |
|||
users_created = fields.Integer( |
|||
'Number of users created', |
|||
readonly=True |
|||
) |
|||
|
|||
@api.model |
|||
@api.returns('self', lambda value: value.id) |
|||
def create(self, vals): |
|||
if 'ldap_id' in vals: |
|||
ldap = self.env['res.company.ldap'].browse(vals['ldap_id']) |
|||
vals['users_created'] = ldap.action_populate() |
|||
return super(CompanyLDAPPopulateWizard, self).create(vals) |
@ -1,28 +1,11 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# OpenERP, Open Source Management Solution |
|||
# This module copyright (C) 2012 Therp BV (<http://therp.nl>). |
|||
# |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
# © 2012 Therp BV (<http://therp.nl>) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). |
|||
|
|||
import re |
|||
|
|||
from openerp import models, api, _ |
|||
from openerp.exceptions import UserError |
|||
from odoo import models, api, _ |
|||
from odoo.exceptions import UserError |
|||
import logging |
|||
|
|||
_logger = logging.getLogger(__name__) |
@ -1,17 +0,0 @@ |
|||
<?xml version="1.0"?> |
|||
<openerp> |
|||
<data> |
|||
<record model="ir.ui.view" id="populate_wizard_view"> |
|||
<field name="name">Add populate button to ldap view</field> |
|||
<field name="model">res.company.ldap.populate_wizard</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Add populate button to ldap view"> |
|||
<group> |
|||
<field name="users_created"/> |
|||
<button icon="gtk-ok" string="OK" special="cancel"/> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -1,19 +0,0 @@ |
|||
<?xml version="1.0"?> |
|||
<openerp> |
|||
<data> |
|||
<record model="ir.ui.view" id="company_form_view"> |
|||
<field name="name">Add populate button to ldap view</field> |
|||
<field name="model">res.company</field> |
|||
<field name="inherit_id" ref="auth_ldap.company_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath name="populate_ldap" expr="//field[@name='ldaps']/form" position="inside"> |
|||
<separator string="Populate user database" colspan="4"/> |
|||
<button name="populate_wizard" |
|||
string="Populate" |
|||
type="object" |
|||
colspan="2"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0"?> |
|||
<odoo> |
|||
<record model="ir.ui.view" id="populate_wizard_view"> |
|||
<field name="name">Add populate button to ldap view</field> |
|||
<field name="model">res.company.ldap.populate_wizard</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Add populate button to ldap view"> |
|||
<group> |
|||
<field name="users_created"/> |
|||
<button icon="gtk-ok" string="OK" special="cancel"/> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0"?> |
|||
<odoo> |
|||
<record model="ir.ui.view" id="company_form_view"> |
|||
<field name="name">Add populate button to ldap view</field> |
|||
<field name="model">base.config.settings</field> |
|||
<field name="inherit_id" ref="auth_ldap.view_general_configuration_form_inherit_auth_ldap"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath name="populate_ldap" expr="//field[@name='ldaps']/form" position="inside"> |
|||
<separator name="Populate user database" colspan="4"/> |
|||
<button name="populate_wizard" |
|||
string="Populate" |
|||
type="object" |
|||
colspan="2"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue