Browse Source

[9.0][FIX] pos_payment_terminal: Fix last changes from 10.0

pull/389/head
Denis Roussel 5 years ago
parent
commit
4af7c9f482
  1. 3
      pos_payment_terminal/models/pos_order.py
  2. 5
      pos_payment_terminal/static/src/js/pos_payment_terminal.js

3
pos_payment_terminal/models/pos_order.py

@ -4,7 +4,7 @@
from collections import defaultdict
import logging
from odoo import models, api
from openerp import models, api
_logger = logging.getLogger(__name__)
@ -40,6 +40,7 @@ class PosOrder(models.Model):
_logger.error("Error matching transactions to payments: %s",
e.args[0])
@api.model
def _process_order(self, pos_order):
if pos_order.get('transactions'):
self._match_transactions_to_payments(pos_order)

5
pos_payment_terminal/static/src/js/pos_payment_terminal.js

@ -80,7 +80,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) {
screens.PaymentScreenWidget.include({
render_paymentlines : function(){
this._super.apply(this, arguments);
var self = this;
var self = this;
this.$('.paymentlines-container').unbind('click').on('click', '.payment-terminal-transaction-start', function(event){
// Why this "on" thing links severaltime the button to the action if I don't use "unlink" to reset the button links before ?
//console.log(event.target);
@ -91,11 +91,12 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) {
},
order_changes: function(){
this._super.apply(this, arguments);
var self = this;
var order = this.pos.get_order();
if (!order) {
return;
} else if (order.in_transaction) {
self.$('.next').html('<img src="/web/static/src/img/spin.png" style="animation: fa-spin 1s infinite steps(12);width: 20px;height: auto;vertical-align: middle;">');
self.$('.next').html('<img src="/web/static/src/img/throbber.gif" style="animation: fa-spin 1s infinite steps(12);width: 20px;height: auto;vertical-align: middle;">');
} else {
self.$('.next').html('Validate <i class="fa fa-angle-double-right"></i>');
}

Loading…
Cancel
Save