forked from Techsystech/web
[IMP] web_widget_one2many_product_picker: Add option 'all_domain' and auto-select search input content
parent
098df6a08f
commit
107d3a5114
|
@ -84,6 +84,7 @@ Widget options:
|
|||
* show_discount > Enable/Disable display discount (False by default)
|
||||
* show_subtotal > Enable/Disable show subtotal (True by default)
|
||||
* auto_save > Enable/Disable auto save (False by default)
|
||||
* all_domain > The domain used in 'All' section ([] by default)
|
||||
|
||||
If using auto save feature, you should keep in mind that the "Save" and "Discard" buttons
|
||||
will lose part of its functionality as the document will be saved every time you
|
||||
|
|
|
@ -42,6 +42,7 @@ Widget options:
|
|||
* show_discount > Enable/Disable display discount (False by default)
|
||||
* show_subtotal > Enable/Disable show subtotal (True by default)
|
||||
* auto_save > Enable/Disable auto save (False by default)
|
||||
* all_domain > The domain used in 'All' section ([] by default)
|
||||
|
||||
If using auto save feature, you should keep in mind that the "Save" and "Discard" buttons
|
||||
will lose part of its functionality as the document will be saved every time you
|
||||
|
|
|
@ -471,6 +471,8 @@ You need to define the view fields. The view must be of <tt class="docutils lite
|
|||
<li><p class="first">show_subtotal > Enable/Disable show subtotal (True by default)</p>
|
||||
</li>
|
||||
<li><p class="first">auto_save > Enable/Disable auto save (False by default)</p>
|
||||
</li>
|
||||
<li><p class="first">all_domain > The domain used in ‘All’ section ([] by default)</p>
|
||||
<p>If using auto save feature, you should keep in mind that the “Save” and “Discard” buttons
|
||||
will lose part of its functionality as the document will be saved every time you
|
||||
modify/create a record with the widget.</p>
|
||||
|
|
|
@ -27,6 +27,7 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
|||
"click .oe_btn_lines": "_onClickLines",
|
||||
"click .oe_btn_search_group": "_onClickSearchGroup",
|
||||
"search .oe_search_input": "_onSearch",
|
||||
"focusin .oe_search_input": "_onFocusInSearch",
|
||||
"show.bs.dropdown .o_cp_buttons": "_onShowSearchDropdown",
|
||||
}),
|
||||
custom_events: _.extend({}, FieldOne2Many.prototype.custom_events, {
|
||||
|
@ -196,7 +197,7 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
|||
this.searchGroups.splice(0, 0, {
|
||||
name: "all",
|
||||
string: _t("All"),
|
||||
domain: [],
|
||||
domain: this.options.all_domain,
|
||||
order: false,
|
||||
active: !hasUserActive,
|
||||
});
|
||||
|
@ -545,6 +546,7 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
|||
},
|
||||
auto_save: false,
|
||||
ignore_warning: false,
|
||||
all_domain: [],
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -681,6 +683,16 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Auto select all content when user enters into fields with this
|
||||
* widget.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_onFocusInSearch: function() {
|
||||
this.$searchInput.select();
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {DropdownEvent} evt
|
||||
|
|
Loading…
Reference in New Issue