From 033032945229b89df24b840c976103ee363287a0 Mon Sep 17 00:00:00 2001 From: Alexandre Philibert Date: Tue, 15 Sep 2026 15:42:30 +0200 Subject: [PATCH] [T3412] FIX: Correctly set contract lines on W&P sponsorship contracts --- sponsorship_compassion/models/contracts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sponsorship_compassion/models/contracts.py b/sponsorship_compassion/models/contracts.py index d09dd1150..e03a3492a 100644 --- a/sponsorship_compassion/models/contracts.py +++ b/sponsorship_compassion/models/contracts.py @@ -201,8 +201,11 @@ def _get_standard_lines(self): @api.onchange("group_id") def _get_correct_pricelist(self): - if "S" in self.env.context.get("default_type", "O"): - self.contract_line_ids = self._get_sponsorship_standard_lines(False) + contract_type = self.type or self.env.context.get("default_type", "O") + if "S" in contract_type: + self.contract_line_ids = self._get_sponsorship_standard_lines( + contract_type in ["SC", "SWP"] + ) @api.onchange("type") def _create_empty_lines_for_correspondence(self):