changeset 66e5451115cc in modules/sale:6.4
details: https://hg.tryton.org/modules/sale?cmd=changeset&node=66e5451115cc
description:
Ignore initial on_change call from modify header wizard
issue11703
review433471003
diffstat:
sale.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r fd06f016d197 -r 66e5451115cc sale.py
--- a/sale.py Thu Sep 15 21:47:26 2022 +0200
+++ b/sale.py Sat Oct 01 14:17:13 2022 +0200
@@ -896,6 +896,17 @@
sale=sale.rec_name))
super(Sale, cls).delete(sales)
+ def on_change(self, fieldnames):
+ pool = Pool()
+ ModelData = pool.get('ir.model.data')
+ context = Transaction().context
+ wizard_modify_header_id = ModelData.get_id(
+ 'sale', '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')