diff --git a/odex25_mobile/odoo_dynamic_workflow_mobile/controllers/controllers.py b/odex25_mobile/odoo_dynamic_workflow_mobile/controllers/controllers.py index c559fd1cb..4cdcc0b88 100644 --- a/odex25_mobile/odoo_dynamic_workflow_mobile/controllers/controllers.py +++ b/odex25_mobile/odoo_dynamic_workflow_mobile/controllers/controllers.py @@ -245,9 +245,12 @@ class RestApi(Controller): context = request.env.context.copy() context.update({"active_model": btn.model}) + reject_reason = kw.get('reason_msg') + if reject_reason: + context.update({"reject_reason": reject_reason}) context.update({"active_id": int(active_id)}) request.env.context = context - btn._run_code(active_id, btn.model, request.env) + btn.with_context(context)._run_code(active_id, btn.model, request.env) res = obj.read(["id", "state"])[0] state = res["state"] btn_new = (