[imp] replaced "new" button in search/create popup to use the one of the list

bzr revid: nicolas.vanhoren@openerp.com-20110615150658-zuudknekawtz8z1s
This commit is contained in:
niv-openerp 2011-06-15 17:06:58 +02:00
parent e39f52312b
commit ace804abb5
2 changed files with 3 additions and 5 deletions

View File

@ -1404,10 +1404,6 @@ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({
this.searchview.on_loaded.add_last(function () {
var $buttons = self.searchview.$element.find(".oe_search-view-buttons");
$buttons.append(QWeb.render("Many2XSelectPopup.search.buttons"));
var $nbutton = $buttons.find(".oe_many2xselectpopup-search-new");
$nbutton.click(function() {
self.new_object();
});
var $cbutton = $buttons.find(".oe_many2xselectpopup-search-close");
$cbutton.click(function() {
self.stop();
@ -1475,6 +1471,9 @@ openerp.base.form.Many2XSelectPopup = openerp.base.BaseWidget.extend({
});
openerp.base.form.Many2XPopupListView = openerp.base.ListView.extend({
do_add_record: function () {
this.popup.new_object();
},
select_record: function(index) {
this.popup.on_select_elements([this.dataset.ids[index]]);
},

View File

@ -886,7 +886,6 @@
</t>
<t t-name="Many2XSelectPopup.search.buttons">
<button type="button" class="oe_many2xselectpopup-search-select" disabled="disabled">Select</button>
<button type="button" class="oe_many2xselectpopup-search-new">New</button>
<button type="button" class="oe_many2xselectpopup-search-close">Close</button>
</t>
<t t-name="Many2XSelectPopup.form.buttons">