odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] base_automation: fix traceback value in error dialog

Open yelizariev opened this issue 3 years ago • 10 comments

RPC call may fail because of error in base.automation handler. In this case the response contains attribute exception_class=base_automation to handle error via custom dialog BaseAutomationErrorDialog, which provides extra buttons (disable/edit Automated Action).

BaseAutomationErrorDialog was incorrectly inherited from ErrorDialog, which cannot extract traceback from data.debug value of jsonrpc. Fix it by replacing it RPCErrorDialog.

RPCErrorDialog: https://github.com/odoo/odoo/blob/a75fcbe03f31fd10a74e609672b64dad165e68d7/addons/web/static/src/core/errors/error_dialogs.js#L62-L70

Button Edit Action didn't work, because it tries the same rpc call before navigating to the action. For example, it would repeat rpc call to create a record, which doesn't work because of broken automated action.

It happens because form changes are saved automatically since Odoo v15.

Fix it by omitting clearUncommittedChanges. This way we may loose user input. This could be improving by reimplementing Odoo v14 behaviour, when user is asked to confirm discarding unsaved changes.

opw-2845893

yelizariev avatar May 27 '22 09:05 yelizariev

Pull request status dashboard

robodoo avatar May 27 '22 10:05 robodoo

@aab-odoo @kebeclibre

sdegueldre avatar May 30 '22 08:05 sdegueldre

@aab-odoo @kebeclibre

?

yelizariev avatar Jul 05 '22 13:07 yelizariev

Also, opw-2883892

yelizariev avatar Jul 14 '22 12:07 yelizariev

r+ ?

yelizariev avatar Aug 16 '22 14:08 yelizariev

You did not apply aab's recommendation, which is to execute the action in target=new instead of introducing a new no_save option for doAction.

sdegueldre avatar Aug 18 '22 06:08 sdegueldre

@sdegueldre thanks for clarification. I was confused about aab's and nle's comments.

I've updated the PR

yelizariev avatar Aug 18 '22 12:08 yelizariev

@robodoo r+

sdegueldre avatar Aug 18 '22 12:08 sdegueldre

@sdegueldre As I understand, there were some staging error, so I did git rebase and forgot about this PR. Could you check and r+ ?

yelizariev avatar Nov 18 '22 12:11 yelizariev

Also, opw-3072740

yelizariev avatar Nov 18 '22 12:11 yelizariev

@robodoo r+

sdegueldre avatar Nov 20 '22 17:11 sdegueldre