Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1474 Представления

Hi Odooers:

i added a custom button in pos screen name "Custom Button" and set it numberpopup now i want that when enter number (like 3459" ) then the number should be save the store on the button label .(instead of Custom Button the should be 3459 ) and should be store on backend in pos.order form there is a field delivery_order .

The code is Given below:

js code;

odoo.define('xy_pos_button.CreateCustomButton', function(require) {
'use strict';
const { Gui } = require('point_of_sale.Gui');
const PosComponent = require('point_of_sale.PosComponent');
const { posbus } = require('point_of_sale.utils');
const ProductScreen = require('point_of_sale.ProductScreen');
const { useListener } = require('web.custom_hooks');
const Registries = require('point_of_sale.Registries');
const PaymentScreen = require('point_of_sale.PaymentScreen');
class CustomButton extends PosComponent {
constructor() {
super(...arguments);
useListener('click', this.onClick);
}
async onClick() {
const { confirmed} = await this.showPopup("NumberPopup", {})

}

}

CustomButton.template = 'CustomButton';
ProductScreen.addControlButton({
component: CustomButton,
condition: function() {
return this.env.pos;
},
});

Registries.Component.add(CustomButton);
return CustomButton;
});


xml template:














Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
окт. 23
1688
2
окт. 23
3268
2
сент. 23
1795
3
дек. 24
5357
1
июл. 24
2868