changeset 634c519f79e9 in modules/purchase:6.4
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=634c519f79e9
description:
        Ignore initial on_change call from modify header wizard

        issue11703
        review433471003
diffstat:

 purchase.py |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 09637f56338b -r 634c519f79e9 purchase.py
--- a/purchase.py       Thu Sep 15 21:47:26 2022 +0200
+++ b/purchase.py       Sat Oct 01 14:17:13 2022 +0200
@@ -845,6 +845,17 @@
                         purchase=purchase.rec_name))
         super(Purchase, cls).delete(purchases)
 
+    def on_change(self, fieldnames):
+        pool = Pool()
+        ModelData = pool.get('ir.model.data')
+        context = Transaction().context
+        wizard_modify_header_id = ModelData.get_id(
+            'purchase', 'wizard_modify_header')
+        if (len(fieldnames) > 1
+                and context.get('action_id') == wizard_modify_header_id):
+            return []
+        return super().on_change(fieldnames)
+
     @classmethod
     @ModelView.button
     @Workflow.transition('cancelled')

Reply via email to