Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- update_product_qty: function(pid){
- var self = this;
- var qty = null
- var def = new $.Deferred();
- var fields = ['qty_available'];
- var context = { 'location': 'Stock', 'compute_child': false };
- var records = new instance.web.Model('product.product').call('read',[pid,fields], {'context': context})
- .then(function(product){
- if (self.db.update_product_qty(product)) {
- qty = product.qty_available;
- def.resolve();
- } else {
- def.reject();
- }
- }, function(err,event){
- event.preventDefault();
- self.pos_widget.screen_selector.show_popup('error-traceback',{
- message: 'Falha ao atualizar as quantidades de produtos, verifique a sua conexão com a internet. Caso você não tenha conexão de internet, tenha cuidado de verificar o estoque manualmente antes de vender!',
- comment: ''
- });
- });
- debugger;
- return qty;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement