diff --git a/project_code_in_task/__init__.py b/project_code_in_task/__init__.py new file mode 100644 index 000000000..10c19e3da --- /dev/null +++ b/project_code_in_task/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import models + diff --git a/project_code_in_task/__openerp__.py b/project_code_in_task/__openerp__.py new file mode 100644 index 000000000..bf4a82a06 --- /dev/null +++ b/project_code_in_task/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Project Code In Task', + 'version': '9.0.1.0.0', + 'summary': """Task Name With Respect To Project Code""", + 'description': 'This module helps you to update task with respect to project code', + 'category': 'Project Management', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'project'], + 'data': [ + 'views/project_code_view.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/project_code_in_task/models/__init__.py b/project_code_in_task/models/__init__.py new file mode 100644 index 000000000..ba4c6dc9a --- /dev/null +++ b/project_code_in_task/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +import project_code + diff --git a/project_code_in_task/models/project_code.py b/project_code_in_task/models/project_code.py new file mode 100644 index 000000000..f787f6662 --- /dev/null +++ b/project_code_in_task/models/project_code.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from openerp import models, fields, api, _ + + +class ProjectCode(models.Model): + _inherit = 'project.project' + + project_code = fields.Char(string='Project Code', required=True) + + +class ProjectCodeTask(models.Model): + _inherit = 'project.task' + + @api.model + def create(self, vals): + if vals['project_id']: + obj = self.env['project.project'].browse(vals['project_id']) + vals['name'] = obj.project_code + '/' + vals['name'] + return super(ProjectCodeTask, self).create(vals) + + @api.multi + def write(self, vals): + if vals.get('project_id'): + obj = self.env['project.project'].browse(vals.get('project_id')) + if obj.project_code: + if vals.get('name'): + vals['name'] = obj.project_code + '/' + vals['name'] + else: + vals['name'] = obj.project_code + '/' + self.name + else: + if not vals.get('name'): + if '/' in self.name: + s = self.name.index('/') + s += 1 + vals['name'] = self.name[s:] + elif vals.get('name'): + vals['name'] = self.project_id.project_code + '/' + vals['name'] + return super(ProjectCodeTask, self).write(vals) diff --git a/project_code_in_task/static/description/banner.jpg b/project_code_in_task/static/description/banner.jpg new file mode 100644 index 000000000..94600fa01 Binary files /dev/null and b/project_code_in_task/static/description/banner.jpg differ diff --git a/project_code_in_task/static/description/cybro_logo.png b/project_code_in_task/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/project_code_in_task/static/description/cybro_logo.png differ diff --git a/project_code_in_task/static/description/icon.png b/project_code_in_task/static/description/icon.png new file mode 100644 index 000000000..c9635faa9 Binary files /dev/null and b/project_code_in_task/static/description/icon.png differ diff --git a/project_code_in_task/static/description/index.html b/project_code_in_task/static/description/index.html new file mode 100644 index 000000000..89cc9f5e8 --- /dev/null +++ b/project_code_in_task/static/description/index.html @@ -0,0 +1,77 @@ +
+
+

Project Code In Task

+

Task Name With Project Code

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

+
    +
  •    Create specific code for project.
  • +
  •    Update task name with project code.
  • +
+
+
+
+ +
+
+

Create specific code for project

+
+
+
+ +
+
+
+

+ Here you can create specific code for each project +

+
+
+
+
+ +
+
+

Task Name

+
+
+
+ +
+
+
+

+

Project ---> Search ---> Tasks

+

Task name updating with project code.

+

+
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/project_code_in_task/static/description/project.png b/project_code_in_task/static/description/project.png new file mode 100644 index 000000000..c04d3e8e5 Binary files /dev/null and b/project_code_in_task/static/description/project.png differ diff --git a/project_code_in_task/static/description/taskk.png b/project_code_in_task/static/description/taskk.png new file mode 100644 index 000000000..46f33e73d Binary files /dev/null and b/project_code_in_task/static/description/taskk.png differ diff --git a/project_code_in_task/views/project_code_view.xml b/project_code_in_task/views/project_code_view.xml new file mode 100644 index 000000000..4f22ce210 --- /dev/null +++ b/project_code_in_task/views/project_code_view.xml @@ -0,0 +1,15 @@ + + + + + Project Code Form + project.project + + + + + + + + + \ No newline at end of file