У меня есть пользовательская кнопка, и я хочу, чтобы она могла отображать экран квитанции и печатать счет перед проверкой в POS odoo 11. Я много пробовал, но не могу понять, что мне нужно делать :(, пожалуйста, помогите мне. Спасибозаранее
Это мой js код POS / static / src / js / pos.js
odoo.define('POS.pos', function (require) {
'use strict';
var models = require('point_of_sale.models');
var core = require('web.core');
var screens = require('point_of_sale.screens');
var Widget = require('web.Widget');
var ajax = require('web.ajax');
var QWeb = core.qweb;
var CustomButton = screens.PaymentScreenWidget.include({
renderElement: function() {
var self = this;
this._super();
this.$('.js_custom_print').click(function(){
self.click_custom_print();
});
},
click_custom_print: function(){
var order = this.pos.get_order();
var self = this;
console.log("order")
// I want here can render receipt screen and can print function
},
});
});
А это моя пользовательская кнопка
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="PaymentScreenWidget">
<t t-jquery=".payment-buttons" t-operation="append">
<div class='button js_custom_print'>
<i class='fa fa-print' /> Custom Print
</div>
</t>
</t>
</templates>
Обратите внимание, чтоЯ унаследовал шаблон PaymentScreenWidget в POS odoo 11 и добавил свою пользовательскую кнопку для печати счета, прежде чем перейти к проверке. Я так старался, 4 дня :( и не могу найти способ решить эту проблему :( помогите. Большое спасибо