Tryton - Issues



Title Browse parent back
Priority feature Status unread
Superseder Nosy List ced, pokoli
Type feature request Components trytond
Assigned To Keywords

Created on 2017-12-28.19:53:13 by ced, last changed by pokoli.

msg37479 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-12-28.19:53:13
When we browse back the parent of a record from a relation field like a One2Many we got a new instance instead of the instance we come from.
This is an unexpected behavior.

A common pattern where this behavior generates errors is this one:

    record.field = <new value>
    for line in record.lines:

The on_change_field may depend on the parent field like this:

    def on_change_field(self):
        if self.parent.field:

But of course, self.parent.field will not be evaluated as <new value> but with the value form the database.

I think we could inject in the _local_cache of the parent instance in ModelStorage.__getattr__
Date User Action Args
2018-01-11 10:01:32pokolisetnosy: + pokoli
2017-12-28 19:53:13cedcreate

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