[IMP] kanban view for ir.attachments

bzr revid: fp@tinyerp.com-20140401164322-fq3r0pt6idkoobxx
This commit is contained in:
Fabien Pinckaers 2014-04-01 18:43:22 +02:00
parent 07ae370d90
commit 0b539587b8
5 changed files with 41 additions and 13 deletions

View File

@ -37,7 +37,7 @@ This is a complete document management system.
""", """,
'author': 'OpenERP SA', 'author': 'OpenERP SA',
'website': 'http://www.openerp.com', 'website': 'http://www.openerp.com',
'depends': ['knowledge'], 'depends': ['knowledge', 'mail'],
'data': [ 'data': [
'security/document_security.xml', 'security/document_security.xml',
'document_view.xml', 'document_view.xml',

View File

@ -235,7 +235,6 @@
<field name="partner_id"/> <field name="partner_id"/>
<field name="type"/> <field name="type"/>
</tree> </tree>
</field> </field>
</record> </record>
@ -244,6 +243,7 @@
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field> <field name="res_model">ir.attachment</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">kanban,form</field>
<field name="help" type="html"> <field name="help" type="html">
<p class="oe_view_nocontent_create"> <p class="oe_view_nocontent_create">
Click to create a new document. Click to create a new document.

View File

@ -89,5 +89,33 @@
<!-- Add menu entry in Settings/Email --> <!-- Add menu entry in Settings/Email -->
<menuitem name="Messages" id="menu_mail_message" parent="base.menu_email" action="action_view_mail_message"/> <menuitem name="Messages" id="menu_mail_message" parent="base.menu_email" action="action_view_mail_message"/>
<record model="ir.ui.view" id="view_document_file_kanban">
<field name="name">ir.attachment kanban</field>
<field name="model">ir.attachment</field>
<field name="arch" type="xml">
<kanban>
<field name="file_type_icon"/>
<field name="url"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div t-attf-class="oe_attachment" t-if="record.file_type_icon.value != 'webimage'">
<img t-att-src="'/mail/static/src/img/mimetypes/' + record.file_type_icon.value + '.png'"></img>
<div class='oe_name'><t t-raw='record.name.value' />bb</div>
</div>
<div t-attf-class="oe_attachment oe_preview" t-if="record.file_type_icon.value == 'webimage'">
<img t-att-src="kanban_image('ir.attachment', 'datas', record.id.value)" class="oe_kanban_image"/>
<div class='oe_name'><t t-raw='record.name.value' />aa</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -318,7 +318,7 @@
.openerp .oe_mail .oe_msg_composer .oe_recipients input{ .openerp .oe_mail .oe_msg_composer .oe_recipients input{
vertical-align: middle; vertical-align: middle;
} }
.openerp .oe_mail .oe_attachment{ .oe_attachment{
display: inline-block; display: inline-block;
width: 100px; width: 100px;
margin: 4px 2px; margin: 4px 2px;
@ -328,7 +328,7 @@
text-align: center; text-align: center;
vertical-align: top; vertical-align: top;
} }
.openerp .oe_mail .oe_attachment .oe_name{ .oe_attachment .oe_name{
display: inline-block; display: inline-block;
max-width: 100%; max-width: 100%;
padding: 1px 3px; padding: 1px 3px;
@ -341,10 +341,10 @@
border-radius: 3px; border-radius: 3px;
} }
.openerp .oe_mail .oe_attachment.oe_preview{ .oe_attachment.oe_preview{
background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJ0lEQVQYV2MsLS39z4AGLCws0IUYGIeCwrVr12J45sSJE5ieGQIKAbuZKf/EMCs7AAAAAElFTkSuQmCC ); background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJ0lEQVQYV2MsLS39z4AGLCws0IUYGIeCwrVr12J45sSJE5ieGQIKAbuZKf/EMCs7AAAAAElFTkSuQmCC );
} }
.openerp .oe_mail .oe_attachment .oe_progress_bar{ .oe_attachment .oe_progress_bar{
display: none; display: none;
position: absolute; position: absolute;
top: 18px; top: 18px;
@ -364,7 +364,7 @@
-o-animation: oe_mail_attach_loading_anim 0.75s infinite linear; -o-animation: oe_mail_attach_loading_anim 0.75s infinite linear;
animation: oe_mail_attach_loading_anim 0.75s infinite linear; animation: oe_mail_attach_loading_anim 0.75s infinite linear;
} }
.openerp .oe_mail .oe_attachment.oe_uploading .oe_progress_bar{ .oe_attachment.oe_uploading .oe_progress_bar{
display: block; display: block;
} }
@-webkit-keyframes oe_mail_attach_loading_anim{ @-webkit-keyframes oe_mail_attach_loading_anim{
@ -387,7 +387,7 @@
50% { background: #009123 } 50% { background: #009123 }
100% { background: #4BBD00 } 100% { background: #4BBD00 }
} }
.openerp .oe_mail .oe_attachment.oe_preview .oe_name{ .oe_attachment.oe_preview .oe_name{
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
margin: 3px; margin: 3px;
@ -405,14 +405,14 @@
-o-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear; transition: opacity 0.2s linear;
} }
.openerp .oe_mail .oe_attachment.oe_preview:hover .oe_name{ .oe_attachment.oe_preview:hover .oe_name{
opacity: 1; opacity: 1;
-webkit-transition: opacity 0.2s linear; -webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear; -moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear; -o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear; transition: opacity 0.2s linear;
} }
.openerp .oe_mail .oe_attachment img{ .oe_attachment img{
position: absolute; position: absolute;
width: 48px; width: 48px;
height: 48px; height: 48px;
@ -420,7 +420,7 @@
left: 50%; left: 50%;
margin-left: -24px; margin-left: -24px;
} }
.openerp .oe_mail .oe_attachment.oe_preview img{ .oe_attachment.oe_preview img{
display: block; display: block;
position: relative; position: relative;
margin:0px; margin:0px;

View File

@ -223,7 +223,7 @@ class project(osv.osv):
'res_model': 'ir.attachment', 'res_model': 'ir.attachment',
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'view_id': False, 'view_id': False,
'view_mode': 'tree,form', 'view_mode': 'kanban,form',
'view_type': 'form', 'view_type': 'form',
'limit': 80, 'limit': 80,
'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id) 'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id)