@ -0,0 +1,54 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Project And Task Attachments |
||||
|
============================ |
||||
|
This module helps to view all documents attached to Projects and Tasks. |
||||
|
|
||||
|
Features |
||||
|
======== |
||||
|
* Project and Task Documents are available under separate menus in Project module. |
||||
|
* New files can be directly attached to Projects and Tasks from the new Documents menu |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
Nothing to configure. |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Affero General Public License, v3.0 (AGPL v3). |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers: (V16) Unnimaya C O, |
||||
|
(V17) Farhana Jahan PT, |
||||
|
(V18) Farook Al Ameen |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import models |
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
{ |
||||
|
'name': "Project And Task Attachments", |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Project', |
||||
|
'summary': 'Helps to view all documents attached to Projects/Tasks', |
||||
|
'description': """Project and Task Attachments module allows user to view |
||||
|
all the documents attached to projects and tasks. There is a separate |
||||
|
menu for viewing project documents and task documents. It is also |
||||
|
possible to attach new documents to project/task from the Documents menu.""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['base', 'project'], |
||||
|
'data': [ |
||||
|
'views/ir_attachment_views.xml' |
||||
|
], |
||||
|
'images': ['static/description/banner.png'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
## Module <project_task_attachments> |
||||
|
#### 15.02.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Project And Task Attachments |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import ir_attachment |
@ -0,0 +1,62 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class IrAttachment(models.Model): |
||||
|
"""Inherit IR attachment for adding extra fields and inheriting create |
||||
|
function """ |
||||
|
_inherit = 'ir.attachment' |
||||
|
|
||||
|
attach_to = fields.Selection([('project', 'Project'), |
||||
|
('task', 'Task')], |
||||
|
required=True, string="Attach To", |
||||
|
help="if Project, file attached to Project." |
||||
|
" Otherwise to task.", default='project') |
||||
|
project_id = fields.Many2one('project.project', |
||||
|
string='Project', |
||||
|
help="This indicates the Project", |
||||
|
readonly="True") |
||||
|
task_id = fields.Many2one('project.task', |
||||
|
string='Task', help="This indicates the Task", |
||||
|
readonly="True") |
||||
|
|
||||
|
@api.model_create_multi |
||||
|
def create(self, vals_list): |
||||
|
"""Supering the create function inorder to add the project and task |
||||
|
corresponding to the attachment""" |
||||
|
for vals in vals_list: |
||||
|
if 'project_id' in vals.keys() and not vals['task_id']: |
||||
|
vals['res_id'] = vals['project_id'] |
||||
|
vals['res_model'] = 'project.project' |
||||
|
elif 'project_id' in vals.keys() and vals['task_id']: |
||||
|
vals['res_id'] = vals['task_id'] |
||||
|
vals['res_model'] = 'project.task' |
||||
|
elif ('project_id' not in vals.keys() and vals['res_model'] == |
||||
|
'project.project'): |
||||
|
vals['project_id'] = vals['res_id'] |
||||
|
vals['attach_to'] = 'project' |
||||
|
elif 'task_id' not in vals.keys() and vals[ |
||||
|
'res_model'] == 'project.task': |
||||
|
vals['task_id'] = vals['res_id'] |
||||
|
vals['attach_to'] = 'task' |
||||
|
return super().create(vals_list) |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,159 @@ |
|||||
|
<?xml version = "1.0" encoding = "UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Inherit Ir Attachment form view to include extra fields--> |
||||
|
<record id="view_attachment_form" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
ir.attachment.view.form.inherit.project.task.attachments |
||||
|
</field> |
||||
|
<field name="model">ir.attachment</field> |
||||
|
<field name="inherit_id" ref="base.view_attachment_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//form" position="replace"> |
||||
|
<form create="false" edit="false"> |
||||
|
<sheet> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="attach_to" invisible="1"/> |
||||
|
<field name="project_id" |
||||
|
invisible="attach_to == 'task'"/> |
||||
|
<field name="task_id" |
||||
|
invisible="attach_to == 'project'"/> |
||||
|
<field name="type"/> |
||||
|
<field name="datas" filename="name" |
||||
|
string="File" |
||||
|
invisible="type == 'url'"/> |
||||
|
<field name="url" widget="url" |
||||
|
invisible="type == 'binary'"/> |
||||
|
</group> |
||||
|
<group name="description_group" string="Description" |
||||
|
groups="base.group_no_one" colspan="4"> |
||||
|
<field name="description" nolabel="1" |
||||
|
colspan="2"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Inherit Ir Attachment list view to include extra fields--> |
||||
|
<record id="view_attachment_tree" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
ir.attachment.view.list.inherit.project.task.attachments |
||||
|
</field> |
||||
|
<field name="model">ir.attachment</field> |
||||
|
<field name="inherit_id" ref="base.view_attachment_tree"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//list" position="replace"> |
||||
|
<list string="Attachments" create="false"> |
||||
|
<field name="name"/> |
||||
|
<field name="type"/> |
||||
|
<field name="file_size"/> |
||||
|
<field name="company_id" groups="base.group_multi_company"/> |
||||
|
<field name="create_uid"/> |
||||
|
<field name="create_date"/> |
||||
|
</list> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Inherit Ir Attachment list view to include extra fields--> |
||||
|
<record id="view_document_file_kanban" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
ir.attachment.view.kanban.inherit.project.task.attachments |
||||
|
</field> |
||||
|
<field name="model">ir.attachment</field> |
||||
|
<field name="inherit_id" ref="mail.view_document_file_kanban"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//kanban" position="replace"> |
||||
|
<kanban edit="false" import="false" create="false"> |
||||
|
<field name="id"/> |
||||
|
<field name="mimetype"/> |
||||
|
<field name="type"/> |
||||
|
<field name="create_uid"/> |
||||
|
<field name="url"/> |
||||
|
<field name="create_date"/> |
||||
|
<field name="name"/> |
||||
|
<templates> |
||||
|
<t t-name="kanban-menu"> |
||||
|
<a t-attf-href="/web/content/ir.attachment/#{record.id.raw_value}/datas?download=true" download="" class="dropdown-item">Download</a> |
||||
|
<a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a> |
||||
|
</t> |
||||
|
<t t-name="kanban-box"> |
||||
|
<div class="oe_kanban_global_area oe_kanban_global_click o_kanban_attachment"> |
||||
|
<div class="o_kanban_image"> |
||||
|
<div class="o_kanban_image_wrapper"> |
||||
|
<t t-set="webimage" t-value="new RegExp('image.*(gif|jpeg|jpg|png|webp)').test(record.mimetype.value)"/> |
||||
|
<div t-if="record.type.raw_value == 'url'" class="o_url_image fa fa-link fa-3x text-muted" aria-label="Image is a link"/> |
||||
|
<img t-elif="webimage" t-attf-src="/web/image/#{record.id.raw_value}" width="100" height="100" alt="Document" class="o_attachment_image"/> |
||||
|
<div t-else="!webimage" class="o_image o_image_thumbnail" t-att-data-mimetype="record.mimetype.value"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="o_kanban_details"> |
||||
|
<div class="o_kanban_details_wrapper"> |
||||
|
<div t-att-title="record.name.raw_value" class="o_kanban_record_title"> |
||||
|
<field name="name" class="o_text_overflow"/> |
||||
|
</div> |
||||
|
<div class="o_kanban_record_body"> |
||||
|
<t t-if="record.type.raw_value == 'url'"> |
||||
|
<span class="o_document_url"><i class="fa fa-globe" aria-label="Document url"/> <field name="url" widget="url"/></span> |
||||
|
</t> |
||||
|
<samp t-else="" class="text-muted"> </samp> |
||||
|
</div> |
||||
|
<div class="o_kanban_record_bottom"> |
||||
|
<time class="oe_kanban_bottom_left"> |
||||
|
<field name="create_date" widget="date"/> |
||||
|
</time> |
||||
|
<div class="oe_kanban_bottom_right"> |
||||
|
<field name="create_uid" widget="many2one_avatar_user"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</templates> |
||||
|
</kanban> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Project Documents menu action --> |
||||
|
<record id="ir_attachment_action_view_task_documents" |
||||
|
model="ir.actions.act_window"> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="name">Task Documents</field> |
||||
|
<field name="res_model">ir.attachment</field> |
||||
|
<field name="view_mode">kanban,list,form</field> |
||||
|
<field name="context">{'default_attach_to': 'task','default_res_model': |
||||
|
'project.task'} |
||||
|
</field> |
||||
|
<field name="domain">[('res_model', '=', 'project.task')]</field> |
||||
|
</record> |
||||
|
<!-- Task Documents Menu Action --> |
||||
|
<record id="ir_attachment_action_view_project_documents" |
||||
|
model="ir.actions.act_window"> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="name">Project Documents</field> |
||||
|
<field name="res_model">ir.attachment</field> |
||||
|
<field name="context">{'default_attach_to': |
||||
|
'project','default_res_model': 'project.project'} |
||||
|
</field> |
||||
|
<field name="view_mode">kanban,list,form</field> |
||||
|
<field name="domain">[('res_model', '=', 'project.project')]</field> |
||||
|
</record> |
||||
|
<!-- Documents Menu --> |
||||
|
<menuitem id="ir_attachment_menu" name="Documents" |
||||
|
parent="project.menu_main_pm"/> |
||||
|
<!-- Project Documents Menu --> |
||||
|
<menuitem id="ir_attachment_menu_view_project_documents" |
||||
|
name="Project Documents" |
||||
|
parent="ir_attachment_menu" |
||||
|
action="ir_attachment_action_view_project_documents"/> |
||||
|
<!-- Task Documents Menu --> |
||||
|
<menuitem id="ir_attachment_menu_view_task_documents" |
||||
|
name="Task Documents" |
||||
|
parent="ir_attachment_menu" |
||||
|
action="ir_attachment_action_view_task_documents"/> |
||||
|
</odoo> |