Package org.openbravo.model.ad.system

Examples of org.openbravo.model.ad.system.Client


   */
  public void testADataAccessLevel() {
    setUserContext("0");
    final List<Entity> entities = ModelProvider.getInstance().getModel();
    final StringBuilder sb = new StringBuilder();
    final Client clientZero = OBDal.getInstance().get(Client.class, "0");
    final Organization orgZero = OBDal.getInstance().get(Organization.class, "0");
    for (Entity e : entities) {
      final StringBuilder where = new StringBuilder();
      final List<Object> params = new ArrayList<Object>();
      if (e.getAccessLevel() == AccessLevel.ALL) {
View Full Code Here


  /**
   * Tests the Client Organization access level.
   */
  public void testAccessLevelCO() {
    setBigBazaarAdminContext();
    final Client c = OBDal.getInstance().get(Client.class, "0");

    final BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, "1000005");
    bp.setClient(c);
    try {
      commitTransaction();
View Full Code Here

    String xml = getXML(gs);

    // change the xml to force an update
    xml = xml.replaceAll("</name>", "t</name>");

    final Client c = OBDal.getInstance().get(Client.class, "1000000");
    final Organization o = OBDal.getInstance().get(Organization.class, "1000000");
    setUserContext("1000000");
    OBContext.getOBContext().setCurrentOrganization(o);
    OBContext.getOBContext().setCurrentClient(c);
View Full Code Here

    String xml = getXML(ws);

    // change the xml to force an update
    xml = xml.replaceAll("</name>", "t</name>");
    xml = xml.replaceAll("</id>", "new</id>");
    final Client c = OBDal.getInstance().get(Client.class, "1000001");
    final Organization o = OBDal.getInstance().get(Organization.class, "1000001");
    setUserContext("1000019");

    // remove the entity from the writable entities to force an access error
    final Entity entity = ModelProvider.getInstance().getEntity(Warehouse.class);
View Full Code Here

    final OBQuery<TreeNode> nodes = OBDal.getInstance().createQuery(TreeNode.class,
        "client.id='" + newClientID + "'");
    nodes.setFilterOnReadableClients(false);
    nodes.setFilterOnReadableOrganization(false);
    assertTrue(nodes.list().size() > 0);
    final Client newClient = OBDal.getInstance().get(Client.class, newClientID);

    boolean testDoneAtLeastOnce = false;
    for (TreeNode node : nodes.list()) {
      assertEquals(newClient, node.getClient());
      // also ignore 0 as there is a business partner/sales region tree node with 0
View Full Code Here

    final OBQuery<AccountingFact> facts = OBDal.getInstance().createQuery(AccountingFact.class,
        "client.id='" + newClientID + "'");
    facts.setFilterOnReadableClients(false);
    facts.setFilterOnReadableOrganization(false);
    assertTrue(facts.list().size() > 0);
    final Client newClient = OBDal.getInstance().get(Client.class, newClientID);
    boolean testDoneAtLeastOnce = false;
    for (AccountingFact fact : facts.list()) {
      assertEquals(newClient, fact.getClient());
      if (fact.getRecordID() != null) {
        final BaseOBObject bob = OBDal.getInstance().get(fact.getTable().getName(),
View Full Code Here

  // https://issues.openbravo.com/view.php?id=8509
  private void testMantis8509(String clientId) {
    setUserContext("0");
    final OrganizationStructureProvider osp = new OrganizationStructureProvider();
    osp.setClientId(clientId);
    final Client client = OBDal.getInstance().get(Client.class, clientId);
    final OBCriteria<Organization> os = OBDal.getInstance().createCriteria(Organization.class);
    os.setFilterOnReadableClients(false);
    os.setFilterOnReadableOrganization(false);
    os.setFilterOnActive(false);
    os.add(Expression.eq("client", client));
View Full Code Here

   */
  public void testImportNoUpdate() {
    setUserContext("100");

    final String xml = exportTax();
    final Client c = OBDal.getInstance().get(Client.class, "1000000");
    final Organization o = OBDal.getInstance().get(Organization.class, "1000000");
    final ImportResult ir = DataImportService.getInstance().importDataFromXML(c, o, xml);

    log.debug("WARNING>>>>");
    assertTrue(ir.getWarningMessages(), ir.getWarningMessages() == null);
View Full Code Here

   * Checks mantis issue 6212, issue text: When inserting reference data using DAL into ad_client 0
   * it should not generate new uuids but maintain the current ids but it is doing so.
   */
  public void testMantis6212() {
    cleanRefDataLoaded();
    final Client c = OBDal.getInstance().get(Client.class, "1000000");
    final Organization o = OBDal.getInstance().get(Organization.class, "1000000");
    setUserContext("1000000");

    addReadWriteAccess(Greeting.class);

View Full Code Here

   * dal trims the blank spaces so in case the column contains only blank spaces it is treated as
   * null.
   */
  public void testMantis6213() {
    cleanRefDataLoaded();
    final Client c = OBDal.getInstance().get(Client.class, "1000000");
    final Organization o = OBDal.getInstance().get(Organization.class, "1000000");
    setUserContext("1000000");
    addReadWriteAccess(UOM.class);

    final List<UOM> uoms = getList(UOM.class);
View Full Code Here

TOP

Related Classes of org.openbravo.model.ad.system.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.