Merge PR #2040 into 12.0

Signed-off-by pedrobaeza
pull/2050/head
OCA-git-bot 2021-10-01 19:09:57 +00:00
commit 0805bb941f
3 changed files with 7 additions and 3 deletions

View File

@ -39,6 +39,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

View File

@ -3,3 +3,5 @@
* Alexandre D. Díaz
* Pedro M. Baeza
* David Vidal
* Giovanni Serra <giovanni@gslab.it>

View File

@ -85,9 +85,9 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
// Uses to work with searchs, so we can mix properties with the user values.
this._searchContext = {
domain: this.mode === "readonly" ? this._getLinesDomain() : false,
domain: this.mode === "readonly" ? this._getLinesDomain() : this._activeSearchGroup.domain,
text: false,
order: false,
order: this.mode === "readonly" ? false : this._activeSearchGroup.order,
activeTest: true,
};
if (this.mode === "readonly") {
@ -206,7 +206,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,
});
@ -456,6 +456,7 @@ odoo.define("web_widget_one2many_product_picker.FieldOne2ManyProductPicker", fun
trigger_refresh_fields: ["partner_id", "currency_id"],
auto_save: false,
ignore_warning: false,
all_domain: [],
};
},