summaryrefslogtreecommitdiff
path: root/addons/website/models
diff options
context:
space:
mode:
authorAdrien Widart <awt@odoo.com>2021-04-19 12:11:25 +0000
committerAdrien Widart <awt@odoo.com>2021-04-27 09:00:31 +0000
commit8d452ae16b7e6c3077d9eae135852bada43cec93 (patch)
treee5849317e72716fbccd41063d86876c664d3b683 /addons/website/models
parent0dcc71314d41fb30559495695f7a626b4c1b20e3 (diff)
[FIX] website_form: cancel records creation if error
When running an automated action on record creation, if the action raises a UserError/ValidationError, the record will still be created. To reproduce the error: (Need website_crm,base_automation. Enable debug mode) 1. Create an Automated Action - Model: Lead/Opportunity - Trigger: On Creation & Update - Trigger Fields: Phone (crm.lead) - Action To Do: Execute Python Code - Python Code: ```python if record.phone: raise UserError("Lorem ipsum") ``` 2. On website, add a website form WF - Action: "Create an Opportunity" 3. Complete and submit WF including a phone number Error: An error message is displayed ("Lorem ispum"). However, the lead has been created and is present in CRM Pipeline. An on-creation automated action is executed once the record is executed, but nothing will cancel this records creation if the action raises a UserError/ValidationError. OPW-2423948 closes odoo/odoo#69477 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/website/models')
0 files changed, 0 insertions, 0 deletions