如何在 Odoo v9 的销售点模块中将产品数量增加一个?
How to increase the product quantity by one in the point of sale module in Odoo v9?
在 Odoo POS 中点击产品后,数量应该增加一个。
这是文件中的原始函数point_of_sale/static/src/js/screens.js
orderline_change: function(line){
this.rerender_orderline(line);
this.update_summary();
},
现在我想从我的模块调用这个函数来增加一个产品数量(当按下 Ctrl + Left arrow
时):
//OrderWidget
screens.OrderWidget.include({
renderElement: function(){
this._super();
var self = this;
//CTRL + Left arrow
$.ctrl('37', function() {
var order_line = self.pos.get_order().get_last_orderline();
self.rerender_orderline(order_line);
self.update_summary();
});
},
});
在我的考试中,我获得了正确的行 ID,但数量没有改变!
有什么解决办法吗?
调用订单行对象的set_quantity()方法更新行
数量.
//OrderWidget
screens.OrderWidget.include({
renderElement: function(){
this._super();
var self = this;
//CTRL + Left arrow
$.ctrl('37', function() {
var order_line = self.pos.get_order().get_last_orderline();
order_line.set_quantity(order_line.get_quantity() + 1);
});
},
});
在 Odoo POS 中点击产品后,数量应该增加一个。
这是文件中的原始函数point_of_sale/static/src/js/screens.js
orderline_change: function(line){
this.rerender_orderline(line);
this.update_summary();
},
现在我想从我的模块调用这个函数来增加一个产品数量(当按下 Ctrl + Left arrow
时):
//OrderWidget
screens.OrderWidget.include({
renderElement: function(){
this._super();
var self = this;
//CTRL + Left arrow
$.ctrl('37', function() {
var order_line = self.pos.get_order().get_last_orderline();
self.rerender_orderline(order_line);
self.update_summary();
});
},
});
在我的考试中,我获得了正确的行 ID,但数量没有改变! 有什么解决办法吗?
调用订单行对象的set_quantity()方法更新行 数量.
//OrderWidget
screens.OrderWidget.include({
renderElement: function(){
this._super();
var self = this;
//CTRL + Left arrow
$.ctrl('37', function() {
var order_line = self.pos.get_order().get_last_orderline();
order_line.set_quantity(order_line.get_quantity() + 1);
});
},
});