From 0a1a57c33c6232859d12de22ed10fd4c4cd60490 Mon Sep 17 00:00:00 2001 From: PabloCM Date: Fri, 24 Jul 2015 09:08:00 +0200 Subject: [PATCH] [FIX] Lookup of taxes not found in fiscal position mappings [FIX] Style and garbage code --- pos_pricelist/migrations/8.0.1.1.0/post-migration.py | 2 +- pos_pricelist/models/point_of_sale.py | 3 --- pos_pricelist/static/src/js/db.js | 2 +- pos_pricelist/static/src/js/models.js | 7 +++---- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pos_pricelist/migrations/8.0.1.1.0/post-migration.py b/pos_pricelist/migrations/8.0.1.1.0/post-migration.py index d2a888f9..48cb6450 100644 --- a/pos_pricelist/migrations/8.0.1.1.0/post-migration.py +++ b/pos_pricelist/migrations/8.0.1.1.0/post-migration.py @@ -17,7 +17,7 @@ # along with this program. If not, see . # ############################################################################## -__name__ = ("Copy the product taxes to the pos.line") +__name__ = "Copy the product taxes to the pos.line" def migrate(cr, version): diff --git a/pos_pricelist/models/point_of_sale.py b/pos_pricelist/models/point_of_sale.py index 494622ca..bb5c2e90 100644 --- a/pos_pricelist/models/point_of_sale.py +++ b/pos_pricelist/models/point_of_sale.py @@ -20,8 +20,6 @@ from openerp import models, fields, api -# import logging -# _logger = logging.getLogger(__name__) class PosOrderLine(models.Model): @@ -59,4 +57,3 @@ class PosOrder(models.Model): val += c.get('amount', 0.0) return val -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/pos_pricelist/static/src/js/db.js b/pos_pricelist/static/src/js/db.js index 4a8e6e62..2a27cb91 100644 --- a/pos_pricelist/static/src/js/db.js +++ b/pos_pricelist/static/src/js/db.js @@ -154,7 +154,7 @@ function pos_pricelist_db(instance, module) { } for (var i = 0, len = taxes_ids.length; i < len; i++) { var tax_id = taxes_ids[i]; - if (! tax_id in found_taxes) { + if (!(tax_id in found_taxes)) { taxes.push(tax_id); } } diff --git a/pos_pricelist/static/src/js/models.js b/pos_pricelist/static/src/js/models.js index cebe78f0..e82b5496 100644 --- a/pos_pricelist/static/src/js/models.js +++ b/pos_pricelist/static/src/js/models.js @@ -263,7 +263,6 @@ function pos_pricelist_models(instance, module) { */ get_applicable_taxes_for_orderline: function () { // find applicable taxes for this product and this customer - var fiscal_position_taxes = []; var product = this.get_product(); var product_tax_ids = product.taxes_id; var product_taxes = []; @@ -296,9 +295,9 @@ function pos_pricelist_models(instance, module) { this, arguments ); }, - + export_as_JSON: function() { - var res = OrderlineParent.prototype.export_as_JSON.apply(this, arguments); + var res = OrderlineParent.prototype.export_as_JSON.apply(this, arguments); var product_tax_ids = this.get_product().taxes_id || []; var partner = this.order ? this.order.get_client() : null; if (partner && partner.property_account_position) { @@ -307,7 +306,7 @@ function pos_pricelist_models(instance, module) { partner.property_account_position[0], product_tax_ids ); } - res["tax_ids"] = [[6, false, product_tax_ids]]; + res["tax_ids"] = [[6, false, product_tax_ids]]; return res; } });