From cd9bc3ac2c61eb6a10d1a6ab896915e29e1ffffe Mon Sep 17 00:00:00 2001 From: hugues de keyzer Date: Mon, 6 May 2024 15:40:12 +0200 Subject: [PATCH] [FIX] re-add renamed get_person_info() method re-add renamed subscription.request.get_person_info() method (as deprecated) to avoid having to increase the major version of the module. --- cooperator/models/subscription_request.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cooperator/models/subscription_request.py b/cooperator/models/subscription_request.py index fcadabe89..a6bab1788 100644 --- a/cooperator/models/subscription_request.py +++ b/cooperator/models/subscription_request.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later +import warnings from datetime import date from odoo import _, api, fields, models @@ -476,6 +477,15 @@ def _compute_subscription_amount(self): _order = "id desc" + # todo: remove this at the next major version update. + def get_person_info(self, partner): + warnings.warn( + "subscription.request.get_person_info() is deprecated. " + "please use .set_person_info() instead.", + DeprecationWarning, + ) + return self.set_person_info(partner) + def set_person_info(self, partner): self.firstname = partner.firstname self.name = partner.name