Giter Club home page Giter Club logo

axelor-open-platform's People

Contributors

beuss avatar dtr-axelor avatar florentpruneta avatar fsc-axelor avatar gdu-axelor avatar itsmemyk08 avatar jmi-axelor avatar lde-axelor avatar mam-axelor avatar pbe-axelor avatar pdo-axelor avatar tbo-axelor avatar wtflay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

axelor-open-platform's Issues

Collections should be initialized

Entities collections are null upon creation which can lead to NPE in almost any manipulation in first save transaction.
Collections should either be initialized in generated constructor/fields or should be lazily initialized in getters (I'll opt for the first one)
Let me know if you want a PR on this

Fallback to database login when LDAP fails

Use Case

As an administrator, I would like to be able to authenticate through the database users even when LDAP is enabled in order to have an independent administrator for Axelor.

Version

Tested with ABS 4.2.3, built with ADK 4.1.8

Reproduce the Error

Keep the default users from Axelor or create some manually.
Enable LDAP authentication as described in documentation.
Try to authenticate with the database user. You will see in the logs a LDAP authentication failed for user: {} even if the login/password used is correct.

Suggest a Fix

When trying LDAP authentication, instead of directly returning the result, we could store it.

https://github.com/axelor/axelor-development-kit/blob/f72c2f1a5f26d184dce2d21a1294d00776f889b3/axelor-core/src/main/java/com/axelor/auth/AuthRealm.java#L56

If the result is null and fallback is enabled (new app parameter), then attempt regular authentication.

https://github.com/axelor/axelor-development-kit/blob/f72c2f1a5f26d184dce2d21a1294d00776f889b3/axelor-core/src/main/java/com/axelor/auth/AuthRealm.java#L63

Ask a question

Ask a question: grid binding pojo is not an entity. Thx

Build failure

Build from source with instructions from https://docs.axelor.com/abs/5.0/install/source/linux.html

Result:
...
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'axelor-erp'.

Could not resolve all files for configuration ':classpath'.
Could not resolve com.axelor:axelor-gradle:5.0.+.
Required by:
project :
> Could not resolve com.axelor:axelor-gradle:5.0.+.
> Failed to list versions for com.axelor:axelor-gradle.
> Unable to load Maven meta-data from https://repository.axelor.com/nexus/public/com/axelor/axelor-gradle/maven-metadata.xml.
> Could not get resource 'https://repository.axelor.com/nexus/public/com/axelor/axelor-gradle/maven-metadata.xml'.
> Could not GET 'https://repository.axelor.com/nexus/public/com/axelor/axelor-gradle/maven-metadata.xml'.
> Received fatal alert: handshake_failure

ADK 5.0 problem getting the bin/axelor

I cloned this repo and first found out that ./gradlew installApp was not among the task list. Second, the test could skipped by doing ./gradlew build -x test , however, I don´t seem to get a bin directory nor the wrapper bin/axelor command for me to start building apps and modules etc.

How do you achieve this in this version?.

SQL Exception when LDAP group integration enabled

Use Case

When enabling all LDAP integration properties and in particular ldap.group.object.class, a new user cannot log into Axelor due to a SQL exception.

Overview of the issue

See stacktrace:

2018-02-28 23:29:23,474 [http-nio-8080-exec-4] WARN  com.axelor.auth.AuthLdap$$EnhancerByGuice$$b039c410 - more then one groups defined.
2018-02-28 23:29:23,474 [http-nio-8080-exec-4] DEBUG org.apache.shiro.realm.ldap.JndiLdapContextFactory - Initializing LDAP context using URL [ldaps://ldap.domain.com:636] and principal [cn=admin,dc=ldap,dc=domain,dc=com] with pooling enabled
2018-02-28 23:29:23,539 [http-nio-8080-exec-4] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: syntax error at or near ")"
  Position : 481
2018-02-28 23:29:23,541 [http-nio-8080-exec-4] WARN  com.axelor.auth.AuthLdap$$EnhancerByGuice$$b039c410 - unable to create ldap groups
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:277)
        at com.axelor.db.Query.fetch(Query.java:244)
        at com.axelor.db.Query.fetch(Query.java:211)
        at com.axelor.auth.AuthLdap.createLdapGroups(AuthLdap.java:291)
        at com.axelor.auth.AuthLdap.findOrCreateUser(AuthLdap.java:216)
        at com.axelor.auth.AuthLdap.doLogin(AuthLdap.java:167)
        at com.axelor.auth.AuthLdap.login(AuthLdap.java:147)
        at com.axelor.auth.AuthLdap$$EnhancerByGuice$$b039c410.CGLIB$login$3(<generated>)
        at com.axelor.auth.AuthLdap$$EnhancerByGuice$$b039c410$$FastClassByGuice$$d5426031.invoke(<generated>)
        at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
        at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
        at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70)
        at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
        at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
        at com.axelor.auth.AuthLdap$$EnhancerByGuice$$b039c410.login(<generated>)
        at com.axelor.auth.AuthService.ldapLogin(AuthService.java:119)
        at com.axelor.auth.AuthRealm.doGetAuthenticationInfo(AuthRealm.java:88)
        at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:568)
        at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doSingleRealmAuthentication(ModularRealmAuthenticator.java:180)
        at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:267)
        at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
        at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
        at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:270)
        at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
        at org.apache.shiro.web.filter.authc.AuthenticatingFilter.executeLogin(AuthenticatingFilter.java:53)
        at org.apache.shiro.web.filter.authc.FormAuthenticationFilter.onAccessDenied(FormAuthenticationFilter.java:154)
        at com.axelor.auth.AuthFilter.onAccessDenied(AuthFilter.java:106)
        at org.apache.shiro.web.filter.AccessControlFilter.onAccessDenied(AccessControlFilter.java:133)
        at org.apache.shiro.web.filter.AccessControlFilter.onPreHandle(AccessControlFilter.java:162)
        at org.apache.shiro.web.filter.PathMatchingFilter.isFilterChainContinued(PathMatchingFilter.java:203)
        at org.apache.shiro.web.filter.PathMatchingFilter.preHandle(PathMatchingFilter.java:178)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:131)
        at com.axelor.auth.AuthFilter.doFilterInternal(AuthFilter.java:81)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.app.internal.AppFilter.doFilter(AppFilter.java:84)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.axelor.web.servlet.CorsFilter.doFilter(CorsFilter.java:135)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
        at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
        at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:88)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:2062)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1859)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
        at org.hibernate.loader.Loader.doQuery(Loader.java:906)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
        at org.hibernate.loader.Loader.doList(Loader.java:2550)
        at org.hibernate.loader.Loader.doList(Loader.java:2536)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
        at org.hibernate.loader.Loader.list(Loader.java:2361)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1230)
        at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:268)
        ... 70 more
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
  Position : 481
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2270)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1998)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:305)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:116)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
        ... 85 more
