Browse Source

[FIX] Lookup of taxes not found in fiscal position mappings

[FIX] Style and garbage code
pull/39/head
PabloCM 10 years ago
parent
commit
0a1a57c33c
  1. 2
      pos_pricelist/migrations/8.0.1.1.0/post-migration.py
  2. 3
      pos_pricelist/models/point_of_sale.py
  3. 2
      pos_pricelist/static/src/js/db.js
  4. 7
      pos_pricelist/static/src/js/models.js

2
pos_pricelist/migrations/8.0.1.1.0/post-migration.py

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
__name__ = ("Copy the product taxes to the pos.line")
__name__ = "Copy the product taxes to the pos.line"
def migrate(cr, version): def migrate(cr, version):

3
pos_pricelist/models/point_of_sale.py

@ -20,8 +20,6 @@
from openerp import models, fields, api from openerp import models, fields, api
# import logging
# _logger = logging.getLogger(__name__)
class PosOrderLine(models.Model): class PosOrderLine(models.Model):
@ -59,4 +57,3 @@ class PosOrder(models.Model):
val += c.get('amount', 0.0) val += c.get('amount', 0.0)
return val return val
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
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++) { for (var i = 0, len = taxes_ids.length; i < len; i++) {
var tax_id = taxes_ids[i]; var tax_id = taxes_ids[i];
if (! tax_id in found_taxes) {
if (!(tax_id in found_taxes)) {
taxes.push(tax_id); taxes.push(tax_id);
} }
} }

7
pos_pricelist/static/src/js/models.js

@ -263,7 +263,6 @@ function pos_pricelist_models(instance, module) {
*/ */
get_applicable_taxes_for_orderline: function () { get_applicable_taxes_for_orderline: function () {
// find applicable taxes for this product and this customer // find applicable taxes for this product and this customer
var fiscal_position_taxes = [];
var product = this.get_product(); var product = this.get_product();
var product_tax_ids = product.taxes_id; var product_tax_ids = product.taxes_id;
var product_taxes = []; var product_taxes = [];
@ -296,9 +295,9 @@ function pos_pricelist_models(instance, module) {
this, arguments this, arguments
); );
}, },
export_as_JSON: function() { 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 product_tax_ids = this.get_product().taxes_id || [];
var partner = this.order ? this.order.get_client() : null; var partner = this.order ? this.order.get_client() : null;
if (partner && partner.property_account_position) { if (partner && partner.property_account_position) {
@ -307,7 +306,7 @@ function pos_pricelist_models(instance, module) {
partner.property_account_position[0], product_tax_ids 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; return res;
} }
}); });

Loading…
Cancel
Save