models.load_models({
model: 'stock.production.lot',
fields: ['id','name','product_id','total_qty','life_date'],
domain: function(self){ //done
loaded: function(self,list_lot){
self.list_lot = list_lot;
},
});
var PackLotLinePopupWidget = PopupWidget.extend({
template: 'PackLotLinePopupWidget',
events: _.extend({}, PopupWidget.prototype.events, {
'click .remove-lot': 'remove_lot',
'keydown': 'add_lot',
'blur .packlot-line-input': 'lose_input_focus'
}),
show: function(options){
var self = this;
var product_lot = [];
var lot_list = self.pos.list_lot;
for(var i=0;i<lot_list.length;i++){
if(lot_list[i].product_id[0] == options.pack_lot_lines.order_line.product.id){
product_lot.push(lot_list[i]);
}
}
options.product_lot = product_lot;
this._super(options);
this.focus();
},