diff options
| author | Benoit Socias <bso@odoo.com> | 2021-01-28 14:54:13 +0000 |
|---|---|---|
| committer | Benoit Socias <bso@odoo.com> | 2021-01-28 15:11:43 +0000 |
| commit | ca6cc2674e1795a5954495d1725cd86a7db8f964 (patch) | |
| tree | e456e2926846eec638d0755f90235eab87142009 /addons/website/static/src/snippets | |
| parent | ea58a890b678db138e7e604b12217145d865fae3 (diff) | |
[FIX] website, website_sale: preconfigure Dynamic Products w/ 1st option
Before this commit the Dynamic Products snippet was displaying a message
box instead of its content until its template and product category were
selected.
After this commit the Dynamic Products snippet is automatically
configured on drop with the first available template and the first
available product category. The message box only appears if no product
category exists yet. Also an "All Products" category was added as first
element of the list to make the snippet usable before categories are
defined.
task-2439295
https://github.com/odoo/odoo/pull/64982
closes odoo/odoo#64982
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website/static/src/snippets')
| -rw-r--r-- | addons/website/static/src/snippets/s_dynamic_snippet/000.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/static/src/snippets/s_dynamic_snippet/000.js b/addons/website/static/src/snippets/s_dynamic_snippet/000.js index 71b551738b5..d6a3e0ffca4 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet/000.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet/000.js @@ -129,10 +129,17 @@ const DynamicSnippet = publicWidget.Widget.extend({ * * @private */ + _mustMessageWarningBeHidden: function() { + return this._isConfigComplete() || !this.editableMode; + }, + /** + * + * @private + */ _manageWarningMessageVisibility: async function () { this.$el.find('.missing_option_warning').toggleClass( 'd-none', - this._isConfigComplete() + this._mustMessageWarningBeHidden() ); }, /** |
