Victor Tabuenca (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-improve_m2obutton-vta into lp:openerp-web.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-improve_m2obutton-vta/+merge/140920
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-improve_m2obutton-vta/+merge/140920
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-improve_m2obutton-vta.
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-12-20 14:49:22 +0000
+++ addons/web/static/src/css/base.css	2012-12-20 15:03:18 +0000
@@ -485,7 +485,7 @@
   box-shadow: none;
 }
 .openerp .oe_button.oe_link img {
-  display: none;
+  display: inline-block;
 }
 .openerp .oe_button.oe_link span {
   border: none;

=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass	2012-12-20 14:49:22 +0000
+++ addons/web/static/src/css/base.sass	2012-12-20 15:03:18 +0000
@@ -439,7 +439,7 @@
     .oe_button.oe_link
         @include reset()
         img
-            display: none
+            display: inline-block
         span
             @include reset()
             color: $link-color

=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-12-19 15:12:17 +0000
+++ addons/web/static/src/js/view_form.js	2012-12-20 15:03:18 +0000
@@ -3280,17 +3280,10 @@
         if (this.$button) {
             this.$button.remove();
         }
-        var options = {};
-        try {
-            options = py.eval(this.node.attrs.options);
-        } catch (e) {}
-        if (options.label) {
-            this.string = this.get('value') ? _t(options.label.edit) : _t(options.label.create);
-        } else {
-            this.string = '';
-        }
+        this.string = '';
         this.node.attrs.icon = this.get('value') ? '/web/static/src/img/icons/gtk-yes.png' : '/web/static/src/img/icons/gtk-no.png';
         this.$button = $(QWeb.render('WidgetButton', {'widget': this}));
+        this.$button.addClass('oe_link').css({'padding':'4px'});
         this.$el.append(this.$button);
         this.$button.on('click', self.on_click);
     },

=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js	2012-12-19 15:12:17 +0000
+++ addons/web/static/src/js/view_list.js	2012-12-20 15:03:18 +0000
@@ -2244,7 +2244,12 @@
 instance.web.list.Many2OneButton = instance.web.list.Column.extend({
     _format: function (row_data, options) {
         this.has_value = !!row_data[this.id].value;
-        return QWeb.render('Many2OneButton.cell', {'widget': this});
+        this.icon = this.has_value ? 'gtk-yes' : 'gtk-no';
+        this.string = this.has_value ? _t('View') : _t('Create');
+        return QWeb.render('Many2OneButton.cell', {
+            'widget': this,
+            'prefix': instance.session.prefix,
+        });
     },
 });
 instance.web.list.Many2Many = instance.web.list.Column.extend({

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-12-19 15:45:05 +0000
+++ addons/web/static/src/xml/base.xml	2012-12-20 15:03:18 +0000
@@ -780,7 +780,7 @@
         t-att-title="widget.string" t-att-disabled="disabled || undefined"
         t-att-class="disabled ? 'oe_list_button_disabled' : undefined"
     ><img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png"
-         t-att-alt="widget.string" /></button>
+         t-att-alt="widget.string"/></button>
 <t t-extend="ListView.row">
     <!-- adds back padding to row being rendered after edition, if necessary
          (if not deletable add back padding), otherwise the row being added is
@@ -1111,7 +1111,7 @@
     </span>
 </t>
 <t t-name="Many2OneButton.cell"
-    ><img t-attf-src="#{_s}/web/static/src/img/icons/gtk-#{widget.has_value ? 'yes' : 'no'}.png" width="16" height="16"/>
+    ><img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png" t-att-alt="widget.string" width="16" height="16"/>
 </t>
 <t t-name="FieldMany2ManyTags">
     <div class="oe_form_field oe_tags" t-att-style="widget.node.attrs.style">

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to