2018-02-28 23:29:23,545 [http-nio-8080-exec-4] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: current transaction is aborted, commands ignored until end of transaction block

Version

Tested with Axelor Business Suite 4.0.0 and 4.1.0.

Browsers and Operating System

Does not depend on the browser.
ABS is using a postgresql 9.5, tomcat 8 and is linked to a OpenLDAP 2.4.

Suggestion

The issue seems to be coming from AuthLdap.java but I did not see what might be the root cause for this.
Would need to reproduce locally and extract the query generated... but don't have the time for that now.

Potential security breach

Hi,

I'm currently developing using ADK and it seems to me that there's a serious security issue wrt action-validate than can be easily bypassed. If you put them in an action-group (containing eg my-validate-action and sensitive-action), any triggered error will stop the process, fine. But if you then copy the request as a cURL one (easy with chrome dev tools) and change requested action for the target one (here sensitive-action), the action is executed.
I am misusing something? should all action-validate be duplicated on controller side (very sad considering that ADK target is to leverage boilerplate).
If am right, a "simple" fix would be to add a web-callable attribute on actions which would only allow them to be invoked from the framework, not from the web client. In a ideal world this would default to false but to keep compatibility with legacy code I guess it should default to false.

Regards

Transient fields cannot be displayed in grids

When a field is declared as transient, it cannot be displayed on grids because of the use of a Selector that remove transient fields from Select. This should be either documented or the selector should be fixed to select self if any transient field is asked (fields could be filtered afterwards)

Security Issue!! Installing Apps with none admin user

