Mark M2M records for addition in parent after they're saved

Closes #12832
(grafted from 4e8ff04aef3a2bfd175e2c77db1421810adc5159)

--HG--
branch : 7.0
This commit is contained in:
Nicolas Évrard committed 2023-12-14 17:54:27 +01:00
1 parent 13caf6383d
commit 686c799097
2 files changed
+7

No files matched your search

+4
View File
@@ -4071,8 +4071,12 @@ function eval_pyson(value){
const callback = result => {
if (result) {
screen.current_record.save().done(() => {
var added = 'id' in this.screen.current_record.modified_fields;
// Force a reload on next display
this.screen.current_record.cancel();
if (added) {
this.screen.current_record.modified_fields.id = true;
}
});
}
};
@@ -224,8 +224,11 @@ class Many2Many(Widget):
def callback(result):
if result:
screen.current_record.save()
added = 'id' in self.screen.current_record.modified_fields
# Force a reload on next display
self.screen.current_record.cancel()
if added:
self.screen.current_record.modified_fields.setdefault('id')
# Force a display to clear the CellCache
self.screen.display()
WinForm(screen, callback)