[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',
'website': 'http://www.openerp.com',
'depends': ['knowledge'],
'depends': ['knowledge', 'mail'],
'data': [
'security/document_security.xml',
'document_view.xml',

View File

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

View File

@ -89,5 +89,33 @@
<!-- Add menu entry in Settings/Email -->
<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>
</openerp>
</openerp>

View File

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

View File

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