-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
Q: How to use contract modules for managing subscriptions? #977
Comments
In fact, the contract (or lines) state (there is no state field) don't depend on payment status. We just manage for time being the dates (so, the period of time) the line or the contract is active. During the active period of time and depending on the recurring type (daily, weekly, ...), invoices (or sales) are generated and live their life independently from the contract. The common use case is having a contract confirmed and should always go to the end date (and has no dependency on the invoices payment status - as this is a purely accounting flow). The contract (or lines) stops or pauses are currently supported. This operation is manual.
I don't understand the use case as if the contract is not active, the first invoice is not generated... and cannot be paid. Using product_contract flow could support your use case if you call https://github.com/OCA/contract/blob/14.0/product_contract/models/sale_order.py#L82 on sale order payment. So, said differently, I would generate the contract only if the sale order (which is the entry point) is paid (for time being this is manual action). |
@rousseldenis thank you for quick answer. Let me try to describe the use-case better. The ideal way for this to work for me would be this:
I'm talking about "active/inactive" Contract (or Contract Line - doesn't really matter) because I want to have a way when Customer invokes a service request (very similar to IAP - it just doesn't consume tokens) to have a way to check whether the Customer is eligible for his request to be handled. I believe that the flow I described is how Contract module works it's just missing that easily accessible "active/inactive" flag. Now that I have described this I am thinking of adding something like "Payment State" which could be used for that purpose. Any ideas/suggestions? |
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Sorry for doing it this way but I am trying to port
product_contract
to 16.0 (see #959 ) but found it behaves differently than 14.0 so got stuck there for hours now trying to figure out my scenario...Any help would be appreciated solving the following: I would like to sell some sort of subscription service on yearly (or monthly - doesn't matter much) basis where customer upon initial purchase and payment gets the contract activated for a that perios (which can then be checked from module providing the actual service). So it would be something like
sale.order
with product marked asis_contract=True
and typepre-paid
to ensure automaticcontract.contract
andcontract.line
creation. When the end of current period is nearing, newcontract.line
would be created as successor to the previous one and invoice or sale order gets created (that works it seems).What I am struggling with is this: it seems that state of the
contract.line
does not at all depend at state of the linkedaccount.move
. I mean I'd want the contract to be "active" after the payment for the first period has been made. If the period ends without the next invoice (or even bettersale.order
) being paid, the contract should "expire".Would anyone kindly share some insights on this? Am I missing something very obvious here? Or am I trying to bend the module into something it has never been intended to be used like? Any help, suggestions is greatly appreciated.
@pedrobaeza @sbejaoui @ibuioli @rousseldenis @victoralmau @ygol
The text was updated successfully, but these errors were encountered: