我目前在Odoo上的POS中苦苦挣扎。我是使用Javascript修改Odoo前端的新手。
我已经看过不同的模块,但我很困惑,我已经搜索过了,但我发现了Odoo的旧版本中的相关问题和解决方案,即版本8和9。
我想做的就是在支付界面的"Cash (USD)“按钮下面添加"Care of”按钮,并添加一些功能。

但
它显示在数字键盘窗格上方的左窗格中。
使用这行代码。
pos_custom/static/src/js
pos_custom.js
odoo.define('pos_custom.pos_custom', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
var careOfButton = screens.ActionButtonWidget.extend({
template: 'careOfButton',
button_click: function(){
var self = this;
this.gui.show_popup('selection',{
'title': 'Welcome to JS world',
});
},
});
screens.define_action_button({
'name': 'careOf',
'widget': careOfButton,
});
});pos_custom/static/src/xml
pos_custom.xml
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="careOfButton">
<div class='control-button'>
<i class='fa fa-tag' /> Care of
</div>
</t>
</templates>

请帮帮我。任何建议/可能的解决方案。谢谢
https://stackoverflow.com/questions/51319098
复制相似问题