Browse Source

[11.0][MIG] mail_restrict_follower_selection

pull/249/merge
phucngta 7 years ago
committed by Holger Brunn
parent
commit
5a7457309e
  1. 5
      mail_restrict_follower_selection/README.rst
  2. 23
      mail_restrict_follower_selection/__init__.py
  3. 26
      mail_restrict_follower_selection/__manifest__.py
  4. 1
      mail_restrict_follower_selection/data/ir_actions.xml
  5. 23
      mail_restrict_follower_selection/models/__init__.py
  6. 29
      mail_restrict_follower_selection/models/mail_wizard_invite.py
  7. 24
      mail_restrict_follower_selection/tests/__init__.py
  8. 25
      mail_restrict_follower_selection/tests/test_mail_restrict_follower_selection.py

5
mail_restrict_follower_selection/README.rst

@ -1,5 +1,7 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
:alt: License: AGPL-3
===========================
Restrict follower selection Restrict follower selection
=========================== ===========================
@ -40,6 +42,7 @@ Contributors
------------ ------------
* Holger Brunn <hbrunn@therp.nl> * Holger Brunn <hbrunn@therp.nl>
* Nguyen Tan Phuc <phuc.nt@komit-consulting.com>
Maintainer Maintainer
---------- ----------

23
mail_restrict_follower_selection/__init__.py

@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models from . import models

26
mail_restrict_follower_selection/__manifest__.py

@ -1,26 +1,10 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{ {
"name": "Restrict follower selection", "name": "Restrict follower selection",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)", "author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",
"category": "Social Network", "category": "Social Network",

1
mail_restrict_follower_selection/data/ir_actions.xml

@ -7,7 +7,6 @@
</record> </record>
<record id="todo_setup" model="ir.actions.todo"> <record id="todo_setup" model="ir.actions.todo">
<field name="name">Configure the restriction on followers</field> <field name="name">Configure the restriction on followers</field>
<field name="type">automatic</field>
<field name="action_id" ref="action_setup" /> <field name="action_id" ref="action_setup" />
</record> </record>
</odoo> </odoo>

23
mail_restrict_follower_selection/models/__init__.py

@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import mail_wizard_invite from . import mail_wizard_invite

29
mail_restrict_follower_selection/models/mail_wizard_invite.py

@ -1,24 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from lxml import etree from lxml import etree
from odoo import models, api
from odoo import api, models
class MailWizardInvite(models.TransientModel): class MailWizardInvite(models.TransientModel):
@ -28,8 +13,8 @@ class MailWizardInvite(models.TransientModel):
def _mail_restrict_follower_selection_get_domain(self): def _mail_restrict_follower_selection_get_domain(self):
parameter_name = 'mail_restrict_follower_selection.domain' parameter_name = 'mail_restrict_follower_selection.domain'
return self.env['ir.config_parameter'].get_param( return self.env['ir.config_parameter'].get_param(
'%s.%s' % (parameter_name,
self.env.context.get('default_res_model')),
"{0}.{1}".format(parameter_name,
self.env.context.get('default_res_model')),
self.env['ir.config_parameter'].get_param( self.env['ir.config_parameter'].get_param(
parameter_name, default='[]') parameter_name, default='[]')
) )

24
mail_restrict_follower_selection/tests/__init__.py

@ -1,21 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_mail_restrict_follower_selection from . import test_mail_restrict_follower_selection

25
mail_restrict_follower_selection/tests/test_mail_restrict_follower_selection.py

@ -1,28 +1,13 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 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/>.
#
##############################################################################
# Copyright (C) 2015 Therp BV <http://therp.nl>
# Copyright (C) 2017 Komit <http://www.komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from lxml import etree from lxml import etree
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
class TestMailRestrictFollowerSelection(TransactionCase): class TestMailRestrictFollowerSelection(TransactionCase):
def test_fields_view_get(self): def test_fields_view_get(self):
result = self.env['mail.wizard.invite'].fields_view_get( result = self.env['mail.wizard.invite'].fields_view_get(
view_type='form') view_type='form')

Loading…
Cancel
Save