[WIP] stock.ui: packing action

bzr revid: fva@openerp.com-20130627141543-8crv4u9laaeaiedj
This commit is contained in:
Frédéric van der Essen
2013-06-27 16:15:43 +02:00
parent ae5a1030b7
commit 8ec705becf
+26
View File
@@ -124,6 +124,7 @@ function openerp_picking_widgets(instance){
this.connect_barcode_scanner();
this.$('.js_pick_quit').click(function(){ self.quit(); });
this.$('.js_pick_pack').click(function(){ self.pack(); });
$.when(this.loaded).done(function(){
self.picking_editor = new module.PickingEditorWidget(self);
@@ -194,6 +195,31 @@ function openerp_picking_widgets(instance){
console.log('Updated the UI');
});
},
pack: function(){
var self = this;
console.log('Pack');
new instance.web.Model('stock.picking').call('action_pack',[[self.picking.id]])
.then(function(){
instance.session.user_context.current_package_id = false;
self.current_package_id = instance.session.user_context.current_package_id;
console.log('Context Reset');
return new instance.web.Model('stock.pack.operation').call('read',[self.picking.pack_operation_ids, []])
}).then(function(operations){
console.log('New Operations: ',operations);
self.operations = operations;
return new instance.web.Model('stock.quant.package').call('read',[self.picking.package_ids, []]);
}).then(function(packages){
console.log('New Packages: ',packages);
self.packages = packages;
self.picking_editor.renderElement();
self.package_editor.renderElement();
self.package_selector.renderElement();
console.log('Updated the UI');
});
},
connect_barcode_scanner: function(){
var self =this;
var code = [];