Merge lp:~vauxoo/addons-vauxoo/7.0-add_project_followers_rule-dev_ernesto into lp:addons-vauxoo/7.0

Status: Merged
Merged at revision: 1050
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-add_project_followers_rule-dev_ernesto
Merge into: lp:addons-vauxoo/7.0
Diff against target: 303 lines (+254/-0)
9 files modified
project_followers_rule/__init__.py (+26/-0)
project_followers_rule/__openerp__.py (+49/-0)
project_followers_rule/data/ir_rule_project_data.xml (+17/-0)
project_followers_rule/i18n/es_MX.po (+21/-0)
project_followers_rule/i18n/es_VE.po (+21/-0)
project_followers_rule/i18n/project_followers_rule.pot (+21/-0)
project_followers_rule/model/__init__.py (+28/-0)
project_followers_rule/model/project.py (+56/-0)
project_followers_rule/view/project_project_view.xml (+15/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-add_project_followers_rule-dev_ernesto
Reviewer Review Type Date Requested Status
Luis Ernesto García Medina - http://www.vauxoo.com Needs Resubmitting
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+219922@code.launchpad.net

Description of the change

Julio agrego el modulo de project_followers_rule, este agrega un campo function que saca los seguidores de las tareas de los proyectos, la regla de registro checa si el partner del usuario conectado y ve si esta entre los seguidores del las tareas del proyecto

To post a comment you must log in.
1020. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][project_followers_rule] applied autopep8

1021. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][project_followers_rule] changes in variable names

Revision history for this message
Luis Ernesto García Medina - http://www.vauxoo.com (ernesto-gm) wrote :

