Skip to content

Commit

Permalink
Merge pull request #502 from vimalpatelserpentcs/14.0-mig-project_team
Browse files Browse the repository at this point in the history
[14.0][MIG] Project Team
  • Loading branch information
JayVora-SerpentCS authored Sep 25, 2020
2 parents 365abe4 + 77669ce commit e6dca8f
Show file tree
Hide file tree
Showing 23 changed files with 678 additions and 0 deletions.
17 changes: 17 additions & 0 deletions project_team/LICENSE/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
OpenERP, Open Source Management Solution
Copyright (C) 2020-TODAY Serpent Consulting Services Pvt. Ltd.
(<http://www.serpentcs.com>).

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/>.

24 changes: 24 additions & 0 deletions project_team/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
==============
Project Team
==============

* This module is developed to set project team members.

* You can configure the project teams from 'Projects team' menu under configuration of projects.

* Once you select the relevant project team, you will get the associated team members automatically assigned to that project team.

Usage
=====

Bug Tracker
===========

Credits
=======

Contributors
------------

* Serpent Consulting Services Pvt. Ltd. <[email protected]>

3 changes: 3 additions & 0 deletions project_team/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See LICENSE file for full copyright and licensing details.

from . import models
23 changes: 23 additions & 0 deletions project_team/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See LICENSE file for full copyright and licensing details.

{
'name': 'Project - Set Team and members',
'author': 'Serpent Consulting Services Pvt. Ltd.',
'maintainer': 'Serpent Consulting Services Pvt. Ltd.',
'summary': 'Project Team Management',
'category': 'Project Management',
'website': 'http://www.serpentcs.com',
'version': '14.0.1.0.0',
'license': 'AGPL-3',
'depends': [
'project',
'crm',
],
'data': [
'views/project_team_view.xml',
],
'images': [
'static/description/ProjectTeam.png',
],
'installable': True,
}
4 changes: 4 additions & 0 deletions project_team/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See LICENSE file for full copyright and licensing details.

from . import project_team
from . import crm_team
15 changes: 15 additions & 0 deletions project_team/models/crm_team.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# See LICENSE file for full copyright and licensing details.

from odoo import fields, models


class CrmTeamInherit(models.Model):
_inherit = 'crm.team'

type_team = fields.Selection([('sale', 'Sale'), ('project', 'Project')],
"Type", default="sale")
team_members_ids = fields.Many2many('res.users', 'project_team_user_rel',
'team_id', 'user_id', 'Project Members',
help="""Project's members are users who
can have an access to the tasks related
to this project.""")
20 changes: 20 additions & 0 deletions project_team/models/project_team.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models


class ProjectProject(models.Model):
_inherit = 'project.project'

members_ids = fields.Many2many('res.users', 'project_user_rel', 'project_id',
'user_id', 'Project Members', help="""Project's
members are users who can have an access to
the tasks related to this project."""
)
team_id = fields.Many2one('crm.team', "Project Team",
domain=[('type_team', '=', 'project')])

@api.onchange('team_id')
def _get_team_members(self):
self.update({"members_ids": [(6, 0,
self.team_id.team_members_ids.ids)]})
Binary file added project_team/static/description/ProjectTeam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/images/fb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/images/in.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/images/insta.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
390 changes: 390 additions & 0 deletions project_team/static/description/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/serpent_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added project_team/static/description/team_new1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions project_team/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See LICENSE file for full copyright and licensing details.

from . import test_project_team
23 changes: 23 additions & 0 deletions project_team/tests/test_project_team.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See LICENSE file for full copyright and licensing details.

from odoo.tests import common


class ProjectProjectTestCase(common.TransactionCase):
def setup(self):
super(ProjectProjectTestCase, self).setup()

def test_project_action(self):
self.team = self.env.ref('base.user_root')
self.team1 = self.env.ref('base.user_demo')

self.team = self.env['crm.team'].sudo().create({
'name': 'Test Project Team',
'user_id': self.team.id,
'type_team': 'sale',
'team_members': [(6, 0, [self.team.id,
self.team1.id])]})
self.project = self.env['project.project'].create({
'name': 'Test Project',
'team_id': self.team.id})
self.project.get_team_members()
156 changes: 156 additions & 0 deletions project_team/views/project_team_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="sales_team.sales_team_config_action" model="ir.actions.act_window">
<field name="domain">[('type_team','=','sale')]</field>
<field name="context">{'default_type_team':'sale'}</field>
</record>

<record id="project_team_form_view" model="ir.ui.view">
<field name="name">crm.team.form</field>
<field name="model">crm.team</field>
<field name="arch" type="xml">
<form string="Project Team">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"
string="Project Team"/>
<h1>
<field name="name"/>
</h1>
<div name="options_active"/>
</div>
<group>
<group name="left">
<field name="user_id"
context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
<field name="type_team" invisible="1"/>
</group>
</group>
<notebook>
<page name="members" string="Team Members">
<field name="team_members_ids" widget="many2many">
<kanban quick_create="false" create="true" delete="true">
<field name="id"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click" style="max-width: 200px">
<div class="o_kanban_record_top">
<img t-att-src="kanban_image('res.users', 'image_1920', record.id.raw_value)" height="40" width="40" class="oe_avatar oe_kanban_avatar_smallbox mb0" alt="Avatar"/>
<div class="o_kanban_record_headings ml8">
<strong class="o_kanban_record_title"><field name="name"/></strong>
</div>
<a t-if="! read_only_mode" type="delete" class="text-danger">
<i class="fa fa-times" title="Delete"></i>
</a>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</page>
<page string="More Info" name="more_info"
groups="base.group_no_one">
<group>
<field name="active"/>
</group>
<group string="Company"
groups="base.group_multi_company">
<field name="company_id"
options="{'no_create': True}"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"
widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>

<record id="project_team_tree_view" model="ir.ui.view">
<field name="name">crm.team.tree</field>
<field name="model">crm.team</field>
<field name="arch" type="xml">
<tree string="Project Team">
<field name="name" string="Project Team"/>
<field name="user_id"/>
</tree>
</field>
</record>

<record id="project_team_action_tree" model="ir.actions.act_window">
<field name="name">Projects Team</field>
<field name="res_model">crm.team</field>
<field name="domain">[('type_team','=','project')]</field>
<field name="binding_view_types">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'default_type_team':'project'}</field>
<field name="view_id" ref="project_team_tree_view"/>
</record>

