summaryrefslogtreecommitdiff
path: root/addons/product/static
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2020-06-12 09:01:44 +0000
committerJulien Mougenot <jum@odoo.com>2020-06-12 09:01:50 +0000
commitc4786fccfd23360a02e442c48ae2fb9f1e70aa4c (patch)
tree95434422bfecf324a2112fadfc078a9bced134e7 /addons/product/static
parentd093fd4236a7c7f18645a85970cbdda6fec44c92 (diff)
[IMP] *: update notifications to optional title
closes odoo/odoo#52826 Related: odoo/enterprise#11084 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/product/static')
-rw-r--r--addons/product/static/src/js/product_pricelist_report.js9
-rw-r--r--addons/product/static/tests/product_pricelist_report_test.js6
2 files changed, 9 insertions, 6 deletions
diff --git a/addons/product/static/src/js/product_pricelist_report.js b/addons/product/static/src/js/product_pricelist_report.js
index fa19e0c8a3a..c040a190e84 100644
--- a/addons/product/static/src/js/product_pricelist_report.js
+++ b/addons/product/static/src/js/product_pricelist_report.js
@@ -35,7 +35,10 @@ var QtyTagWidget = Widget.extend({
*/
_onClickAddQty: function () {
if (this.quantities.length >= this.MAX_QTY) {
- this.do_notify(_t("Quantity cannot be displayed"), _.str.sprintf(_t("Maximum %d quantities can be displayed simultaneously. Remove a selected quantity to add others."), this.MAX_QTY));
+ this.do_notify(false, _.str.sprintf(
+ _t("At most %d quantities can be displayed simultaneously. Remove a selected quantity to add others."),
+ this.MAX_QTY
+ ));
return;
}
const qty = parseInt(this.$('.o_product_qty').val());
@@ -48,12 +51,12 @@ var QtyTagWidget = Widget.extend({
this.renderElement();
} else {
this.displayNotification({
- title: _.str.sprintf(_t("Quantity already present (%d)."), qty),
+ message: _.str.sprintf(_t("Quantity already present (%d)."), qty),
type: 'info'
});
}
} else {
- this.do_notify(_t("Please enter a positive whole number."));
+ this.do_notify(false, _t("Please enter a positive whole number"));
}
},
/**
diff --git a/addons/product/static/tests/product_pricelist_report_test.js b/addons/product/static/tests/product_pricelist_report_test.js
index 7ecf91d7cdc..b9eac3cf5f3 100644
--- a/addons/product/static/tests/product_pricelist_report_test.js
+++ b/addons/product/static/tests/product_pricelist_report_test.js
@@ -94,7 +94,7 @@ QUnit.module('Product Pricelist', {
// existing quantity can not be added.
await testUtils.dom.click(actionManager.$('.o_add_qty'));
let notificationElement = document.body.querySelector('.o_notification_manager .o_notification.bg-info');
- assert.strictEqual(notificationElement.querySelector('.o_notification_title').textContent,
+ assert.strictEqual(notificationElement.querySelector('.o_notification_content').textContent,
"Quantity already present (1).", "Existing Quantity can not be added");
// adding few more quantities to check.
@@ -111,7 +111,7 @@ QUnit.module('Product Pricelist', {
notificationElement = document.body.querySelector('.o_notification_manager .o_notification.bg-warning');
assert.strictEqual(notificationElement.querySelector('.o_notification_content').textContent,
- "Maximum 5 quantities can be displayed simultaneously. Remove a selected quantity to add others.",
+ "At most 5 quantities can be displayed simultaneously. Remove a selected quantity to add others.",
"Can not add more then 5 quantities");
// removing all the quantities should work
@@ -143,4 +143,4 @@ QUnit.module('Product Pricelist', {
}
);
-}); \ No newline at end of file
+});