Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleVendorEdit.js
index 8dc9322..797cec0 100644 (file)
@@ -975,24 +975,24 @@ Pman.Dialog.XtupleVendorEdit = {
                                     listeners : {
                                         click : function()
                                         {
-                                             var s = _this.agrid.getSelectionModel().getSelected();
+                                             var s = _this.form.findField('vend_id').getValue() * 1;
                                              
-                                             if(!s || s.data.vendaddr_id * 1 < 1){
-                                                Roo.MessageBox.alert('Error', 'Please select a row');
+                                             if(!s || s * 1 < 1){
+                                                Roo.MessageBox.alert('Error', 'Save first!');
                                                 return;
                                              }
                                              
-                                             Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete that?",
+                                             Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete all the address?",
                                                 function(v) {
                                                     if (v != 'yes') {
                                                         return;
                                                     }
                                                      new Pman.Request({
                                                         method: 'POST',
-                                                        url: baseURL+ '/Roo/vendaddrinfo',
+                                                        url: baseURL+ '/Roo/vendinfo',
                                                         params : {
-                                                            vendaddr_id : s.data.vendaddr_id,
-                                                            _deleteAll : 1
+                                                            vend_id : s,
+                                                            _remove_addr : 1
                                                         },
                                                         success : function() {
                                                             _this.agrid.footer.onClick('refresh');