When Window Preference doesn't exists then Default Doctype Taken - also from another client
Description
Environment
Attachments
- 26 Jun 2017, 03:42 AM
- 22 Jun 2017, 07:56 PM
causes
Activity

Hiep Lq June 26, 2017 at 3:42 AM
org.postgresql.util.PSQLException: ERROR: column reference "c_doctype_id" is ambiguous
when create a sale order and save. login with language difference english
Carlos Ruiz June 24, 2017 at 10:45 PM
Hi @Norbert Bede, I committed https://bitbucket.org/idempiere/idempiere/commits/66f9559
So, now when creating a new record, default values (or copied values) are validated against the valid list.
It is possible that this open other issues because of dictionary misconfiguration.
For example, after I applied this I caught that the document type field on invoices and orders were not including the document with ID=0 and that was the default. So, I needed to modify that in dictionary to include that record in the valid list.
Please test and give feedback about.
Regards,
Carlos Ruiz

Hiep Lq June 23, 2017 at 2:10 AM
why you have to do step 3?
"3. set e.g. payment vendor as isDefault"
Norbert Bede June 22, 2017 at 7:50 PM
hi @Hiep Lq. we worked together lot 2 years ago on value prefernces. we found this issue. would be sort out this issue.
any help appreciated. we need somehow resolve if now preference exists then do not take wrong doctype from another of same client with isdefault='Y'
issue: we recognise our users creates sales orders by leave empty target doctype field. when they save it then another docbasetype default c_doctype_id loaded to foreign field.
step by step reproduction
1. Login to GardenWorld
2. open a window e.g sales Order - delete preference 2 options are
i. target doctype - > right click delete window level preference
ii. open window preference window and delete Attributes for window sales order
3. set e.g. payment vendor as isDefault
4. logout/login
5. create sales order fill org, bp, etc. DO NOT FILL Target Doc Type >> SAVE IT
BUG: sales order doctype will inherit Payment Doctype.
This is very danger and able to seriously mess-up user data. This happening when Preference doesn't exists for window. This should happen when a superuser or higher role level delete and manipulate value preference for window level.
IMPORTANT: in our case Window populate doctype from ANOTHER CLIENT:
Example