diff options
| author | Ivan Yelizariev <iel@odoo.com> | 2021-01-07 16:19:25 +0000 |
|---|---|---|
| committer | Ivan Yelizariev <iel@odoo.com> | 2021-01-12 12:39:21 +0000 |
| commit | 6fd6d68ee6eee6460ffda8b7dd691c0ef93b7a30 (patch) | |
| tree | c9708b8af2001137663a05b9b06087d29178f5f9 /doc/python3.rst | |
| parent | cc2bd6717df379e87c9dfc485aa51f8dd33f6b76 (diff) | |
[FIX] base_automation: reset active_id(s) in onchange handler
If we change ``active_model`` in context, we have to reset active_id(s),
otherwise we read a random records which may not exist.
STEPS:
1. Activate Developer mode
2. Go to Settings > Technical > Automation > Automated Actions
3. Define a new Automated Action with the following settings:
- Model: Lead/Opportunity
- Action To Do: Execute Python Code
- Trigger: Based on Form Modification
- Trigger Fields: Customer (crm.lead)
- Python Code:
```
raise Warning(records)
```
4. Go to Contacts, create a new contact and save it.
5. Click on the "Opportunities" Smart Button on the top left of the contact record.
6. Click "Create".
BEFORE: ``records`` in context read crm.lead, while id is for res.partner
record
AFTER: ``records`` is None
---
opw-2424392
closes odoo/odoo#64399
X-original-commit: 799acc5610e261123715f22d2103175fd05fefdf
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'doc/python3.rst')
0 files changed, 0 insertions, 0 deletions
