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][IMP]subscription_oca: Various improvements (ready for review) #1098

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

flotho
Copy link
Member

@flotho flotho commented Jul 6, 2024

supersedes #1058

@flotho flotho marked this pull request as draft July 6, 2024 15:01
@flotho
Copy link
Member Author

flotho commented Jul 6, 2024

concern #1057

@flotho flotho marked this pull request as ready for review July 6, 2024 19:58
@flotho
Copy link
Member Author

flotho commented Jul 6, 2024

Hi @tarteo @rousseldenis here is my proposal to supersedes #1058
your review are welcome !

@flotho
Copy link
Member Author

flotho commented Jul 6, 2024

ping @JulienMartinez @gaelTorrecillas @GuiPrime , ready for review please

@flotho flotho force-pushed the 16-imp-subscription_oca branch 2 times, most recently from 153adad to e18a916 Compare July 6, 2024 22:00
@flotho flotho changed the title [16.0][IMP]subscription_oca: Various improvements [16.0][IMP]subscription_oca: Various improvements (ready for review) Jul 9, 2024
[IMP] subscription_oca: Various improvements

oca_subscription: Open subscription button in invoice view

[IMP]subscription_oca: syntax as requested

[IMP]subscription_oca: non used field on stage

[IMP]subscription_oca: track amount changes

[REF]subscription_oca: more consistent stage and status management

[IMP]subscription_oca: add views
* Invoices menu
* Filter entries in search views

[IMP]subscription_oca: Contributors

[IMP]subscription_oca: ACL issue on contact

[IMP]subscription_oca: use code as invoice reference

[IMP]subscription_oca: unit tests

[LINT]subscription_oca

[LINT]subscription_oca

[LINT]subscription_oca

[FIX]subscription_oca: authoring

[IMP] subscription_oca: Various improvements
Copy link

@HaraldPanten HaraldPanten left a comment

Choose a reason for hiding this comment

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

Functional review LGTM

@HaraldPanten
Copy link

@flotho Could you add your review here, please? --> #1099

@@ -464,7 +501,7 @@ def create(self, values):
values["date_start"] = values["recurring_next_date"]
values["stage_id"] = (
self.env["sale.subscription.stage"]
.search([("type", "=", "pre")], order="sequence desc", limit=1)
.search([("type", "=", "draft")], order="sequence desc", limit=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not longer needed with the addition of the _get_default_stage_id method

Copy link
Contributor

Choose a reason for hiding this comment

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

And i also think that the first conditional of the create function could be removed because it is unreachable code

Copy link
Contributor

@Tisho99 Tisho99 left a comment

Choose a reason for hiding this comment

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

LGTM. Code and functional review

I pointed out minor suggestions, can you answer them or update the code?

I am willing to make a fw port to v17 once this PR is merged

Thanks for the work done

and subscription.sale_subscription_line_ids
):
try:
subscription.generate_invoice()
except Exception:
logger.exception("Error on subscription invoice generate")
if not subscription.recurring_rule_boundary:
if subscription.date == today:
if subscription.date <= today:
subscription.action_close_subscription()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be replaced with subscription.close_subscription() and a default reason, isn't it?

The subscription.action_close_subscription() only returns a wizard and it causes no effect

Copy link
Member

Choose a reason for hiding this comment

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

@Tisho99 Yup like I mentioned in #1057

domain="[('in_progress', '=', True)]"
/>
<separator />
<!-- TODO: to_renew seems useless in this module -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I algo think to_renew is useless currenly. But i also think adding the field to the form view, or deleting it from the models and the search is better than adding a TODO

/>
<separator />
<filter
string="Draft / Waiting"
Copy link
Contributor

Choose a reason for hiding this comment

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

This filter also shows the closed subscriptions.

Maybe we should add the related stage_type field to the subscription and create better filters?

@HaraldPanten
Copy link

@flotho

@flotho
Copy link
Member Author

flotho commented Jul 24, 2024

on holidays, will deal with this later ;-)

@HaraldPanten
Copy link

on holidays, will deal with this later ;-)

Enjoy! 🏖

@tarteo
Copy link
Member

tarteo commented Aug 29, 2024

@flotho Can you also add a sequence field to sale.subscription.line?

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

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

I don't care if yours or mine gets merged, so I approve it. I preferably see this and the contract modules refactored mentioned here: #1108 but that will be a substantial amount of work...
If you can just fix the issue @Tisho99 mentioned, this can be merged. Frankly, any merged pull request is a big win for this module

@max3903 max3903 added this to the 16.0 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants