Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>knowledge_Fork_Me</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
5 changes: 5 additions & 0 deletions .pydevproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>
14 changes: 10 additions & 4 deletions document_choose_directory/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@
"license": "AGPL-3",
"complexity": "normal",
"category": "Knowledge",
'description': """

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add description key. There's already a README.rst for that

The Technical module name is changed
document to document_document
==============================================

""",
"depends": [
'document',
'document_document',
'web',
],
"data": [
"view/qweb.xml",
"view/document_directory.xml",
"view/document_directory.xml","view/attachement_view.xml"
],
"js": [
'static/src/js/document_choose_directory.js',
Expand All @@ -46,8 +52,8 @@
"test": [
],
"auto_install": False,
'installable': False,
"application": False,
'installable': True,
"application": True,
"external_dependencies": {
'python': [],
},
Expand Down
1 change: 1 addition & 0 deletions document_choose_directory/controllers/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class Binary(Binary):
@http.route('/web/binary/upload_attachment', type='http', auth="user")
def upload_attachment(self, callback, model, id, ufile, directory_id=None):

if directory_id:
# we can't use default_parent_id because of
# the ir_attachment.create overwrite in document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
}
li.oe_attachment_directory
{
font-weight: bold;

font-weight : bolder;
font-size: large;
background-color: #CCC;

}
.openerp .oe_dropdown_menu > li.oe_attachment_directory:hover
{
Expand All @@ -30,3 +34,40 @@ li.oe_attachment_directory
{
cursor: default !important;
}

.openerp .oe_hidden_input_file input.o_form_input_file {
z-index: 0;
line-height: 0;
font-size: 12px;
position: initial;
top: 1px;
left: 0;
right: 0;
opacity: 0;
filter: alpha(opacity=0);
-ms-filter: "alpha(opacity=0)";
margin: 0;
padding: 0;
}

/* .openerp input, .openerp textarea, .openerp select {
padding: 2px 4px;
border: 1px solid #ccc;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background: white;
width: 100%;
} */


.fa-trash-o {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin-right: -5px;
color: #2196F3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,28 @@ openerp.document_choose_directory = function(instance)
attachments_per_directory = [];
_.chain(attachments)
.groupBy(
function(a) { return a.parent_id[0] })
function(a) {

return a.parent_id[0] })
.sortBy(function(attachments) {


return attachments[0].parent_id[1];
})
.each(
function(group)
{

{
attachments_per_directory.push({
name: _.first(group).parent_id[1] ||
instance.web._t('No directory'),
classname: 'oe_attachment_directory',
name: _.first(group).parent_id[1] ||instance.web._t('No directory'),classname: 'oe_attachment_directory',
});


self.sort_attachments(group).each(function(a)
{

{
attachments_per_directory.push(a);
console.log(attachments_per_directory);
});
});

Expand All @@ -85,7 +92,7 @@ openerp.document_choose_directory = function(instance)
});
},
sort_attachments: function(attachments)
{
{
return _.chain(attachments).sortBy('name');
},
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-extend="Sidebar">
<t t-jquery=".oe_sidebar_add_attachment span" t-operation="before">
<t t-jquery=".oe_sidebar_add_attachment span" t-operation="before">

<select name="directory_id">
<option value="" selected="selected">Choose directory</option>
<option t-foreach="widget.directory_candidates" t-as="directory" t-att-value="directory.id">
<t t-esc="directory.name" />
</option>
</select>

</t>
<t t-jquery=".oe_sidebar_delete_item">
<t t-jquery=".oe_sidebar_delete_item">
this.attr('t-if', "section.name == 'files' and !item.callback and item.classname != 'oe_attachment_directory'");
</t>
<t t-jquery="button.oe_dropdown_toggle t[t-if]">
<t t-jquery="button.btn t[t-if]">
this.attr('t-raw', "(widget.items[section.name].length - widget.get_directory_items(widget.items[section.name]).length) || ''");
</t>
</t>
</templates>



29 changes: 29 additions & 0 deletions document_choose_directory/view/attachement_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>



<!-- <record id="action_attachment" model="ir.actions.act_window"> <field
name="name">Attachments</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field> <field name="view_type">form</field>
<field name="view_id" eval="False"/> <field name="search_view_id" ref="view_attachment_search"/>
<field name="help" type="html"> <p class="oe_view_nocontent_create"> Click
here to create new documents. </p> <p> Also you will find here all the related
documents and download it by clicking on any individual document. </p> </field>
</record> -->



<menuitem name="Attachment Management"
parent ="knowledge.menu_document" id="menu_action_attachment_management_inherits" />
<menuitem name="Attachment" action="base.action_attachment"
parent ="menu_action_attachment_management_inherits" id="menu_action_attachment_inherits" />






</data>
</openerp>
8 changes: 4 additions & 4 deletions document_choose_directory/view/document_directory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<data>
<record id="view_document_directory_form" model="ir.ui.view">
<field name="model">document.directory</field>
<field name="inherit_id" ref="document.view_document_directory_form" />
<field name="inherit_id" ref="document_document.view_document_directory_form" />
<field name="arch" type="xml">
<xpath expr="//page[@string='Definition']/group[2]" position="attributes">
<xpath expr="//page[@name='definition']/group[2]" position="attributes">
<attribute name="attrs" />
</xpath>
<xpath expr="//page[@string='Definition']/group[2]/field[@name='resource_field']" position="attributes">
<xpath expr="//page[@name='definition']/group[2]/field[@name='resource_field']" position="attributes">
<attribute name="attrs">{'invisible': [('type', '!=', 'ressource')]}</attribute>
</xpath>
<xpath expr="//page[@string='Definition']/group[2]/field[@name='ressource_tree']" position="attributes">
<xpath expr="//page[@name='definition']/group[2]/field[@name='ressource_tree']" position="attributes">
<attribute name="attrs">{'invisible': [('type', '!=', 'ressource')]}</attribute>
</xpath>
</field>
Expand Down
28 changes: 28 additions & 0 deletions document_document/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
#
##############################################################################

import content_index
import std_index
import document
import report
import wizard

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
56 changes: 56 additions & 0 deletions document_document/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
#
##############################################################################


{
'name': 'Document Management System',
'version': '2.1',
'category': 'Knowledge Management',
'description': """
This is a complete document management system.
==============================================
* User Authentication
* Document Indexation:- .pptx and .docx files are not supported in Windows platform.
* Dashboard for Document that includes:
* New Files (list)
* Files by Resource Type (graph)
* Files by Partner (graph)
* Files Size by Month (graph)
""",
'author': 'OpenERP SA',
'website': 'https://www.odoo.com',
'depends': ['knowledge', 'mail'],
'data': [
'security/document_security.xml',
'document_view.xml',
'document_data.xml',
'wizard/document_configuration_view.xml',
'security/ir.model.access.csv',
'report/document_report_view.xml',
'views/document.xml',
],
'demo': [ 'document_demo.xml' ],
'test': ['test/document_test2.yml'],
'installable': True,
'auto_install': False,
}

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Loading