diff options
| author | Aurélien Warnon <awa@odoo.com> | 2018-10-01 13:37:30 +0200 |
|---|---|---|
| committer | Aurélien Warnon <awa@odoo.com> | 2018-10-01 13:37:30 +0200 |
| commit | 6f9a223ca883d74892ad72899b73f4f6052b3b1e (patch) | |
| tree | 5e50d14c454e8d1ffb02e926d4ce99161a39113f /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 48b596d5332df4ebd2900fad46242aa201bc8bac (diff) | |
| parent | 154fc7d9dd550d35b7266af024e54c20e18938fc (diff) | |
[IMP] product,(website_)sale: Product configurator default_get cleanup + bugfix
Targets commit d3530eb
Purpose
=======
[Follow up AL review]
Removed the default_get override in the sale_order_line model.
- The default values to create records are now specified by pefixing them with "default_" in the JS.
That will use the built-in framework method, which is more simple/clean.
- The "list_editable_renderer.js" file for the product configurator was removed and its content is now merged within
the SectionAndNoteListRenderer.
Updated fields:
- [sale_order_line in sale/sale.py] "product_no_variant_attribute_values" to "product_no_variant_attribute_value_ids"
[Follow up JCR testing]
Various bug fixes including:
- optional products dont show when they have variants configured on them
- when no variant is created, you cant choose the product one first time in the ecommerce
- when in debug, attribute and attribute value menu is double
- fix design of default picture in cart summary / product comparison
- fix missing href tag on product comparison "add to cart" buttons
- fix button "Configure Variants" is always shown even if there are no variants
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 94d0ea78c0e..f6bf46aed68 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1328,10 +1328,10 @@ var BasicModel = AbstractModel.extend({ * @param {Object} [options] * @param {string} [options.position=top] if the new record should be added * on top or on bottom of the list - * @param {Object} [options.[context]] additional context to be merged before + * @param {Array} [options.[context]] additional context to be merged before * calling the default_get (eg. to set default values). * If several contexts are found, multiple records are added - * @param {boolean} [params.allowWarning=false] if true, the default record + * @param {boolean} [options.allowWarning=false] if true, the default record * operation can complete, even if a warning is raised * @returns {Deferred<[string]>} resolves to the new records ids */ @@ -1349,7 +1349,7 @@ var BasicModel = AbstractModel.extend({ var additionalContexts = options && options.context; var makeDefaultRecords = []; - if(additionalContexts){ + if (additionalContexts){ _.each(additionalContexts, function (context) { params.context = self._getContext(list, {additionalContext: context}); makeDefaultRecords.push(self._makeDefaultRecord(list.model, params)); @@ -1359,9 +1359,9 @@ var BasicModel = AbstractModel.extend({ makeDefaultRecords.push(self._makeDefaultRecord(list.model, params)); } - return $.when.apply($, makeDefaultRecords).then(function(){ + return $.when.apply($, makeDefaultRecords).then(function (){ var ids = []; - _.each(arguments, function(id){ + _.each(arguments, function (id){ ids.push(id); list._changes.push({operation: 'ADD', id: id, position: position, isNew: true}); @@ -1394,7 +1394,7 @@ var BasicModel = AbstractModel.extend({ * it was changed. * @param {string} [options.viewType] current viewType. If not set, we will assume * main viewType from the record - * @param {boolean} [params.allowWarning=false] if true, change + * @param {boolean} [options.allowWarning=false] if true, change * operation can complete, even if a warning is raised * (only supported by X2ManyChange) * @returns {Deferred} list of changed fields @@ -1745,7 +1745,7 @@ var BasicModel = AbstractModel.extend({ * key. For example, it looks like {operation: ADD, id: 'partner_1'} * @param {string} [viewType] current viewType. If not set, we will assume * main viewType from the record - * @param {boolean} [params.allowWarning=false] if true, change + * @param {boolean} [allowWarning=false] if true, change * operation can complete, even if a warning is raised * (only supported by the 'CREATE' command.operation) * @returns {Deferred} |
