Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
c8eed787 by Cédric Krier at 2023-01-23T00:43:49+01:00
Update purchase request state after the purchase transition

Closes #6362
- - - - -


1 changed file:

- modules/purchase_request/purchase.py


Changes:

=====================================
modules/purchase_request/purchase.py
=====================================
@@ -13,6 +13,8 @@
 
 
 def process_request(func):
+    # Must be run after the purchase transition
+    # such as purchase has the proper state
     @wraps(func)
     def wrapper(cls, purchases):
         pool = Pool()
@@ -70,4 +72,5 @@
 
     @classmethod
     @ModelView.button
+    @process_request
     @Workflow.transition('cancelled')
@@ -73,6 +76,5 @@
     @Workflow.transition('cancelled')
-    @process_request
     def cancel(cls, purchases):
         super(Purchase, cls).cancel(purchases)
 
     @classmethod
@@ -75,5 +77,6 @@
     def cancel(cls, purchases):
         super(Purchase, cls).cancel(purchases)
 
     @classmethod
+    @process_request
     @Workflow.transition('done')
@@ -79,5 +82,4 @@
     @Workflow.transition('done')
-    @process_request
     def do(cls, purchases):
         super(Purchase, cls).do(purchases)
 



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/c8eed787c0bc8472b9cc4490e9e0e77e4a4b02f0

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/c8eed787c0bc8472b9cc4490e9e0e77e4a4b02f0
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to