Document oCredits = oDms.newDocument(oDms.getDocumentType("CustomerAccountCredits"), oNew.getDocument());
oCredits.attribute("account_id").set(oNew.getString("account_id"));
oCredits.attribute("credits_used").set(0l);
oCredits.attribute("credits_left").set(0l);
oCredits.save("");
oIdx.indexDocument(oCredits);
Log.out.debug("PROFILING: Create CustomerAccount child documents "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
lStart = lEnd;
oNew.grant(oSes, oNew.getDocument(), oOrders, oClients, oPayers);