콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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:














아바타
취소
관련 게시물 답글 화면 활동
1
10월 23
1651
2
10월 23
3217
2
9월 23
1743
3
12월 24
5268
1
7월 24
2822