Мне нужно сделать некоторые настройки в модуле PoS в Odoo 8.Расширение модуля PoS Odoo 8.x (формально OpenERP)?
Для этого я создал вызов модуля «cus_pos». С помощью этого кода я расширил интерфейс:
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-extend="PosWidget">
<t t-jquery="div.pos-leftpane > div.window > div:last" t-operation="after">
<div class="payment-lines">
<div class="paymentline selected">
<!-- trigger an error <t t-esc="widget.get_list_salespersons()" /> -->
<div class="paymentline-name"> Salesperson: </div>
<select id="salesperson-select" class="paymentline-input">
</select>
</div>
</div>
</t>
</t>
</templates>
Но когда я пытаюсь расширить виджет «PosWidget», чтобы добавить метод заселить выберите «продавец-выбор», я получаю эту ошибку «Error: QWeb2 - template ['PosWidget']: Ошибка выполнения: TypeError: dict.widget.get_list_salespersons не является функцией ".
Продлить "PosWidget" я пытался это стратегии:
One:
openerp.cus_pos = function(instance) {
template: 'PosWidget',
var module = instance.point_of_sale;
module.PosWidget = module.PosWidget.extend({
get_list_salespersons: function() {
console.log("Hurray!!!");
}
});
}
Два:
function openerp_pos_salesperson(instance, module) { //module is instance.point_of_sale
var module = instance.point_of_sale;
var QWeb = instance.web.qweb;
_t = instance.web._t;
module.SalePersonWidget = module.PosWidget.include({
template: 'PosWidget',
get_list_salespersons: function() {
console.log("Hurray!!!");
}
});
}
Три:
function openerp_pos_saleperson(instance, module) { //module is instance.point_of_sale
var module = instance.point_of_sale;
var QWeb = instance.web.qweb;
_t = instance.web._t;
module.SalePersonWidget = module.PosWidget.include({
template: 'PosWidget',
get_list_salespersons: function() {
console.log("Hurray!!!");
}
});
}
(function() {
var _super = window.openerp.point_of_sale;
window.openerp.point_of_sale = function(instance) {
_super(instance);
var module = instance.point_of_sale;
openerp_pos_vendedor(instance,module);
}
})();
Четыре:
openerp.cus_pos = function(instance) {
var module = instance.point_of_sale;
var _super_ = module.PosWidget.prototype.get_list_salespersons;
module.PosWidget.prototype.get_list_salespersons = function() {
console.log("Hurray!!!");
_super_.call(this);
};
};
Поиск какой-либо документации, которую я нашел http://thierry-godin.developpez.com/openerp/tutorial-module-creation-pos-modification-english-version/#LI, но устарел.
Любая помощь по моему вопросу будет полезной. Many Thanks
после прочтения источников odoo, я мог найти свою ошибку. Это было связано с тем, как я включал в себя активы. Теперь я пишу небольшую статью о том, как расширить модуль PoS в Odoo 8. Спасибо за ваш ответ! –