Created on 2014-08-28.11:05:41 by ced, last changed 18 months ago by roundup-bot.
New changeset 6f69c09ec1ff by Cédric Krier in branch 'default': Support explicit delete and remove for saving and on_change xxx2Many https://hg.tryton.org/tryton-env/rev/6f69c09ec1ff
New changeset 41f7d6828fcd by Cédric Krier in branch 'default': Support explicit delete and remove for saving and on_change xxx2Many https://hg.tryton.org/trytond/rev/41f7d6828fcd
New changeset 1059829e2782 by Cédric Krier in branch 'default': Support explicit delete and remove for saving and on_change xxx2Many https://hg.tryton.org/tryton/rev/1059829e2782
New changeset 9583c9484701 by Cédric Krier in branch 'default': Support explicit delete and remove for saving and on_change xxx2Many https://hg.tryton.org/sao/rev/9583c9484701
New changeset 366222e2291b by Cédric Krier in branch 'default': Support explicit delete and remove for saving and on_change xxx2Many https://hg.tryton.org/proteus/rev/366222e2291b
I'm wondering if there is somethign wrong with the sao implementation. See msg56907 for more details
Here is review291281002
For me it makes sense to use delete as default for One2Many as normally records are created instead of linked. For Many2Many the default action is link, so it makes sense to remove (unlink) instead of removing. The proposed API looks good to me.
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).
Indeed the remove is now a *real* remove (and no more a deletion) since r e40190b28b31. But indeed we are missing for some cases the 'delete' keyword.
I do not agree, the bad naming is still there.
Keywords are hidden to the developer now, so for me this is fixed now.
The keyword 'remove' is indeed a deletion and there is no real remove. So I propose to replace the 'remove' by a real remove and add 'delete' for the current 'remove' behavior.
|2020-04-12 23:19:04||roundup-bot||set||messages: + msg57063|
|2020-04-12 23:18:58||roundup-bot||set||messages: + msg57062|
|2020-04-12 23:18:56||roundup-bot||set||messages: + msg57061|
|2020-04-12 23:18:53||roundup-bot||set||messages: + msg57060|
|2020-04-12 23:18:45||roundup-bot||set||status: testing -> resolved|
nosy: + roundup-bot
messages: + msg57059
|2020-04-05 21:59:18||pokoli||set||messages: + msg56908|
|2020-04-01 11:24:33||reviewbot||set||messages: + msg56818|
|2020-04-01 00:49:05||reviewbot||set||messages: + msg56813|
|2020-03-22 16:03:55||reviewbot||set||messages: + msg56578|
|2020-03-21 12:33:19||reviewbot||set||messages: + msg56560|
messages: + msg56559
|2020-03-21 01:19:58||ced||set||status: in-progress -> testing|
component: + tryton, trytond, proteus, sao
messages: + msg56558
keyword: + review
|2020-03-20 13:33:10||ced||set||status: chatting -> in-progress|
|2017-11-02 12:44:40||pokoli||set||messages: + msg36676|
|2017-10-21 19:04:29||ced||set||messages: + msg36406|
|2017-04-10 14:26:49||nblock||set||nosy: + nblock|
|2017-04-10 13:37:30||ced||link||issue6430 superseder|
title: Consistency in on_change keywords -> Missing delete in on_change keywords
|2016-09-23 18:40:44||ced||set||status: closed -> chatting|
messages: + msg28979
|2016-09-23 18:20:14||pokoli||set||status: unread -> closed|
nosy: + pokoli
messages: + msg28977