[FIX] barcode interface: a lot of deferred were not correctly returned
This commit is contained in:
parent
3ae8aada05
commit
d692e4ef56
|
@ -841,7 +841,7 @@ function openerp_picking_widgets(instance){
|
||||||
scan: function(ean){ //scans a barcode, sends it to the server, then reload the ui
|
scan: function(ean){ //scans a barcode, sends it to the server, then reload the ui
|
||||||
var self = this;
|
var self = this;
|
||||||
var product_visible_ids = this.picking_editor.get_visible_ids();
|
var product_visible_ids = this.picking_editor.get_visible_ids();
|
||||||
new instance.web.Model('stock.picking')
|
return new instance.web.Model('stock.picking')
|
||||||
.call('process_barcode_from_ui', [self.picking.id, ean, product_visible_ids])
|
.call('process_barcode_from_ui', [self.picking.id, ean, product_visible_ids])
|
||||||
.then(function(result){
|
.then(function(result){
|
||||||
if (result.filter_loc !== false){
|
if (result.filter_loc !== false){
|
||||||
|
@ -866,7 +866,7 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
scan_product_id: function(product_id,increment,op_id){ //performs the same operation as a scan, but with product id instead
|
scan_product_id: function(product_id,increment,op_id){ //performs the same operation as a scan, but with product id instead
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.picking')
|
return new instance.web.Model('stock.picking')
|
||||||
.call('process_product_id_from_ui', [self.picking.id, product_id, op_id, increment])
|
.call('process_product_id_from_ui', [self.picking.id, product_id, op_id, increment])
|
||||||
.then(function(result){
|
.then(function(result){
|
||||||
return self.refresh_ui(self.picking.id);
|
return self.refresh_ui(self.picking.id);
|
||||||
|
@ -876,7 +876,7 @@ function openerp_picking_widgets(instance){
|
||||||
var self = this;
|
var self = this;
|
||||||
var pack_op_ids = self.picking_editor.get_current_op_selection(false);
|
var pack_op_ids = self.picking_editor.get_current_op_selection(false);
|
||||||
if (pack_op_ids.length !== 0){
|
if (pack_op_ids.length !== 0){
|
||||||
new instance.web.Model('stock.picking')
|
return new instance.web.Model('stock.picking')
|
||||||
.call('action_pack',[[[self.picking.id]], pack_op_ids])
|
.call('action_pack',[[[self.picking.id]], pack_op_ids])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
instance.session.user_context.current_package_id = false;
|
instance.session.user_context.current_package_id = false;
|
||||||
|
@ -888,7 +888,7 @@ function openerp_picking_widgets(instance){
|
||||||
var self = this;
|
var self = this;
|
||||||
var pack_op_ids = self.picking_editor.get_current_op_selection(true);
|
var pack_op_ids = self.picking_editor.get_current_op_selection(true);
|
||||||
if (pack_op_ids.length !== 0){
|
if (pack_op_ids.length !== 0){
|
||||||
new instance.web.Model('stock.pack.operation')
|
return new instance.web.Model('stock.pack.operation')
|
||||||
.call('action_drop_down', [pack_op_ids])
|
.call('action_drop_down', [pack_op_ids])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
return self.refresh_ui(self.picking.id).then(function(){
|
return self.refresh_ui(self.picking.id).then(function(){
|
||||||
|
@ -901,7 +901,7 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
done: function(){
|
done: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.picking')
|
return new instance.web.Model('stock.picking')
|
||||||
.call('action_done_from_ui',[self.picking.id, {'default_picking_type_id': self.picking_type_id}])
|
.call('action_done_from_ui',[self.picking.id, {'default_picking_type_id': self.picking_type_id}])
|
||||||
.then(function(new_picking_ids){
|
.then(function(new_picking_ids){
|
||||||
if (new_picking_ids){
|
if (new_picking_ids){
|
||||||
|
@ -914,7 +914,7 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
create_lot: function(op_id, lot_name){
|
create_lot: function(op_id, lot_name){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.pack.operation')
|
return new instance.web.Model('stock.pack.operation')
|
||||||
.call('create_and_assign_lot',[parseInt(op_id), lot_name])
|
.call('create_and_assign_lot',[parseInt(op_id), lot_name])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
return self.refresh_ui(self.picking.id);
|
return self.refresh_ui(self.picking.id);
|
||||||
|
@ -926,7 +926,7 @@ function openerp_picking_widgets(instance){
|
||||||
if (is_src_dst){
|
if (is_src_dst){
|
||||||
vals = {'location_id': loc_id};
|
vals = {'location_id': loc_id};
|
||||||
}
|
}
|
||||||
new instance.web.Model('stock.pack.operation')
|
return new instance.web.Model('stock.pack.operation')
|
||||||
.call('write',[op_id, vals])
|
.call('write',[op_id, vals])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
return self.refresh_ui(self.picking.id);
|
return self.refresh_ui(self.picking.id);
|
||||||
|
@ -934,7 +934,7 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
print_package: function(package_id){
|
print_package: function(package_id){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.quant.package')
|
return new instance.web.Model('stock.quant.package')
|
||||||
.call('action_print',[[package_id]])
|
.call('action_print',[[package_id]])
|
||||||
.then(function(action){
|
.then(function(action){
|
||||||
return self.do_action(action);
|
return self.do_action(action);
|
||||||
|
@ -942,9 +942,9 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
print_picking: function(){
|
print_picking: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.picking.type').call('read', [[self.picking_type_id], ['code'], new instance.web.CompoundContext()])
|
return new instance.web.Model('stock.picking.type').call('read', [[self.picking_type_id], ['code'], new instance.web.CompoundContext()])
|
||||||
.then(function(pick_type){
|
.then(function(pick_type){
|
||||||
new instance.web.Model('stock.picking').call('do_print_picking',[[self.picking.id]])
|
return new instance.web.Model('stock.picking').call('do_print_picking',[[self.picking.id]])
|
||||||
.then(function(action){
|
.then(function(action){
|
||||||
return self.do_action(action);
|
return self.do_action(action);
|
||||||
});
|
});
|
||||||
|
@ -974,9 +974,9 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
delete_package_op: function(pack_id){
|
delete_package_op: function(pack_id){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.pack.operation').call('search', [[['result_package_id', '=', pack_id]]])
|
return new instance.web.Model('stock.pack.operation').call('search', [[['result_package_id', '=', pack_id]]])
|
||||||
.then(function(op_ids) {
|
.then(function(op_ids) {
|
||||||
new instance.web.Model('stock.pack.operation').call('write', [op_ids, {'result_package_id':false}])
|
return new instance.web.Model('stock.pack.operation').call('write', [op_ids, {'result_package_id':false}])
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return self.refresh_ui(self.picking.id);
|
return self.refresh_ui(self.picking.id);
|
||||||
});
|
});
|
||||||
|
@ -985,7 +985,7 @@ function openerp_picking_widgets(instance){
|
||||||
set_operation_quantity: function(quantity, op_id){
|
set_operation_quantity: function(quantity, op_id){
|
||||||
var self = this;
|
var self = this;
|
||||||
if(quantity >= 0){
|
if(quantity >= 0){
|
||||||
new instance.web.Model('stock.pack.operation')
|
return new instance.web.Model('stock.pack.operation')
|
||||||
.call('write',[[op_id],{'qty_done': quantity }])
|
.call('write',[[op_id],{'qty_done': quantity }])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
self.refresh_ui(self.picking.id);
|
self.refresh_ui(self.picking.id);
|
||||||
|
@ -995,13 +995,13 @@ function openerp_picking_widgets(instance){
|
||||||
},
|
},
|
||||||
set_package_pack: function(package_id, pack){
|
set_package_pack: function(package_id, pack){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.quant.package')
|
return new instance.web.Model('stock.quant.package')
|
||||||
.call('write',[[package_id],{'ul_id': pack }]);
|
.call('write',[[package_id],{'ul_id': pack }]);
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
reload_pack_operation: function(){
|
reload_pack_operation: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
new instance.web.Model('stock.picking')
|
return new instance.web.Model('stock.picking')
|
||||||
.call('do_prepare_partial',[[self.picking.id]])
|
.call('do_prepare_partial',[[self.picking.id]])
|
||||||
.then(function(){
|
.then(function(){
|
||||||
self.refresh_ui(self.picking.id);
|
self.refresh_ui(self.picking.id);
|
||||||
|
|
Loading…
Reference in New Issue