mirror of
https://gitlab.com/flectra-community/partner-contact.git
synced 2024-12-23 12:51:46 +00:00
17 lines
523 B
Python
17 lines
523 B
Python
# Copyright 2019-2020 Onestein (<https://www.onestein.eu>)
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
from flectra import models
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = "res.partner"
|
|
|
|
def toggle_active(self):
|
|
res = super().toggle_active()
|
|
if self.env.context.get("skip_child_toggle_active"):
|
|
return res
|
|
for partner in self.filtered(lambda x: not x.active):
|
|
partner.child_ids.filtered(lambda x: x.active).toggle_active()
|
|
return res
|