Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. update_product_qty: function(pid){
  2. var self = this;
  3. var qty = null
  4. var def = new $.Deferred();
  5. var fields = ['qty_available'];
  6. var context = { 'location': 'Stock', 'compute_child': false };
  7.  
  8. var records = new instance.web.Model('product.product').call('read',[pid,fields], {'context': context})
  9. .then(function(product){
  10. if (self.db.update_product_qty(product)) {
  11. qty = product.qty_available;
  12. def.resolve();
  13. } else {
  14. def.reject();
  15. }
  16. }, function(err,event){
  17. event.preventDefault();
  18. self.pos_widget.screen_selector.show_popup('error-traceback',{
  19. 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!',
  20. comment: ''
  21. });
  22. });
  23. debugger;
  24. return qty;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement