# HG changeset patch
# User Ranjith S R <ranjith@qualiantech.com>
# Date 1477553577 -19800
#      Thu Oct 27 13:02:57 2016 +0530
# Node ID 9c91b02c462f2582ad628ca2862645c85d5ddbdf
# Parent  4a4b378bc6f66052771ec737eaf4ab1f6aa4a38c
Related to issue 34285 : Validate Businesspartner loaded attr for save/update record in db

diff -r 4a4b378bc6f6 -r 9c91b02c462f web/org.openbravo.retail.posterminal/js/data/datacustomersave.js
--- a/web/org.openbravo.retail.posterminal/js/data/datacustomersave.js	Thu Oct 27 17:21:04 2016 +0530
+++ b/web/org.openbravo.retail.posterminal/js/data/datacustomersave.js	Thu Oct 27 13:02:57 2016 +0530
@@ -65,7 +65,11 @@
         customer.set('posTerminal', OB.MobileApp.model.get('terminal').id);
         var now = new Date();
         customer.set('timezoneOffset', now.getTimezoneOffset());
-        customer.set('loaded', OB.I18N.normalizeDate(new Date(customer.get('loaded'))));
+        if (OB.UTIL.isNullOrUndefined(customer.get('loaded'))) {
+          customer.set('loaded', OB.I18N.normalizeDate(new Date()));
+        } else {
+          customer.set('loaded', OB.I18N.normalizeDate(new Date(customer.get('loaded'))));
+        }
         bpToSave.set('json', JSON.stringify(this.customer.serializeEditedToJSON()));
         bpToSave.set('c_bpartner_id', this.customer.get('id'));
       } else {
