OCA / vertical-association

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

[16.0] [FIX] membership_prorate: fix for calculating quantity for prorate products #173

Open ByteMeAsap opened 2 weeks ago

ByteMeAsap commented 2 weeks ago

This PR tends to solve quantity calculations for prorate products.Consider the following scenario: Define a membership product with fixed dates, set start date as 1st Feb 2024 and end date as 29th Feb 2024, then create an invoice ,set 1st Feb 2024 as start date and select the product and save.Ideally the qty should be set as 1, but its sets it as 0.97 without changes added in this PR. Also, changes in test scripts were needed for prorate variable period as for a week, if we consider from Thursday, it would be 4 days including Thursday(Thursday,Friday,Saturday and Sunday) i.e 4/7 = approximately 57% and similarly for the month - its 16 days including 15th April so 16/30 =approximately 53%