# HG changeset patch
# User Prakash M <prakash@qualiantech.com>
# Date 1468563775 -19800
#      Fri Jul 15 11:52:55 2016 +0530
# Node ID f549361a9426395b42828e0d325f78fd5b35901f
# Parent  e68a8a45cd85cd0338ae1b619f16c2455290c9f5
Fixes issue 1334 : Buttons New and Delete are disabled in mandatory Service

diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
@@ -65,8 +65,10 @@
   },
   enableButton: function () {
     if (!this.model.get('leftColumnViewManager').isMultiOrder()) {
-      this.isEnabled = true;
-      this.setDisabled(false);
+      if (OB.UTIL.isNullOrUndefined(OB.MobileApp.model.get('serviceSearchMode')) || !OB.MobileApp.model.get('serviceSearchMode')) {
+        this.isEnabled = true;
+        this.setDisabled(false);
+      }
     }
   },
   disabledButton: function (inSender, inEvent) {
@@ -129,8 +131,10 @@
     this.setDisabled(true);
   },
   enableButton: function () {
-    this.isEnabled = true;
-    this.setDisabled(false);
+    if (OB.UTIL.isNullOrUndefined(OB.MobileApp.model.get('serviceSearchMode')) || !OB.MobileApp.model.get('serviceSearchMode')) {
+      this.isEnabled = true;
+      this.setDisabled(false);
+    }
   },
   disabledButton: function (inSender, inEvent) {
     this.isEnabled = !inEvent.status;
