Saved Query duplicates if use to save after sharing

Description

Steps to reproduce

1. Got to Product Window and hit Look up button
2. Create new Filtered named Active, Add Active = Yes
3. Click on Save button. It will create new filter named Active
4. Now click on Share button
5. Now click on save button.
6. Check Named filter drop down and you see 2 filter named Active.

Environment

None

Activity

Show:
Deepak Pansheriya
May 22, 2020, 10:30 AM
Edited
Diego Ruiz
May 22, 2020, 6:29 PM

Hi Deepak,

As I mentioned in the pull request. Setting AD_User_ID = 0 for global queries would be a mistake since System is an existing and valid user in iDempiere and can have its own saved queries. That’s why the global queries were designed to set AD_User_ID = NULL.

I’ve created a new pull request, it addresses the problem described here plus a new one found while developing. The commit changes:

  1. If a user query is shared globally the saved button is disabled to avoid creating a private duplicate.

  2. A user can make a copy of the global query and save it privately. A copy is made by changing the name of the saved query in the corresponding field in the search window. This also prevents having multiple queries with the same name.

  3. There was a bug when updating a global query. When you selected a shared query, modified it, and click on the share button, it was duplicated instead of updated. This has been fixed as well.

Pull request →

Best regards,

Diego Ruiz

Deepak Pansheriya
May 23, 2020, 3:18 AM

, I think your changes are perfect.

Assignee

Diego Ruiz

Reporter

Deepak Pansheriya

Labels

Tested By

None

Components

Fix versions

Affects versions

Priority

Minor
Configure