diff options
| author | nie <nie@odoo.com> | 2020-11-26 14:44:34 +0000 |
|---|---|---|
| committer | nie <nie@odoo.com> | 2020-11-26 17:29:30 +0000 |
| commit | 88a34dd1539ed0184196158bb3a2d8429132004f (patch) | |
| tree | 42569336fd821155dae0bd1e3d1f58729565fa90 | |
| parent | ea2d1484fcd91efe89306d6106c01fcdde1c20c3 (diff) | |
[FIX] base: company not deleted on linked partners
Steps:
- Install Contacts
- Have Multi-Companies enabled
- Go to a Contact of type "Company"
- Click "Sales & Purchases"
- Assign it the company you're on
- Save and Edit again
- Remove the assigned company
- Go to a contact of type "Individual" linked to this company
- Click "Sales & Purchases"
Bug:
The company has not been deleted on the linked Individual
Explanation:
When we delete the company of a contact, the value of `vals.get('company_id')` is `False`.
This is why it didn't enter the propagation process.
opw:2391464
closes odoo/odoo#62461
X-original-commit: 80902bee453cf485906bb07be6af9072aee2e76f
Signed-off-by: backspac <backspac@users.noreply.github.com>
| -rw-r--r-- | odoo/addons/base/models/res_partner.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py index b93bca5426b..b43032ffbeb 100644 --- a/odoo/addons/base/models/res_partner.py +++ b/odoo/addons/base/models/res_partner.py @@ -527,7 +527,7 @@ class Partner(models.Model): vals['website'] = self._clean_website(vals['website']) if vals.get('parent_id'): vals['company_name'] = False - if vals.get('company_id'): + if 'company_id' in vals: company = self.env['res.company'].browse(vals['company_id']) for partner in self: if partner.user_ids: |