<record id="project_team_action_tree_view"
model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_id" ref="project_team_tree_view"/>
<field name="act_window_id" ref="project_team_action_tree"/>
</record>

<record id="project_team_action_form_view" model="ir.actions.act_window.view">
<field name="view_mode">form</field>
<field name="view_id" ref="project_team_form_view"/>
<field name="act_window_id" ref="project_team_action_tree"/>
</record>


<menuitem id="project_team_menu" action="project_team_action_tree"
parent="project.menu_project_config"/>

<record id="sales_team.crm_team_salesteams_act" model="ir.actions.act_window">
<field name="domain">[('type_team','=','sale')]</field>
</record>

<record id="project_project_inherit_form_view" model="ir.ui.view">
<field name="name">project.project.inherit.form.view</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<field name="allowed_portal_user_ids" position="after">
<field name="team_id"
context="{'form_view_ref': 'project_team.project_team_form_view', 'default_type_team':'project'}"/>
</field>
<page name="settings" position="after">
<page string="Team">
<field name="members_ids" widget="many2many"
context="{'form_view_ref': 'project_team.project_team_form_view', 'default_type_team':'project'}">
<kanban quick_create="false" create="true" delete="true">
<field name="id"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click" style="max-width: 200px">
<div class="o_kanban_record_top">
<img t-att-src="kanban_image('res.users', 'image_1920', record.id.raw_value)" height="40" width="40" class="oe_avatar oe_kanban_avatar_smallbox mb0" alt="Avatar"/>
<div class="o_kanban_record_headings ml8">
<strong class="o_kanban_record_title"><field name="name"/></strong>
</div>
<a t-if="! read_only_mode" type="delete" class="text-danger">
<i class="fa fa-times" title="Delete"></i>
</a>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</page>
</page>
</field>
</record>

</odoo>

0 comments on commit e6dca8f

Please sign in to comment.