Friday, July 10, 2020
1 change · master
New functionality added to Odoo
Website automation actions can now create response objects directly from their Python code. This makes webhook-style automations easier to build because teams can return data without adding separate model methods.
Original PR description
**Description of the issue/feature this PR addresses:** I noticed, that ``base_automation`` can be used as a webhook handler. But I don't see a possibility to prepare a response directly in action's…
**Description of the issue/feature this PR addresses:** I noticed, that ``base_automation`` can be used as a webhook handler. But I don't see a possibility to prepare a response directly in action's code, because Response object is not available in the action context. Did I miss something? See https://github.com/odoo/odoo/blob/ceddb710a17e552061b9ad3cbc2647d7eae6567d/addons/website/controllers/main.py#L436-L442 And https://github.com/odoo/odoo/blob/ceddb710a17e552061b9ad3cbc2647d7eae6567d/addons/website/models/ir_actions.py#L54-L60 **Current behavior before PR:** To return data on the _request_ , you need to create a method in an model that returns Response object **Desired behavior after PR is merged:** You can create a Response object directly from "Python code field"  -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr @it-projects-llc