Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3682 Ansichten

Hi all,

I want to customize POS receipt to run console.log() script when I click on Print Receipt button, but I don't know the way to implement it.

I try to edit renderElement() function but error

Here is my script, please help me. When I enter pos receipt screen, I have Failed module message. Thank in advance

odoo.define('pos_receipt_extend', function (require) {
"use strict";
var $ = require('jquery');
// Add cost field to product model
var models = require('point_of_sale.models');
models.load_fields('product.product', 'standard_price');

var screens = require('point_of_sale.screens');
  var render = screens.ReceiptScreenWidget.prototype.renderElement;
var new_render = function () {
render.apply(self);
console.log('OK!');
};
screens.ReceiptScreenWidget.prototype.renderElement = new_render();
});
Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juni 17
4305
3
Dez. 19
9449
1
Aug. 23
2945
1
Okt. 19
7109
2
Jan. 19
4105