跳至內容
選單
此問題已被標幟
1396 瀏覽次數

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
1642
2
10月 23
3200
2
9月 23
1729
3
12月 24
5248
1
7月 24
2817