From 38a37fd84363114bd61439108c692b56485d063d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 6 Jan 2018 00:02:01 +0100 Subject: [PATCH] [FIX] remove unrelated code to pos_pricelist and fix #128 --- pos_pricelist/static/src/js/models.js | 54 --------------------------- 1 file changed, 54 deletions(-) diff --git a/pos_pricelist/static/src/js/models.js b/pos_pricelist/static/src/js/models.js index 66f7ada6..6ac158e8 100644 --- a/pos_pricelist/static/src/js/models.js +++ b/pos_pricelist/static/src/js/models.js @@ -73,60 +73,6 @@ function pos_pricelist_models(instance, module) { } }); - /** - * Extend the order - */ - module.Order = module.Order.extend({ - /** - * override this method to merge lines - * TODO : Need some refactoring in the standard POS to Do it better - * TODO : from line 73 till 85, we need to move this to another method - * @param product - * @param options - */ - addProduct: function (product, options) { - options = options || {}; - var attr = JSON.parse(JSON.stringify(product)); - attr.pos = this.pos; - attr.order = this; - var line = new module.Orderline({}, { - pos: this.pos, - order: this, - product: product - }); - var self = this; - var found = false; - - if (options.quantity !== undefined) { - line.set_quantity(options.quantity); - } - if (options.price !== undefined) { - line.set_unit_price(options.price); - } - if (options.discount !== undefined) { - line.set_discount(options.discount); - } - - var orderlines = []; - if (self.get('orderLines').models !== undefined) { - orderlines = self.get('orderLines').models; - } - for (var i = 0; i < orderlines.length; i++) { - var _line = orderlines[i]; - if (_line && _line.can_be_merged_with(line) && - options.merge !== false) { - _line.merge(line); - found = true; - break; - } - } - if (!found) { - this.get('orderLines').add(line); - } - this.selectLine(this.getLastOrderline()); - } - }); - /** * Extend the Order line */