changeset 253eda3e413d in tryton:4.6
details: https://hg.tryton.org/tryton?cmd=changeset;node=253eda3e413d
description:
        Do not recycle first record as product result

        The value of the field of the first record, which is edited in the 
list, will
        be lost. Because the editable widget is started before the search 
pop-up and
        it override the new default value with its content when the pop-up is 
closed.
        So we can not reuse record create before the pop-up.

        issue7941
        review49681002
        (grafted from 2ddba0a8db335de17cd09cb11b11c6654bad075a)
diffstat:

 tryton/gui/window/view_form/view/form_gtk/one2many.py |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (25 lines):

diff -r 076b4101707e -r 253eda3e413d 
tryton/gui/window/view_form/view/form_gtk/one2many.py
--- a/tryton/gui/window/view_form/view/form_gtk/one2many.py     Sun Dec 30 
00:17:57 2018 +0100
+++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py     Wed Jan 02 
18:53:18 2019 +0100
@@ -395,18 +395,14 @@
             win_search.screen.search_filter()
             win_search.show()
 
-        def make_product(first=first):
+        def make_product():
+            self.screen.group.remove(first, remove=True)
             if not product:
-                self.screen.group.remove(first, remove=True)
                 return
 
             fields = product.keys()
             for values in itertools.product(*product.values()):
-                if first:
-                    record = first
-                    first = None
-                else:
-                    record = self.screen.new(default=False)
+                record = self.screen.new(default=False)
                 default_value = default.copy()
                 for field, value in zip(fields, values):
                     id_, rec_name = value

Reply via email to