From 3e77a95e5c8a920b372e67038b8acb0dc650ae55 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 14 Sep 2018 13:54:38 +0200 Subject: [PATCH] [FIX] point_of_sale: fixup --- addons/point_of_sale/static/src/js/models.js | 13 +++++-------- addons/point_of_sale/static/src/xml/pos.xml | 18 +++++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index b79e7d17fd1..ee891ff1b66 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1307,9 +1307,6 @@ exports.Product = Backbone.Model.extend({ // pricelist that have base == 'pricelist'. return price; }, - get_discount_policy: function(pricelist){ - return pricelist.discount_policy; - }, }); var orderline_id = 1; @@ -1784,10 +1781,10 @@ exports.Orderline = Backbone.Model.extend({ }; }, display_discount_policy: function(){ - return this.product.get_discount_policy(this.order.pricelist); + return this.order.pricelist.discount_policy; }, - get_list_price: function(){ - return this.product.list_price; + get_lst_price: function(){ + return this.product.lst_price; }, }); @@ -2460,8 +2457,8 @@ exports.Order = Backbone.Model.extend({ get_total_discount: function() { return round_pr(this.orderlines.reduce((function(sum, orderLine) { sum += (orderLine.get_unit_price() * (orderLine.get_discount()/100) * orderLine.get_quantity()); - sum += ((orderLine.get_list_price() - orderLine.get_unit_price()) * orderLine.get_quantity()); - return sum + sum += ((orderLine.get_lst_price() - orderLine.get_unit_price()) * orderLine.get_quantity()); + return sum; }), 0), this.pos.currency.rounding); }, get_total_tax: function() { diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 639aec299c5..e391d21b78e 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -1269,7 +1269,7 @@ - @@ -1285,10 +1285,10 @@ at - - - + line.get_unit_display_price() != line.get_lst_price()"> + + + @@ -1482,11 +1482,11 @@ + orderline.get_unit_display_price() != orderline.get_lst_price()">
- - - + + + ->