Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] re-add renamed get_person_info() method #129

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cooperator/models/subscription_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later

import warnings
from datetime import date

from odoo import _, api, fields, models
Expand Down Expand Up @@ -476,6 +477,15 @@

_order = "id desc"

# todo: remove this at the next major version update.
def get_person_info(self, partner):
warnings.warn(

Check warning on line 482 in cooperator/models/subscription_request.py

View check run for this annotation

Codecov / codecov/patch

cooperator/models/subscription_request.py#L482

Added line #L482 was not covered by tests
"subscription.request.get_person_info() is deprecated. "
"please use .set_person_info() instead.",
DeprecationWarning,
)
return self.set_person_info(partner)

Check warning on line 487 in cooperator/models/subscription_request.py

View check run for this annotation

Codecov / codecov/patch

cooperator/models/subscription_request.py#L487

Added line #L487 was not covered by tests

def set_person_info(self, partner):
self.firstname = partner.firstname
self.name = partner.name
Expand Down
Loading