[FIX] pos_mercury: load pos_mercury_config_id from account.journal
The introduction of df745c25fb 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.
This commit is contained in:
@@ -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});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user