Skip to content

Commit

Permalink
[FIX] pos_margin : do not raise JS error if iface_display_margin is …
Browse files Browse the repository at this point in the history
…disabled, when loading point of sale
  • Loading branch information
legalsylvain committed Jun 21, 2021
1 parent 8a9c5bc commit 3283582
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pos_margin/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ odoo.define("pos_margin.screens", function (require) {
if (!order.get_orderlines().length) {
return;
}
this.el.querySelector(".summary .order-margin .value-margin-rate").textContent = this.format_pr(order.get_margin_rate(), 0.01) + "%";
this.el.querySelector(".summary .order-margin .value-margin").textContent = this.format_currency(order.get_margin());
if (this.pos.config.iface_display_margin) {
this.el.querySelector(".summary .order-margin .value-margin-rate").textContent = this.format_pr(order.get_margin_rate(), 0.01) + "%";
this.el.querySelector(".summary .order-margin .value-margin").textContent = this.format_currency(order.get_margin());
}
},
});

Expand Down

0 comments on commit 3283582

Please sign in to comment.