[ADD] Add a icon for remove pictures from product and partner
authorMehul Mehta <mme@openerp.com>
Wed, 21 May 2014 11:34:39 +0000 (17:04 +0530)
committerThibault Delavallée <tde@openerp.com>
Fri, 20 Jun 2014 10:52:24 +0000 (12:52 +0200)
addons/web/static/src/css/base.css
addons/web/static/src/css/base.sass
addons/web/static/src/js/view_form.js
addons/web/static/src/xml/base.xml

index 13626fb..b97a5ba 100644 (file)
 .openerp .oe_form .oe_form_field_image .oe_form_field_image_controls {
   position: absolute;
   top: 1px;
-  padding: 4px 0;
+  padding: 6px 0;
   width: 100%;
   display: none;
   text-align: center;
index abeed36..dce3401 100644 (file)
@@ -1902,7 +1902,7 @@ $sheet-padding: 16px
             .oe_form_field_image_controls
                 position: absolute
                 top: 1px
-                padding: 4px 0
+                padding: 6px 0
                 width: 100%
                 display: none
                 text-align: center
index cb0b2e8..3f46c73 100644 (file)
@@ -5506,9 +5506,13 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance.
         this._super.apply(this, arguments);
     },
     initialize_content: function() {
+        var self= this;
         this.$el.find('input.oe_form_binary_file').change(this.on_file_change);
         this.$el.find('button.oe_form_binary_file_save').click(this.on_save_as);
         this.$el.find('.oe_form_binary_file_clear').click(this.on_clear);
+        this.$el.find('.oe_form_binary_file_edit').click(function(event){
+            self.$el.find('input.oe_form_binary_file').click();
+        });
     },
     on_file_change: function(e) {
         var self = this;
@@ -5676,8 +5680,6 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
                 return;
             $img.css("max-width", "" + self.options.size[0] + "px");
             $img.css("max-height", "" + self.options.size[1] + "px");
-            $img.css("margin-left", "" + (self.options.size[0] - $img.width()) / 2 + "px");
-            $img.css("margin-top", "" + (self.options.size[1] - $img.height()) / 2 + "px");
         });
         $img.on('error', function() {
             $img.attr('src', self.placeholder);
index fb2fcbf..69af5cb 100644 (file)
 <t t-name="FieldBinaryImage">
     <span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">
         <div class="oe_form_field_image_controls oe_edit_only">
-            <t t-call="HiddenInputFile">
-                <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
-                Edit 
-            </t>
+            <i class="fa fa-pencil fa-1g pull-left col-md-offset-1 oe_form_binary_file_edit" title="Edit"/>
+            <i class="fa fa-trash-o fa-1g col-md-offset-5 oe_form_binary_file_clear" title="Clear"/>
             <div class="oe_form_binary_progress" style="display: none">
                 <img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
                 <b>Uploading ...</b>
             </div>
         </div>
+        <t t-call="HiddenInputFile">
+            <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
+        </t>
     </span>
 </t>
 <t t-name="FieldBinaryImage-img">