OCA / vertical-association

Odoo addons for membership related tasks
GNU Affero General Public License v3.0
38 stars 112 forks source link

[16.0][IMP] membership_extension & _variable_period: Make sure necessary fields are always truthy #157

Closed carmenbianca closed 11 months ago

carmenbianca commented 11 months ago

This is an additional sanity check to make sure that fields that are expected to be available are actually available.

The situation here is a little tricky. Especially as pertains date_from and date_to; these fields are required=True nowhere. Not on the product, not on the membership invoice, and not on the membership line. However, they are set as required in the product and membership line views. If these values are ever empty, it's a sure sign that something went wrong somewhere, because the user should not be able to reach such a state via the UI.

One sure way to reach that state was via the demo data, however, which had no start and end dates. This is now fixed.

The situation for the variable period fields is similar. These fields should never be empty when the membership type is variable, and it's not typically possible to empty these values via the UI. For convenience's sake, I simply set them to required an sich, with a default value.

carmenbianca commented 11 months ago

@chienandalu I've implemented and pushed your suggestions. Thank you for the review.

pedrobaeza commented 11 months ago

/ocabot merge patch

OCA-git-bot commented 11 months ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 16.0-ocabot-merge-pr-157-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot commented 11 months ago

Congratulations, your PR was merged at 3ee9de544580a07b820c189b5142ed203562b276. Thanks a lot for contributing to OCA. ❤️