First i login in ERP with admin user and navigate to module Apps management (http://localhost:8088/#/ds/admin.root.app.management/cards).

After that i copied a link above and same link open in other browser windows with incognito/privacy or other browser and logged as simple CRM user (example: democrm)

after signed i was able to see content of Apps management and not only but also with this user i was able to install Apps Module and edit content
apps_management

axelor-development-kit Compile error

axelor-core\src\main\java\com\axelor\rpc\ContextHandler.java:316:
value = Collections2.transform((Collection) value, transform::apply); axelor-core\src\main\java\com\axelor\rpc\JsonContext.java:196: .collect(Collectors.toList()); axelor-core\src\main\java\com\axelor\meta\schema\actions\ActionView.java:201: return item instanceof Model && JPA.em().contains(item) ? Resource.toMapCompact(item) : item; axelor-core\src\main\java\com\axelor\rpc\Resource.java:727 value = Collections2.transform((Collection) value, input -> toMap(input, names));

HOTSWAP AGENT ERROR

Use the " gradlew --no-daemon run --hot --debug-jvm " command to start the axelor project, modify the java file, can not be loaded, consistently the following error, system win10, jdk 1.8.0_191-b12

Configuration reference: https://docs.axelor.com/adk/5.0/dev-guide/application/develop.html

image
HOTSWAP AGENT: 18:15:30.234 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@305c8c', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java___jb_tmp___'
HOTSWAP AGENT: 18:15:30.261 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@396556', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@188b1d6', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@1553a67', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java___jb_old___'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@1b1c63d', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@911248', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java___jb_tmp___'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@7d010d', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@f58ca7', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@16c2aaa', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web\ProductBillApplyController.java___jb_old___'
HOTSWAP AGENT: 18:15:30.314 ERROR (org.hotswap.agent.watch.nio.EventDispatcher) - No match for watch event 'sun.nio.fs.AbstractWatchKey$Event@143709d', path 'D:\BAT\bats_admin\modules\bat-product\src\main\java\com\jeff\bat\product\web'

I18nBundle should override containsKey

If a given key does not exists in the translation, the key itself is returned (as per handleGetObject implementation), however, when using containsKey, parent bundle (empty locale) is checked triggering a dummy load, which can be problematic when using the bundle in a JPA.jdbcWork block.

Job - How to login

Hello,

I've created a Quartz job, and I'd like it to run authenticated.

I've tried to manually login :

 UsernamePasswordToken token = new UsernamePasswordToken("user", "password");

            final Subject subject = SecurityUtils.getSubject();
            try {
                subject.login(token);
            } catch (AuthenticationException e) {
                throw e;
            }

But I get an exception :

Caused by: java.lang.IllegalArgumentException: SessionContext must be an HTTP compatible implementation.

I searched for a solution and realized that I should override Shiro's session Manager to use a DefaultWebSessionManager instance, instead of the ServletContainerSessionManager used by default. But I can't figure out how to do it.

How can I make my job to run authenticated ?

Thanks.
Best regards,

BPM embeded, how to?.

Is there a practical example on how to use Camunda or Activiti BPM along with Axelor Framework? or is there any other Embedded BPM We can use?

War Install on Archlinux: "One or more Filters failed to start."

Hello and than you for Axelor

I tried the WAR install on Archlinux. Full details below.

Best wishes

[catalina.2020-07-19.log](https://github.com/axelor/axelor-open-platform/files/4943930/catalina.2020-07-19.log)
[localhost.2020-07-19.log](https://github.com/axelor/axelor-open-platform/files/4943931/localhost.2020-07-19.log)


Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
19-Jul-2020 23:34:08.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/10.0.0-M7
19-Jul-2020 23:34:08.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jun 30 2020 17:11:04 UTC
19-Jul-2020 23:34:08.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.0.0.0
19-Jul-2020 23:34:08.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
19-Jul-2020 23:34:08.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.7.0-3-MANJARO
19-Jul-2020 23:34:08.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
19-Jul-2020 23:34:08.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk/jre
19-Jul-2020 23:34:08.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_252-b09
19-Jul-2020 23:34:08.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
19-Jul-2020 23:34:08.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat
19-Jul-2020 23:34:08.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
19-Jul-2020 23:34:08.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
19-Jul-2020 23:34:08.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
19-Jul-2020 23:34:08.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
19-Jul-2020 23:34:08.567 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
19-Jul-2020 23:34:08.849 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
19-Jul-2020 23:34:08.873 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [454] milliseconds
19-Jul-2020 23:34:08.914 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
19-Jul-2020 23:34:08.915 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.0.0-M7]
19-Jul-2020 23:34:08.918 SEVERE [main] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/tomcat/conf/Catalina/localhost]
19-Jul-2020 23:34:08.923 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
19-Jul-2020 23:34:09.132 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [208] ms
19-Jul-2020 23:34:09.132 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
19-Jul-2020 23:34:09.346 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [214] ms
19-Jul-2020 23:34:09.347 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
19-Jul-2020 23:34:09.382 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [36] ms
19-Jul-2020 23:34:09.383 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
19-Jul-2020 23:34:09.399 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [16] ms
19-Jul-2020 23:34:09.400 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/axelor]
19-Jul-2020 23:34:18.388 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
19-Jul-2020 23:34:18.393 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
19-Jul-2020 23:34:18.393 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/axelor] startup failed due to previous errors
19-Jul-2020 23:34:18.406 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/axelor] has finished in [9,006] ms
19-Jul-2020 23:34:18.407 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
19-Jul-2020 23:34:18.423 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [16] ms
19-Jul-2020 23:34:18.430 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
19-Jul-2020 23:34:18.448 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [9575] milliseconds
^C19-Jul-2020 23:35:36.554 INFO [Thread-3] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
19-Jul-2020 23:35:36.566 INFO [Thread-3] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
19-Jul-2020 23:35:36.592 INFO [Thread-3] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
19-Jul-2020 23:35:36.619 INFO [Thread-3] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
[user@tower tomcat]$ ^C
[user@tower tomcat]$ ^C
[user@tower tomcat]$ ^C
[user@tower tomcat]$ ^C
[user@tower tomcat]$ ^C
[user@tower tomcat]$ ^C
[user@tower tomcat]$ systemctl status postgresql
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
     Active: active (running) since Sun 2020-07-19 20:26:11 WITA; 3h 9min ago
    Process: 13855 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=0/SUCCESS)
   Main PID: 13857 (postgres)
      Tasks: 7 (limit: 9134)
     Memory: 25.6M
     CGroup: /system.slice/postgresql.service
             ├─13857 /usr/bin/postgres -D /var/lib/postgres/data
             ├─13860 postgres: checkpointer
             ├─13861 postgres: background writer
             ├─13862 postgres: walwriter
             ├─13863 postgres: autovacuum launcher
             ├─13864 postgres: stats collector
             └─13865 postgres: logical replication launcher