Se aplico autopep8 y se cambiaron nombres de algunas variables

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'project_followers_rule'
=== added file 'project_followers_rule/__init__.py'
--- project_followers_rule/__init__.py 1970-01-01 00:00:00 +0000
+++ project_followers_rule/__init__.py 2014-05-16 23:29:47 +0000
@@ -0,0 +1,26 @@
1# -*- encoding: utf-8 -*-
2#
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8#
9# Coded by: Jorge Angel Naranjo (jorge_nr@vauxoo.com)
10#
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25#
26import model
027
=== added file 'project_followers_rule/__openerp__.py'
--- project_followers_rule/__openerp__.py 1970-01-01 00:00:00 +0000
+++ project_followers_rule/__openerp__.py 2014-05-16 23:29:47 +0000
@@ -0,0 +1,49 @@
1# -*- encoding: utf-8 -*-
2#
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8#
9# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
10#
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25#
26
27{
28 "name": "Followers of Task to Project",
29 "version": "1.0",
30 "author": "Vauxoo",
31 "category": "Generic Modules",
32 "description" : """
33The followers_task_ids function field type is added, this field is used in the registration rule Follow Project Task,
34allowing read, write, delete and create tasks without being a follower of the project.
35 """,
36 "website": "http://www.vauxoo.com/",
37 "license": "AGPL-3",
38 "depends": [
39 "project",
40 ],
41 "demo": [
42 ],
43 "data": [
44 'data/ir_rule_project_data.xml',
45 'view/project_project_view.xml',
46 ],
47 "installable": True,
48 "active": False,
49}
050
=== added directory 'project_followers_rule/data'
=== added file 'project_followers_rule/data/ir_rule_project_data.xml'
--- project_followers_rule/data/ir_rule_project_data.xml 1970-01-01 00:00:00 +0000
+++ project_followers_rule/data/ir_rule_project_data.xml 2014-05-16 23:29:47 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data noupdate='1'>
4 <record id="rule_followers_task" model="ir.rule">
5 <field name="name">Project Follow Task</field>
6 <field ref="model_project_project" name="model_id"/>
7 <field name="domain_force">[('followers_tasks_ids', 'in', [user.partner_id.id])]</field>
8 <field name="perm_read" eval="1"/>
9 <field name="perm_write" eval="1"/>
10 <field name="perm_create" eval="1"/>
11 <field name="perm_unlink" eval="1"/>
12 <field name="active" eval="1"/>
13 <field name="groups" eval="[(6,0,[ref('base.group_user'),])]"/>
14 </record>
15
16 </data>
17</openerp>
018
=== added directory 'project_followers_rule/i18n'
=== added file 'project_followers_rule/i18n/es_MX.po'
--- project_followers_rule/i18n/es_MX.po 1970-01-01 00:00:00 +0000
+++ project_followers_rule/i18n/es_MX.po 2014-05-16 23:29:47 +0000
@@ -0,0 +1,21 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3#
4msgid ""
5msgstr ""
6"Project-Id-Version: OpenERP Server 7.0\n"
7"Report-Msgid-Bugs-To: \n"
8"POT-Creation-Date: 2014-05-16 22:51+0000\n"
9"PO-Revision-Date: 2014-05-16 22:51+0000\n"
10"Last-Translator: <>\n"
11"Language-Team: \n"
12"MIME-Version: 1.0\n"
13"Content-Type: text/plain; charset=UTF-8\n"
14"Content-Transfer-Encoding: \n"
15"Plural-Forms: \n"
16
17#. module: project_followers_rule
18#: model:ir.model,name:project_followers_rule.model_project_project
19msgid "Project"
20msgstr "Proyecto"
21
022
=== added file 'project_followers_rule/i18n/es_VE.po'
--- project_followers_rule/i18n/es_VE.po 1970-01-01 00:00:00 +0000
+++ project_followers_rule/i18n/es_VE.po 2014-05-16 23:29:47 +0000
@@ -0,0 +1,21 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3#
4msgid ""
5msgstr ""
6"Project-Id-Version: OpenERP Server 7.0\n"
7"Report-Msgid-Bugs-To: \n"
8"POT-Creation-Date: 2014-05-16 22:51+0000\n"
9"PO-Revision-Date: 2014-05-16 22:51+0000\n"
10"Last-Translator: <>\n"
11"Language-Team: \n"
12"MIME-Version: 1.0\n"
13"Content-Type: text/plain; charset=UTF-8\n"
14"Content-Transfer-Encoding: \n"
15"Plural-Forms: \n"
16
17#. module: project_followers_rule
18#: model:ir.model,name:project_followers_rule.model_project_project
19msgid "Project"
20msgstr "Proyecto"
21
022
=== added file 'project_followers_rule/i18n/project_followers_rule.pot'
--- project_followers_rule/i18n/project_followers_rule.pot 1970-01-01 00:00:00 +0000
+++ project_followers_rule/i18n/project_followers_rule.pot 2014-05-16 23:29:47 +0000
@@ -0,0 +1,21 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3#
4msgid ""
5msgstr ""
6"Project-Id-Version: OpenERP Server 7.0\n"
7"Report-Msgid-Bugs-To: \n"
8"POT-Creation-Date: 2014-05-16 22:48+0000\n"
9"PO-Revision-Date: 2014-05-16 22:48+0000\n"
10"Last-Translator: <>\n"
11"Language-Team: \n"
12"MIME-Version: 1.0\n"
13"Content-Type: text/plain; charset=UTF-8\n"
14"Content-Transfer-Encoding: \n"
15"Plural-Forms: \n"
16
17#. module: project_followers_rule
18#: model:ir.model,name:project_followers_rule.model_project_project
19msgid "Project"
20msgstr ""
21
022
=== added directory 'project_followers_rule/model'
=== added file 'project_followers_rule/model/__init__.py'
--- project_followers_rule/model/__init__.py 1970-01-01 00:00:00 +0000
+++ project_followers_rule/model/__init__.py 2014-05-16 23:29:47 +0000
@@ -0,0 +1,28 @@
1# -*- encoding: utf-8 -*-
2#
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8#
9# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
10#
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25#
26
27import project
28
029
=== added file 'project_followers_rule/model/project.py'
--- project_followers_rule/model/project.py 1970-01-01 00:00:00 +0000
+++ project_followers_rule/model/project.py 2014-05-16 23:29:47 +0000
@@ -0,0 +1,56 @@
1# -*- encoding: utf-8 -*-
2#
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8#
9# Coded by: Luis Ernesto García Medina (ernesto_gm@vauxoo.com)
10#
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25
26from openerp.osv import osv, fields
27
28
29class project(osv.Model):
30 _inherit = 'project.project'
31
32 def _get_followers(self, cr, uid, ids, field_name, arg, context=None):
33 result = {}
34 for project in self.browse(cr, uid, ids, context=context):
35 task_ids = self.pool.get('project.task').search(
36 cr, uid, [('project_id', '=', project.id)])
37 for task in self.pool.get('project.task').browse(cr, uid, task_ids):
38 if task.message_follower_ids:
39 result[project.id] = [
40 follower.id for follower in task.message_follower_ids]
41 return result
42
43 def _search_project(self, cr, uid, obj, name, args, context):
44 for cond in args:
45 partner_ids = cond[2]
46 task_ids = self.pool.get('project.task').search(
47 cr, uid, [('message_follower_ids', 'in', partner_ids),
48 ('project_id.privacy_visibility', '=', 'followers')])
49 project_ids = set(task.project_id.id for task in self.pool.get(
50 'project.task').browse(cr, uid, task_ids))
51 return [('id', 'in', tuple(project_ids))]
52 _columns = {
53 'followers_tasks_ids': fields.function(_get_followers, type='many2many',
54 relation="res.partner", string="Followers Task", method=True, store=False,
55 fnct_search=_search_project),
56 }
057
=== added directory 'project_followers_rule/view'
=== added file 'project_followers_rule/view/project_project_view.xml'
--- project_followers_rule/view/project_project_view.xml 1970-01-01 00:00:00 +0000
+++ project_followers_rule/view/project_project_view.xml 2014-05-16 23:29:47 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="project_project_form_follow_taks">
5 <field name="name">project.project.form.follow_taks</field>
6 <field name="model">project.project</field>
7 <field name="inherit_id" ref="project.edit_project"/>
8 <field name="arch" type="xml">
9 <xpath expr="//field[@name='partner_id']" position="after">
10 <field name="followers_tasks_ids" invisible='True'/>
11 </xpath>
12 </field>
13 </record>
14 </data>
15</openerp>