Skip to content

[16.0][IMP] membership_variable_period: enable membership renewal#205

Open
flaenen wants to merge 1 commit intoOCA:16.0from
flaenen:16.0-renew_membership
Open

[16.0][IMP] membership_variable_period: enable membership renewal#205
flaenen wants to merge 1 commit intoOCA:16.0from
flaenen:16.0-renew_membership

Conversation

@flaenen
Copy link
Copy Markdown

@flaenen flaenen commented Mar 27, 2025

A member's membership is now renewed when a new variable period membership product of the same category is purchased. The new period will begin the day after the end of the last period.

@polchampion
Copy link
Copy Markdown

polchampion commented Mar 28, 2025

functional tests

Backend and logic

  • The "buy membership" button takes current and future membership lines into account when renewing variable memberships
  • If a past membership line has expired, renewal starts from today
  • Postponed renewal only applies to memberships from the same category
  • Postponed renewal only applies to membership states that grant effective membership ('paid', 'free' and 'invoiced')

POS UI [waiting for deployment before testing]

  • Postponed renewal applies when a membership is sold in the POS to an effective member
  • Compatibility with pos_membership_extension: test of both modules together

Copy link
Copy Markdown

@polchampion polchampion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

@remytms remytms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@polchampion
Copy link
Copy Markdown

@OCA/vertical-association-maintainers Can you take a look at this PR?

@polchampion
Copy link
Copy Markdown

@pedrobaeza Hi Pedro, could you take a look at this? Our PR is awaiting approval :-)

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration membership_variable_period

Hi, a PSC should review this PR to get it merged. https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#review

I'm not able to review right now, sorry.

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Apr 17, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Apr 17, 2025
11 tasks
@flaenen flaenen force-pushed the 16.0-renew_membership branch from 5c67025 to 0a16875 Compare April 29, 2025 21:05
@flaenen flaenen force-pushed the 16.0-renew_membership branch from 0a16875 to a20eae1 Compare May 26, 2025 16:05
@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@rafaelbn
Copy link
Copy Markdown
Member

This is not a migration but a improvement / enhancement

What do you think about this @fcvalgar @Andrii9090 @chienandalu ?

Copy link
Copy Markdown
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @flaenen

I'm not sure I quite understand the context or use case for this changes. Can you elaborate it a little bit?

_inherit = "account.move.line"

def _prepare_membership_line(self, move, product, price_unit, line_id, qty=1.0):
def _prepare_membership_line(self, move, product, price_unit, line, qty=1.0):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against changing this arg type, but doing so in stable code could break someone else extensions...

It also makes the commit meaningful content more difficult to follow.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will modify the code to keep the arg type.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@flaenen
Copy link
Copy Markdown
Author

flaenen commented Aug 25, 2025

Thanks @flaenen

I'm not sure I quite understand the context or use case for this changes. Can you elaborate it a little bit?

In our use case, a customer can become a member for one year by purchasing a membership product (usually via POS). Membership begins on the date of purchase and can be renewed before expiration by purchasing the product again. Renewal must begin the day after the end of the current period (not the day of purchase) to avoid overlapping periods, ensuring that the customer receives a full additional year of membership.

A member's membership is renewed when a new variable period membership product
of the same category is purchased. The new period will begin the day after the
end of the last period.
@flaenen flaenen force-pushed the 16.0-renew_membership branch from a20eae1 to da1ce9c Compare August 25, 2025 14:58
@polchampion
Copy link
Copy Markdown

Thanks @flaenen
I'm not sure I quite understand the context or use case for this changes. Can you elaborate it a little bit?

In our use case, a customer can become a member for one year by purchasing a membership product (usually via POS). Membership begins on the date of purchase and can be renewed before expiration by purchasing the product again. Renewal must begin the day after the end of the current period (not the day of purchase) to avoid overlapping periods, ensuring that the customer receives a full additional year of membership.

@OCA/vertical-association-maintainers do think this can now be merged? thanks a lot for taking a final look :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants