summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/src/js
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2021-02-23 12:05:25 +0000
committerGoffin Simon <sig@odoo.com>2021-02-23 16:14:17 +0000
commitbfc9153e79d90f1d10e86216bdc57c818b9b1395 (patch)
treee0d060b3269ba56642032e5af5113c444f3706d4 /addons/point_of_sale/static/src/js
parent86ffe7548627cfa57eb38594c4e8a7a578ca9eac (diff)
[FIX] point_of_sale: Multicompany tax
Steps to reproduce the bug: - Create a multi-company environment with two companies A & B - Create two sales taxes TA & TB, one for company A & one for company B - Created a shared product P and assign both TA & TB - Create a fiscal position FP that maps TA and TB to other taxes - Login with user having access of both companies - Enable a POS session S with fiscal position and select FP - Open S and select P as product Bug: A traceback was raised PS: Only the taxes of company's user are loaded in taxes_by_id So when trying to fetch taxes from a product with function get_taxes, the taxes from other companies than company's user must be ignored. opw:2448785 closes odoo/odoo#66717 X-original-commit: 5dcfdcb265a7217fd52ab5b7e3e51cc5c2430761 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons/point_of_sale/static/src/js')
-rw-r--r--addons/point_of_sale/static/src/js/models.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index cff97a7d504..4423904b722 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -2062,7 +2062,9 @@ exports.Orderline = Backbone.Model.extend({
var taxes_ids = this.get_product().taxes_id;
var taxes = [];
for (var i = 0; i < taxes_ids.length; i++) {
- taxes.push(this.pos.taxes_by_id[taxes_ids[i]]);
+ if (this.pos.taxes_by_id[taxes_ids[i]]) {
+ taxes.push(this.pos.taxes_by_id[taxes_ids[i]]);
+ }
}
return taxes;
},