Skip to content

16 sql export fix variable management imp - #3

Merged
florian-dacosta merged 2 commits into
akretion:16-sql-export-fix-variable-managementfrom
legalsylvain:16-sql-export-fix-variable-management-IMP
Jun 20, 2023
Merged

16 sql export fix variable management imp#3
florian-dacosta merged 2 commits into
akretion:16-sql-export-fix-variable-managementfrom
legalsylvain:16-sql-export-fix-variable-management-IMP

Conversation

@legalsylvain

@legalsylvain legalsylvain commented Jun 20, 2023

Copy link
Copy Markdown
Collaborator

Finish OCA#718

CC : @bguillot, @florian-dacosta

  • Add required, so the display mentions that the fields are mandatory :
    image

  • add a check before execution, before the required params is not handled correctly for Properties

image

  • remove obsolete nodestroy params

@florian-dacosta

Copy link
Copy Markdown
Member

@legalsylvain Thanks a lot for your PR!!

I agree this is an issue to have an error in case of empty value in string. I had not seen any obvious solution for this, with this property fields.
From what I see, making it require make all properties in blue like it is mandatory, but it does not block anything, that is why you add a raise during the validation of the wizard.

I think it is good enough indeed. But, we can't make the query_properties required on the python definition. Indeed, all the queries that work without any parameter would be blocked. I just tested and I have the error :

The operation cannot be completed:
- Create/update: a mandatory field is not set.
- Delete: another model requires the record being deleted. If possible, archive it instead.

Model: Allow the user to save the file with sql request's data (sql.file.wizard)
Field: Properties (query_properties)

But, I tried to add a required="1" in the view on query_properties, and it seems to work fine.
I mean, the field is blue and seems mandatory, but no problem to run queries without parameters.
The field are still not mandatory (it just seems to be because it is blue..) so the raise during wizard validation is still usefull.

So, just change the require from the python field definition to the view and it is ok for me!
(If you want I do a PR on your PR)
Thanks again for this improvement !

@legalsylvain
legalsylvain force-pushed the 16-sql-export-fix-variable-management-IMP branch from 3cd01ce to e37107a Compare June 20, 2023 09:27
@legalsylvain

Copy link
Copy Markdown
Collaborator Author

I think it is good enough indeed. But, we can't make the query_properties required on the python definition. Indeed, all the queries that work without any parameter would be blocked. I just tested and I have the error :

Oh, I didn't saw that corner case. Thanks !

So, just change the require from the python field definition to the view and it is ok for me!

done. Let me know !

@florian-dacosta
florian-dacosta merged commit 3476c06 into akretion:16-sql-export-fix-variable-management Jun 20, 2023
@florian-dacosta

Copy link
Copy Markdown
Member

LGTM, I have tested and works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants