Browse Source

[FIX] pos_lot_selection: ES6 code breaks phantomjs tests

Object.assign is introduced in ES6 (2015) which is not supported by
PhantomJS. Replace it with the equivalent _.extend function to prevent
frontend tests from failing.

1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Specifications
2. https://github.com/ariya/phantomjs/issues/14506
pull/326/head
Kiril Vangelovski 6 years ago
parent
commit
064722836c
  1. 1
      pos_lot_selection/README.rst
  2. 3
      pos_lot_selection/static/src/js/chrome.js

1
pos_lot_selection/README.rst

@ -62,6 +62,7 @@ Contributors
* David <david.vidal@tecnativa.com> * David <david.vidal@tecnativa.com>
* (https://www.tecnativa.com) * (https://www.tecnativa.com)
* Ignacio Ales <ignacio.ales@guadaltech.es> * Ignacio Ales <ignacio.ales@guadaltech.es>
* Kiril Vangelovski <kiril@lambda-is.com>
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.

3
pos_lot_selection/static/src/js/chrome.js

@ -1,4 +1,5 @@
/* Copyright 2018 Tecnativa - David Vidal /* Copyright 2018 Tecnativa - David Vidal
Copyright 2019 Lambda IS DOOEL <https://www.lambda-is.com>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */ License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
odoo.define("pos_lot_selection.chrome", function (require) { odoo.define("pos_lot_selection.chrome", function (require) {
@ -14,7 +15,7 @@ odoo.define("pos_lot_selection.chrome", function (require) {
var events = { var events = {
"change .packlot-line-select": "lot_to_input", "change .packlot-line-select": "lot_to_input",
}; };
packlotline.events = Object.assign(
packlotline.events = _.extend(
packlotline.events, events packlotline.events, events
); );
// Add methods over instanced popup // Add methods over instanced popup

Loading…
Cancel
Save