summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorNasreddin (bon) <bon@odoo.com>2020-11-23 16:15:54 +0000
committerNasreddin (bon) <bon@odoo.com>2020-11-30 08:07:04 +0000
commitd5b5e7c8490e8de9e56f16cdef640dd733163175 (patch)
tree9dba66a4c44e435970269cf5956dedbcd2ace4fb /addons/web/static/src/js/views/basic
parentc52a14d3efea45236369a41f5022ad0b5e022341 (diff)
[FIX] web: Unable to create a new record with warning message
Issue - Install Sales - In Sales > Configuration > Settings -> Enable "Sale Warnings" - Go to Sales > Orders > Customers - Pick a customer/company - Go in Edit mode and go to "Internal Notes" tab - Switch "Warning on the Sales Order" from "No Message" to "Warning" and add any warning message then save - Press the "$ X Sales" smart button - Create a new Quotation - Validate the warning message - Go back to the previous menu (using the breadcrumb) or save the quotation - Create a new quotation The quotation form editor does not appear. Cause If we use the breadcrumb (or save then create), it will call the `_reload` function (instead of `load` when the form view hasn't been opened yet). In this case, creating a new record, it will call `_makeDefaultRecord` without setting `allowWarning` param to true (like it is done in the ref. commit bellow). Solution Set `allowWarning` param to true before calling `_makeDefaultRecord`. related commit : https://github.com/odoo/odoo/commit/a41db9a2cf410bb233b021651a5633180eaddf18 opw-2374857 closes odoo/odoo#62534 X-original-commit: 5c8101102f999cfac6aec7658b98e376d4ed0596 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js1
1 files changed, 1 insertions, 0 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 4a3a1930cb1..ca21cb6824d 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -4764,6 +4764,7 @@ var BasicModel = AbstractModel.extend({
fieldsInfo: element.fieldsInfo,
fields: element.fields,
viewType: element.viewType,
+ allowWarning: true,
};
return this._makeDefaultRecord(element.model, params);
}