summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren Van Onder <jov@odoo.com>2016-01-13 09:13:54 +0100
committerJoren Van Onder <jov@odoo.com>2016-01-13 10:02:59 +0100
commitf53eb4d2e6b1184cd7409d17bbe280d0ba8a1e76 (patch)
tree37b1c062871e2ac1e76f6b3a573ee2738ae43fe4
parent3c86d74941351df8af2e6113fd461c5ff95d59c9 (diff)
[FIX] pos_mercury: load pos_mercury_config_id from account.journal
The introduction of df745c25fbd381e6059180f6f5d231a1b4c090cc made it so that only the type and sequence field of account.journal get loaded in the POS. Before that patch all fields of account.journal would get loaded. pos_mercury depended on this behavior, because it needs the pos_mercury_config_id. This loads the field explicitly. Because of the change the display_name field on the journal is also unavailable, so we instead use the journal_id field on account.bank.statement. This is probably even better than what we did before, because this is what we also use when printing.
-rw-r--r--addons/pos_mercury/static/src/js/pos_mercury.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/pos_mercury/static/src/js/pos_mercury.js b/addons/pos_mercury/static/src/js/pos_mercury.js
index f9e213da5e5..20e602c7aa2 100644
--- a/addons/pos_mercury/static/src/js/pos_mercury.js
+++ b/addons/pos_mercury/static/src/js/pos_mercury.js
@@ -18,14 +18,17 @@ var ScreenWidget = screens.ScreenWidget;
var PaymentScreenWidget = screens.PaymentScreenWidget;
var round_pr = utils.round_precision;
+pos_model.load_fields("account.journal", "pos_mercury_config_id");
+
var _modelproto = pos_model.PosModel.prototype;
pos_model.PosModel = pos_model.PosModel.extend({
getOnlinePaymentJournals: function () {
+ var self = this;
var online_payment_journals = [];
$.each(this.journals, function (i, val) {
if (val.pos_mercury_config_id) {
- online_payment_journals.push({label:val.display_name, item:val.id});
+ online_payment_journals.push({label:self.getCashRegisterByJournalID(val.id).journal_id[1], item:val.id});
}
});