Tryton - Issues

 

Message36406

Author ced
Recipients nblock, pokoli
Date 2017-10-21.19:04:29
Content
I think we should implement the 'delete' on client side for on_change. But also the ModelView._changed_values and ModelStorage._save_values shoud be improved to support it for both One2Many and Many2Many. For that as the API is only attribute assignation, I propose to keep the current behavior of 'remove' for Many2Many as default but use 'delete' for One2Many. So to be able to switch the default behavior, I propose to register in the Model._values the list of records to delete or remove for the relation field. Those records list will be stored as '<field name>:removed' and '<field name>:deleted' (use ':' to avoid any clash with existing field) in Model._values (for performance to avoid creating a new dict). Both methods will have to check those values to change the behavior. To fill those list, I think we should add a method on both fields, ex: One2Many.remove(self, record, records) and Many2Many.delete(self, record, records).
History
Date User Action Args
2017-10-21 19:04:29cedsetmessageid: <1508605469.41.0.661038404964.issue4140@tryton.org>
2017-10-21 19:04:29cedsetrecipients: + pokoli, nblock
2017-10-21 19:04:29cedlinkissue4140 messages
2017-10-21 19:04:29cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)