I am create a new module, I want to know how can I overwrite the function of create a new customer, because, I want create the customer in offline mode and I want to keep the data in the LocalStorage.
Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I am create a new module, I want to know how can I overwrite the function of create a new customer, because, I want create the customer in offline mode and I want to keep the data in the LocalStorage.
Thanks.
Hi,
Go through the below codes
odoo.define('your_module_name.pos_custom', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
var ActionpadWidget = screens.ActionpadWidget;
ActionpadWidget.include({
button_click: function (button) {
if (button && button.action === 'create_customer') {
// Custom behavior for the "Create" button to create a new customer
// You can add your own logic here
// Example: Redirect to a different screen
this.pos.gui.show_screen('custom_screen');
return;
}
// Call the original button_click method to preserve other functionality
return this._super(button);
},
});
return ActionpadWidget;
});
define the custom behavior for the "Create" button. You can do this by extending the 'screens.ActionWidget' and overriding the button_click method.
Hope it helps
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 6 23
|
2070 | ||
|
1
thg 5 24
|
1617 | ||
|
1
thg 4 25
|
1410 | ||
|
0
thg 4 24
|
1584 | ||
|
0
thg 1 24
|
1618 |