From f53eb4d2e6b1184cd7409d17bbe280d0ba8a1e76 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Wed, 13 Jan 2016 09:13:54 +0100 Subject: [PATCH] [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. --- addons/pos_mercury/static/src/js/pos_mercury.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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}); } });