Jul 19 20:32:08 tower postgres[14274]: 2020-07-19 20:32:08.234 WITA [14274] FATAL:  database "axelor" does not exist
Jul 19 20:32:31 tower postgres[14371]: 2020-07-19 20:32:31.025 WITA [14371] FATAL:  database "axelor" does not exist
Jul 19 20:32:55 tower postgres[14409]: 2020-07-19 20:32:55.970 WITA [14409] FATAL:  database "axelor" does not exist
Jul 19 22:10:08 tower postgres[418399]: 2020-07-19 22:10:08.377 WITA [418399] FATAL:  database "axelor" does not exist
Jul 19 23:19:14 tower postgres[421357]: 2020-07-19 23:19:14.429 WITA [421357] ERROR:  role "axelor" already exists
Jul 19 23:19:14 tower postgres[421357]: 2020-07-19 23:19:14.429 WITA [421357] STATEMENT:  CREATE ROLE axelor NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
Jul 19 23:31:17 tower postgres[422102]: 2020-07-19 23:31:17.896 WITA [422102] ERROR:  role "axelor" already exists
Jul 19 23:31:17 tower postgres[422102]: 2020-07-19 23:31:17.896 WITA [422102] STATEMENT:  CREATE ROLE axelor NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
Jul 19 23:33:19 tower postgres[422448]: 2020-07-19 23:33:19.443 WITA [422448] FATAL:  database "axelor" does not exist
Jul 19 23:33:37 tower postgres[422458]: 2020-07-19 23:33:37.908 WITA [422458] FATAL:  database "axelor" does not exist
[user@tower tomcat]$ javac -version
javac 1.8.0_252
[user@tower tomcat]$ gradle --version

------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-25 09:21:03 UTC
Revision:     <unknown>

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_252 (Oracle Corporation 25.252-b09)
OS:           Linux 5.7.0-3-MANJARO amd64

[user@tower tomcat]$ archlinux-java status
Available Java environments:
  java-8-openjdk (default)

Update JDBC driver for PostgreSQL

Hi,
With recent version of PostgreSQL (>= 10) the default schema for password is «scram-sha-256».
But with the JDBC driver version used in Axelor doesn't support it : axelor-open-platform/gradle/libs.gradle line 85
libs.jdbc_postgres = "org.postgresql:postgresql:42.0.0"

It need, at least, the version 42.2.0 (2018-01-17) to support this authentication method. Currently the last version of the driver is 42.2.10.

There plan to update this lib ?
Thx

axelor is not recognised

I followed following steps

Windows
In this chapter we will see how to prepare the development environment on Windows operating system for working with Axelor Development Kit sources.

Prerequisite

JDK 1.7
PostgreSQL 9.x
Git for Windows
JDK

Download the JDK installer from the above link and install on your system.

Once installed, set the environment variables as follows:

set JAVA_HOME=C:\path\to\jdk
set PATH=%JAVA_HOME%\bin;%PATH%
Generally, the JDK installer sets these variables. So skip if it’s done.

PostgreSQL

Download the PostgreSQL from the above link and install on your system.

Git for Windows

Install the Git for windows from the above link.

Installation

Download the latest distribution package from https://github.com/axelor/axelor-development-kit/releases and extract the package somewhere and set following environment variables.

set AXELOR_HOME=C:\path\to\axelor-adk
set PATH=%AXELOR_HOME%\bin;%PATH%
or you can build from the latest source like this:

git clone https://github.com/axelor/axelor-development-kit.git
cd axelor-development-kit
gradlew installApp
set AXELOR_HOME=C:\path\to\axelor-development-kit\build\install\axelor-development-kit
set PATH=%AXELOR_HOME$\bin;%PATH%
You should have a special command `axelor' in your path now. Just try issuing following command on the terminal:

axelor --help

But still it results to

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\lenovo>git
usage: git [--version] [--help] [-C ] [-c name=value]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status

grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
tag Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help ' or 'git help '
to read about a specific subcommand or concept.

C:\Users\lenovo> git clone https://github.com/axelor/axelor-development-kit.git
Cloning into 'axelor-development-kit'...
remote: Counting objects: 74034, done.
remote: Total 74034 (delta 0), reused 0 (delta 0), pack-reused 74034
Receiving objects: 100% (74034/74034), 14.19 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (42382/42382), done.

C:\Users\lenovo>cd axe-development-kit
The system cannot find the path specified.

C:\Users\lenovo>cd axelor-development-kit

C:\Users\lenovo\axelor-development-kit>gradlew installApp
:buildSrc:clean UP-TO-DATE
:buildSrc:axelor-common:clean UP-TO-DATE
:buildSrc:axelor-gradle:clean UP-TO-DATE
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy SKIPPED
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar
:buildSrc:assemble
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:axelor-common:updateVersion SKIPPED
:buildSrc:axelor-common:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:buildSrc:axelor-common:processResources
:buildSrc:axelor-common:classes
:buildSrc:axelor-common:jar
:buildSrc:axelor-gradle:compileJava UP-TO-DATE
:buildSrc:axelor-gradle:compileGroovy
:buildSrc:axelor-gradle:processResources
:buildSrc:axelor-gradle:classes
:buildSrc:axelor-gradle:jar
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build
:buildSrc:axelor-common:assemble
:buildSrc:axelor-common:compileTestJava
:buildSrc:axelor-common:processTestResources
:buildSrc:axelor-common:testClasses
:buildSrc:axelor-common:test SKIPPED
:buildSrc:axelor-common:check UP-TO-DATE
:buildSrc:axelor-common:build
:buildSrc:axelor-gradle:assemble
:buildSrc:axelor-gradle:compileTestJava
:buildSrc:axelor-gradle:compileTestGroovy UP-TO-DATE
:buildSrc:axelor-gradle:processTestResources
:buildSrc:axelor-gradle:testClasses
:buildSrc:axelor-gradle:test SKIPPED
:buildSrc:axelor-gradle:check UP-TO-DATE
:buildSrc:axelor-gradle:build
:axelor-common:updateVersion SKIPPED
:axelor-common:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:axelor-common:processResources
:axelor-common:classes
:axelor-common:jar
:axelor-shell:compileJava
:axelor-shell:processResources
:axelor-shell:classes
:axelor-shell:jar
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar SKIPPED
:axelor-common:generatePomFileForMavenJavaPublication
:axelor-common:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-common/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven)
:axelor-common:publish
:axelor-core:generatePomFileForMavenJavaPublication
:axelor-core:generateCode
:axelor-core:licenseFormatGenerated
:axelor-core:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:axelor-core:processResources
:axelor-core:classes
:axelor-core:jar
:axelor-core:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-core/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven/)
:axelor-core:publish
:axelor-gradle:compileJava UP-TO-DATE
:axelor-gradle:compileGroovy
:axelor-gradle:processResources
:axelor-gradle:classes
:axelor-gradle:jar
:axelor-gradle:dist
:axelor-gradle:generatePomFileForMavenJavaPublication
:axelor-gradle:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-gradle/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven/)
:axelor-gradle:publish
:axelor-shell:generatePomFileForMavenJavaPublication
:axelor-shell:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-shell/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven/)
:axelor-shell:publish
:axelor-test:generatePomFileForMavenJavaPublication
:axelor-test:compileJava
:axelor-test:processResources UP-TO-DATE
:axelor-test:classes
:axelor-test:jar
:axelor-test:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-test/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven/)
:axelor-test:publish
:axelor-web:generatePomFileForMavenJavaPublication
:axelor-web:generateCode
:axelor-web:licenseFormatGenerated UP-TO-DATE
:axelor-web:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:axelor-web:processResources
:axelor-web:classes
:axelor-web:jar
:axelor-web:publishMavenJavaPublicationToAdkRepository
Could not find metadata com.axelor:axelor-web/maven-metadata.xml in remote (file:/C:/Users/lenovo/axelor-development-kit/build/dist/maven/)
:axelor-web:publish
:repo
:startScripts
:installApp
The installApp task has been deprecated and is scheduled to be removed in Gradle 3.0. Please use the installDist task instead.

BUILD SUCCESSFUL

Total time: 2 mins 23.105 secs
C:\Users\lenovo\axelor-development-kit> set AXELOR_HOME=C:\Users\lenovo\axelor-development-kit\build\install\axelor-development-kit

C:\Users\lenovo\axelor-development-kit>set PATH=%AXELOR_HOME$\bin;%PATH%

C:\Users\lenovo\axelor-development-kit>axelor --help
'axelor' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\lenovo\axelor-development-kit>

Mail panel and responsive

Hi,

In responsive mode, panel-mail is place like standard panel. When we have panel sidebar and panel mail in main panel, panel mail is in the middle of the responsive page. I would like mail-panel at the bottom in responsive and keep my current form. Is it possible ?

ADK Version used: 5.0

File upload

how to use a file selector to upload a file on form view?

mysql delete from subselect

2018-03-05 09:37:51.128 DEBUG 6113 --- [ main] org.hibernate.SQL : delete from meta_view_custom where id in (select metaviewcu1_.id from meta_view_custom metaviewcu1_ where metaviewcu1_.name=?)
2018-03-05 09:37:51.135 DEBUG 6113 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : could not execute statement [n/a]
java.sql.SQLException: You can't specify target table 'meta_view_custom' for update in FROM clause
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2501)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:205)
at org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:90)
at org.hibernate.hql.internal.ast.exec.BasicExecutor.execute(BasicExecutor.java:59)
at org.hibernate.hql.internal.ast.exec.DeleteExecutor.execute(DeleteExecutor.java:110)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:437)
at org.hibernate.engine.query.spi.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:374)
at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1510)
at org.hibernate.query.internal.AbstractProducedQuery.doExecuteUpdate(AbstractProducedQuery.java:1526)
at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1504)
at com.axelor.db.Query.delete(Query.java:457)
at com.axelor.meta.service.MetaService.removeCustomViews(MetaService.java:491)
at com.axelor.meta.service.MetaService$$EnhancerByGuice$$a82ea333.CGLIB$removeCustomViews$3()
at com.axelor.meta.service.MetaService$$EnhancerByGuice$$a82ea333$$FastClassByGuice$$26469b0.invoke()
at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76)
at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:62)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
at com.axelor.meta.service.MetaService$$EnhancerByGuice$$a82ea333.removeCustomViews()
at com.axelor.meta.loader.ViewLoader.importView(ViewLoader.java:247)
at com.axelor.meta.loader.ViewLoader.importView(ViewLoader.java:178)
at com.axelor.meta.loader.ViewLoader.process(ViewLoader.java:156)
at com.axelor.meta.loader.ViewLoader.doLoad(ViewLoader.java:115)

Number formatting pattern

Hi,

Some time ago I identified that Axelor only works with locales without the variant as (pt, en) and not (en_us, pt_br), I even suggested changes about it because Brazilian Portuguese is different from Portuguese used in Europe (Portugual) .

After studying the code and doing tests I was able to implement language modifications without needing this change, I simply created a personalized module with a messages_pt.csv with only the words that are meaningless in Brazil, this allows me to use in Brazil without users being in doubt of the meaning.

However, I noticed another effect of using locales only with the language prefix and not with the variant. Values ​​are shown with the thousands separator (,) and decimal (.), While in Brazil the thousands separator is (.) And the decimal a (,).
A suggestion that would perhaps simplify this without causing changes in the way the locale is created would be the number formatting to be loaded from the configuration, the same is done with the date formation.

Use generic and not Object on event

When we are using event, we don't know what is what. So, I suggest to add a generic part, to make it change for each event that we are using.
For example, set argument of method "PostRequest<Fetch>" and so, have full and easy use of Events API. Because, now it's difficult to know what return what (if it's a list, a map, an object ...)

IN () returns all items

The criteria WS removes IN filter when the list of values is empty :
Resource - Searching 'com.axelor.apps.territory.db.Commune' with {criteria=[{fieldName=commune.id, operator=IN, value=[]}], operator=and} Resource - JPQL: SELECT new List(self.id, self.version, self.id, self.name, self.inseeCode, _department_company) FROM Commune self LEFT JOIN self.department _department LEFT JOIN _department.company _department_company ORDER BY self.id, self.id Resource - Records found: 36758

Than query should return an empty set, but instead it returns all the rows.

Small bug in AppSettings

Hello,

This is a small bug that I believe has not caused any problems yet, but as I am studying the code I have just found this error and I believe it is useful to make the correction so that there are no problems in the future.

class AppSettings the sub function replace month in wrong way

https://github.com/axelor/axelor-development-kit/blob/b41fc083ed10a348ce7fba0f60aaf6e8486f3640/axelor-core/src/main/java/com/axelor/app/AppSettings.java#L121

In Calendar object the month is zero indexed só the correct is

.replace("{month}", "" + (cal.get(Calendar.MONTH) + 1))

Support for languages with country variation.

Hello,

I started some tests with Axelor and I think it's an incredible product.
As a first step to use it in my country, Brazil, I went to check what it would take to create the translation into Brazilian Portuguese.
Axelor has support for Portuguese in the European variant but it is quite different from the Brazilian Portuguese and we have great difficulty understanding the European Portuguese, so the translation is an important step for use here in Brazil.

Studying the Axelor development kit I checked how the i18n files are loaded into the database and the way they are used later in the bundle and the locale definition.

I realized that the definition of the locale could generate a problem for the portguês brazil, or other locales that use the Region / Country.

The acronyms of locale with country follow a pt_BR or pt-BR format (IETF BCP 47)

The initialization of these locales in java should be done following the calls as an example in pt_BR.

Locale locale = new Locale ("pt", "BR");

or in the case of IETF BCP 47

Locale locale = Locale.forLanguageTag(“pt-BR");

In Axelor core AppFilter the locale is initialized always in constructor.

https://github.com/axelor/axelor-development-kit/blob/b41fc083ed10a348ce7fba0f60aaf6e8486f3640/axelor-core/src/main/java/com/axelor/app/internal/AppFilter.java#L47

https://github.com/axelor/axelor-development-kit/blob/b41fc083ed10a348ce7fba0f60aaf6e8486f3640/axelor-core/src/main/java/com/axelor/app/internal/AppFilter.java#L59

This way if the language is set with the country variant as "pt_br" the call would look like this.

Locale locale = new Locale (“pt_br");

Although this call does not generate errors for the java it does not load this locale in a valid way and starts to treat the definition as locale “en" for all cases of formatting, for example of dates and values.

So as a first step to allow correct use in languages ​​that include country code must be made adjustments in this code.

Also the class I18nBundle attempts to localize the translation using locale.getLanguage(), in the case of a properly initialized locale this method will return only the language code and not the country code.

this way I suggest the exchange of the call

https://github.com/axelor/axelor-development-kit/blob/b41fc083ed10a348ce7fba0f60aaf6e8486f3640/axelor-core/src/main/java/com/axelor/i18n/I18nBundle.java#L83

by the call

final String lang = locale.toString().toLowerCase();

The locale's toString() call would return "pt_BR" in locale cases with country and only "pt" in cases where they have not set the country code. The call to toLowerCase would be useful because postgres, for example, makes case-sensitive queries.

How to deploy abs-webapp on jboss eap 7

As I have seen on the home page there is said that adk has support for jboss, but I can not install successfully.

There are many error messages as follows:

16:30:12,844 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("full-replace-deployment")
failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit."abs-webapp-4.0.0.war#persistenceUnit"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit."abs-webapp-4.0.0.war#persistenceUnit": org.hibernate.AnnotationException:
@OnetoOne or @manytoone on com.axelor.apps.base.db.Company.address references an unknown entity: com.axelor.apps.base.db.Address
Caused by: org.hibernate.AnnotationException: @OnetoOne or @manytoone on com.axelor.apps.base.db.Company.address references an unknown entity: com.axelor.apps.base.db.Address"}}
16:30:12,946 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0016: Replaced deployment "abs-webapp-4.0.0.war" with deployment "abs-webapp-4.0.0.war"
16:30:12,955 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report

MySQL8 support

MySQL8 not currently supported.

org.hibernate.dialect.MySQL8Dialect is available in hibernate version 5.3

Since MySQL8Dialect is a subclass of MySQL57Dialect simply changing the CustomDialectResolver may work.

XML Hotswap issue

I refer to this tutorial to successfully configure Hotswap.
https://docs.axelor.com/adk/5.0/dev-guide/application/develop.html
I changed a view XML in Eclipse, and refreshed current view with browser refresh button, but the modification did not take effect.
I had to click the Restore all.. button in the view management to achieve the goal, which took a lot of time.

gradle :database

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':database'.

Unable to find application config.

Build only one module

Hi,
I would like to generate code only to one module then generate jar only for it, to keep some time.
Because now, I have to build ALL modules, which take too long time.

MetaFile security issue

Dear Team,

I just want to talk about the MetaFile which has a big operational security issue.

If a user has the read permission to the MetaFile domain, which is required if he need to see the picture for a partner, this user can download any DMS file using the REST WebService even if he do not have the permission to access to the DMS File.

Why ? just because a simple loop on ws/rest/com.axelor.meta.db.MetaFile/{i}/content/download will download all documents.

To solve this issue, the more quick and dirty way is to introduce an UUID for each metafile and to use this UUID for download instead of the ID. In that way, without knowing the UUID it will be not possible to download it.

Another way was to keep the MetaFile for picture (image only) and to introduce a new model (eg. DmsMetaFile). Now, an explicit permission could be apply to this model ad fix this security issue.

Best Regards

I18n and BIRT reports

Dear Axelor Team,

I would like to use existing translations files in my BIRT reports, but Axelor uses csv files while BIRT handles localization via properties files.

I can include com.axelor.i18n in my reports and use it there, so that's not a big deal.

Now the issue is that the calls to I18n.get() method from BIRT reports are not processed by I18nExtractor, so these translations will disappear each time the I18nTask will run.

Would it be too hacky to add .rptdesign files to I18nExtractor targets ?
I can add a PR if you think otherwise.

Regards,

Laurent

Mass update doesn't work with NULL value.

With mass update tool : Nothing happens when I try to set field(s) to null or when I try to update field(s) if the field(s) is/are null.

Version

Built with ADK 5.0

Reproduce the Error

Use mass update tool to set field(s) to null. Nothing happens.

Suggest a Fix

https://github.com/axelor/axelor-development-kit/blob/ef9c88d55615396cb1734f003c53e979e2cba873/axelor-core/src/main/java/com/axelor/db/Query.java#L475

HQL request return no results if one of the two operands is null. SQL doesn't support "=/!= null". The only test for the absence of a value (NULL) is IS NULL or IS NOT NULL.
One solution might be to delete this condition in your where clause like in the previous version (ADK 4.0)

Redirect to HOME after login success or use HOME as URL root

Use Case

As a user, I would like to be redirected to the home page setup in application.properties instead of simply /

Overview of the issue

When running Axelor behind a reverse proxy serving several domains, Axelor's default redirections (to login.jsp and to / after a successful login) might end up on the wrong domain.
I know it should be possible to hack this behavior with some NGinx config tricks but so far I haven't been able to find an acceptable solution and Axelor handling this itself seems to be a lot easier.

Version

Tested with ABS 4.2.3, built with ADK 4.1.8

Reproduce the Error

Setup a NGinx reverse proxy with at least 2 vhosts, for instance test.domain.com and axelor.domain.com (in that order).
Access axelor.domain.com unauthenticated. Login redirection will actually bring you to test.domain.com/login.jsp instead of axelor.domain.com/login.jsp.
Also, if SSL is enabled, I get a "Mixed content" message for every resource... I admit I'm not sure if it's config issue or application issue.

Suggest a Fix

Using the HOME field defined in the application.properties after successful login would fix the problem as I would only need to give the login link to my users and they would be automatically redirected to the proper URL. They would still have the issue if they tried to access the home link unauthenticated.

https://github.com/axelor/axelor-development-kit/blob/f72c2f1a5f26d184dce2d21a1294d00776f889b3/axelor-core/src/main/java/com/axelor/auth/AuthFilter.java#L79

Best would be to have a parameter defining the URL root and using it for all redirections. Maybe the HOME could be used like that, so redirection to login would be something like ${HOME}/login.jsp and successful login would bring you back to ${HOME}.

Wrong criteria when querying json on relationship

This domain query on model com.axelor.apps.production.db.ManufOrder

self.product.code like 'PF-%' and self.product.attrs.MODEL = 'RV65'

is translated in the wrong way regarding the args indexing

SELECT self FROM ManufOrder self LEFT JOIN self.product _product WHERE ((_product.code like 'PF-%' and json_extract_text(self.product, 'attrs', 'MODEL') = 'RV65') AND (self.archived is null OR self.archived = false))

Using json_extract_text directly in the domain solve the problem

self.product.code like 'PF-%' and jsonb_extract_path_text(self.product.attrs, 'MODEL') = 'RV65'

Errors are not correctly displayed when editing o2m in popups

When editing o2m, errors are silently ignored, no flash message appears, but popup isn't closed

Steps to reproduce:

  • Create a quotation
  • Launch new line popup
  • Clear the Tax field
  • Click OK

Expected behavior: a flash message "Tax field is required" should appear

axelor: command not found

Hi,

Link : https://docs.axelor.com/adk/4.0/getting-started/install/linux.html

I use the above link to try to install Axelor.After completing Export Axelor path i getting error like "axelor:command not found".

Can you provide some tutorial for Axelor installation & new project creation.thanks

Note : Kindly update your documentation with latest links.when i try to redirect a page with github link it returns "Page not found" error.

My system Config :

1.Ubuntu 18.04 LTS - 64-bit,

Kindly check this link for more Info : https://ibb.co/VNbhqTW

Improvement of LikeFilter with accent

I've found the LIKE filter can be improved with french langage because it have accent. (like in the demo dataset).

The original implementation unaccent the uppercase result.
The following query on the base_unit table

SELECT (unaccent(UPPER(name))) FROM public.base_unit;

returns

unaccenttext
--
UNITe
PIeCE
BOiTE DE 2 PCES

We can see that UPPER does not affect accented characters. (Unité -> UNITé)
The following query returns a much better result

SELECT (LOWER(unaccent(name))) FROM public.base_unit;

lowertext
--
unite
piece
boite de 2 pces

I don't know if it has side effects on the entire application.
I'm testing that modification in com.axelor.rpc.filter, first tests are concluant on base unit conversion form.

@Override
  public String getQuery() {
    if (DBHelper.isUnaccentEnabled()) {
      return String.format(
          "LOWER((unaccent(%s))) %s LOWER(unaccent(?)))", getOperand(), getOperator());
    }
    ....
  }

NB: PostgreSQL 11.1 on x86_64-apple-darwin13.4.0, compiled by Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn), 64-bit

capture d ecran 2019-02-24 a 14 08 04

Grid not refresh when switch from Form

When a added a new record on Form View, and click Back button to return to Grid View, the Grid not refresh. This means the nested field can not show, for example: <field name="product.name"/>

RestService download: inputstream no closed and lock file

Hi,

In the RestService.java, method UploadSave (line 272) there are missing call after the writing bytes:

out.close();
out.flush();
in.close();

The flush is not mandatory but it's more clean to add it. The inpustream close is mandatory to avoid a file to be locked after a download.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.