Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleSalesProductList.js
index a583d5d..95d8328 100644 (file)
@@ -103,7 +103,10 @@ Pman.Dialog.XtupleSalesProductList = {
                                 {
                                       o.params._with_prodcat = 1;
                                       o.params._with_char = 1;
-                                      o.params._with_itemsrc_active = 1;
+                                      if (!_this.data.exclude_itemsrc_vendor) {
+                                      
+                                          o.params._with_itemsrc_active = 1;
+                                      }
                                       o.params._with_last_purchase_price = 1;
                                       o.params._with_itemsite = 1;
                                       o.params._with_image = 1;
@@ -119,8 +122,15 @@ Pman.Dialog.XtupleSalesProductList = {
                                       var s = _this.searchBox.getValue();
                                       if (s.length) {
                                             o.params['query[number_or_name]'] = s;
-                                        }
-                                
+                                       }
+                                       if (_this.data.exclude_itemsrc_vendor) {
+                                            o.params._exclude_itemsrc_vendor = _this.data.exclude_itemsrc_vendor;
+                                       } 
+                                        
+                                      _this.addSelected.show();
+                                      if (!_this.data.multi_select) {
+                                            _this.addSelected.hide();
+                                      }
                                       
                                 }
                             },
@@ -494,10 +504,10 @@ Pman.Dialog.XtupleSalesProductList = {
                                 return;
                             }
                             var sels = _this.grid.selModel.getSelections();
-                            if (!sels) {
+                            if (!sels.length) {
                                 Roo.MessageBox.alert("Error", "Select some items");
                             }
-                             
+                              _this.dialog.hide();
                             _this.callback.call(_this,sels);
                         },
                         render : function (_self)