Skip to content

Commit

Permalink
Merge pull request #1260 from trojikman/12.0-pos_longpolling
Browse files Browse the repository at this point in the history
  • Loading branch information
itpp-bot authored Jun 8, 2020
2 parents ef060af + c51c103 commit e606889
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pos_longpolling/static/src/js/PosConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ odoo.define("pos_longpolling.PosConnection", function(require) {
on_notification_do: function(channel, message) {
var self = this;
if (_.isString(channel)) {
channel = JSON.parse(channel);
try {
channel = JSON.parse(channel);
} catch (err) {
// Nothing to report, channel name as is
}
}
if (Array.isArray(channel) && channel[1] in self.channel_callbacks) {
try {
Expand Down
18 changes: 16 additions & 2 deletions pos_orderline_absolute_discount/models/pos_order_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,22 @@ def get_sale_details(self, date_start=False, date_stop=False, configs=False):
# end redefined part of original get_sale_details

for tax in line_taxes["taxes"]:
taxes.setdefault(tax["id"], {"name": tax["name"], "total": 0.0})
taxes[tax["id"]]["total"] += tax["amount"]
taxes.setdefault(
tax["id"],
{
"name": tax["name"],
"tax_amount": 0.0,
"base_amount": 0.0,
},
)
taxes[tax["id"]]["tax_amount"] += tax["amount"]
taxes[tax["id"]]["base_amount"] += tax["base"]
else:
taxes.setdefault(
0,
{"name": _("No Taxes"), "tax_amount": 0.0, "base_amount": 0.0},
)
taxes[0]["base_amount"] += line.price_subtotal_incl

st_line_ids = (
self.env["account.bank.statement.line"]
Expand Down

0 comments on commit e606889

Please sign in to comment.