Vishmita Jadeja (openerp) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-radiobutton-vja into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-radiobutton-vja/+merge/104249

Hello,

    In search more popup,put radio button in listview instead of edit image for 
select.

Thanks,
vja 
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-radiobutton-vja/+merge/104249
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-radiobutton-vja.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-04-26 15:28:00 +0000
+++ addons/web/static/src/js/view_form.js	2012-05-01 13:38:23 +0000
@@ -2539,7 +2539,15 @@
             self.build_domain(),
             new instance.web.CompoundContext(self.build_context(), context || {})
         );
-        pop.on_select_elements.add(function(element_ids) {
+        if (view == 'search') {
+                $('<button type="button" class="oe-select" disabled="disabled">Select</button><button type="button" class="oe-close">Cancel</button>').appendTo($(".oe-select-create-popup-view-list"))
+        }
+        pop.$element.find('.oe-close').bind('click', function(){
+                 self.set({value: false});
+                 pop.check_exit()})
+        pop.on_select_elements.add_last(function(element_ids){
+            pop.$element.find('[data-id=' + element_ids[0] + '] input:radio').prop('checked', true);
+            pop.$element.find('.oe-select').removeAttr('disabled');
             self.set({value: element_ids[0]});
         });
     },
@@ -3261,7 +3269,8 @@
             self.view_list = new instance.web.form.SelectCreateListView(self,
                     self.dataset, false,
                     _.extend({'deletable': false,
-                        'selectable': !self.options.disable_multiple_selection
+                        'selectable': !self.options.disable_multiple_selection,
+                        'radiobutton':true
                     }, self.options.list_view_options || {}));
             self.view_list.popup = self;
             self.view_list.appendTo($(".oe-select-create-popup-view-list", self.$element)).pipe(function() {
@@ -3376,8 +3385,15 @@
         this.popup.new_object();
     },
     select_record: function(index) {
-        this.popup.on_select_elements([this.dataset.ids[index]]);
-        this.popup.destroy();
+        var self = this;
+        this.popup.on_select_elements([self.dataset.ids[index]]);
+        if (this.options.selectable == true) {
+            self.popup.destroy();}
+        else {
+            this.popup.$element.find('.oe-select').click(function(){
+                self.popup.destroy();
+            });
+        }
     },
     do_select: function(ids, records) {
         this._super(ids, records);

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-04-25 08:38:42 +0000
+++ addons/web/static/src/xml/base.xml	2012-05-01 13:38:23 +0000
@@ -682,7 +682,8 @@
         <input t-if="!options.radio" type="checkbox" name="radiogroup" t-att-checked="checked"/>
     </th>
     <th t-if="options.isClarkGable" class="oe-record-edit-link" width="1">
-        <img src="/web/static/src/img/pencil.gif" width="12" height="12" class="oe-record-edit-link-img"/>
+        <input t-if="options.radiobutton and !options.selectable" type="radio" name="radiogroup" t-att-checked="checked"/>
+        <img t-if="!options.radiobutton || options.selectable" src="/web/static/src/img/pencil.gif" width="12" height="12" class="oe-record-edit-link-img"/>
     </th>
     <t t-foreach="columns" t-as="column">
         <t t-set="align" t-value="column.type === 'integer' or column.type == 'float'"/>
@@ -1497,7 +1498,8 @@
             </tr>
             <tr style="width:100%">
                 <td style="width:100%">
-                    <div class="oe-select-create-popup-view-list" style="width:100%"></div>
+                    <div class="oe-select-create-popup-view-list" style="width:100%">
+                    </div>
                 </td>
             </tr>
         </table>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to