Skip to content
Snippets Groups Projects
Commit 9c1c2c55 authored by Aaron Bohy's avatar Aaron Bohy
Browse files

[FIX] web: one2many: add new record with 'Save & New'

Consider the following scenario involving a one2many list (non
editable) inside a form view:
 - click on 'Add an item', a model opens,
 - fill the fields and click on 'Save & Close',
 - reopen the freshly created record,
 - maybe make some changes (this is optional, but makes sense),
 - click on 'Save & New',
 - fill the fields and click on 'Save & Close',
 -> the second created record isn't added to the list.

The problem comes from the fact that when the dialog is opened for
the second time (in this case by clicking on a record), the 'save'
handler registers an 'UPDATE' command. While this is correct for
the 'Save & New' click (as we update an existing record), this
isn't for the second record which doesn't exist yet, and thus
requires an 'ADD' command.

This rev. ensures that the two cases are handled in the 'save'
handler given to the dialog.

OPW 1829723
parent 9353fa1e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment