-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Purpose of refactoring subscription_oca module #1108
Comments
Why the contract module doesn't serve? I agree is a bit more complicated, but developing an exact competing one inside OCA is not good. The path to follow is to split the main You can do |
The level of sophistication of contract module is the main reason for not using it in this project. In other projects we do use it, but it doesn't suit in this one; and we prefer not to make it more complex with extensions or customizations. Using subscription is a better decision. On the other hand, I'm talking about improving a module that already exists in this repository (subscription_oca). Our intention is to make it better separating it in several parts (base_subscription_oca and sale_subscription_oca, for example). I understand that having several modules for similar purposes is not the most common in OCA, but we all know that we can find similar functionallities in other situations, like:
And the most of this situations exist because the original module seems to be too complex depending on the project/company you're working for. Do you know what I mean? THX for your feedback 😉 |
They are not similar purposes. It's the SAME purpose and they look like more and more the same as those that have decided to go to the subscription path are adding features (see #1102, #1098, #1058, #1046, #1039, #1037 ...). As said, the way to go for me is to do the same split in |
Will you accept a complete refactoring for contract module in this version (V17) and divide it in several/more simple "pieces", considering that it has been stable for almost 4 months? |
I tend to agree with @pedrobaeza. A good refactoring of contract module should be great in order to identify the functional parts that can have their existence in their own module. But I don't know correctly subscription one. Maybe identifying or doing a good comparison of features could help the path of doing it. We could prepare that to do it during OCA days if you are not in a hurry |
Wow, Denis agreeing with me. Let's do a party! 😛 The main issue with contract that always arises is that "it's too complicated". Part of the guilty for that is all the successor/ancestor thing you (Acsone) added on 12.0 as part of the main module. The other "complexity" comes from the duality of defining the recurrency at line level instead of contract level. I tackled a bit that some versions ago allowing to define the recurrency at contract level and propagating them to the lines. It turns out that the previous technical architecture along with this makes a code that scares a bit (with several abstracts composing at the same time), and I tend to think that is a bit over-engineered. All that reasons led to Domatix to propose this alternative made from scratch as a mirror of the enterprise one. And it was simpler... and very limited and now it has more features and it's getting more and more complicated. But they do the exact same thing. It's not like the examples that Harald put, where the business need is the same, but with several approaches. For me the first thing to rip in a separate module, as only few people uses it (I don't know any, but I suppose the Acsone customer that funded the development is one of them), of all the chaining lines logic. Then, fix and maybe simplify the mixin for readability (although having some little duplications). |
Answering to your comments: Our business workflow would be a mixing with periodical invoicing, membership and periodification of the income (account_spread_cost_revenue). Nothing special. It's a flow known by you, Pedro, as you know how do Associations work. And our main needs for periodical invoicing are:
After several testing, subscription_oca fits better in our flow, as contract is too complex for this project. It's as when you need to buy a car. Do you need the best car of the market? Or you just need a car that can be used for the needs that you have? And the main reasons are:
Considering this, and considering that subscription_oca is an OCA module, we just want to improve something that already exists. We are not the initial authors of the module. We are trying to improve it, considering that it's already in OCA since several older versions. On the other hand, as Pedro said, other users are improving subscription module so... Probably we are not the only team that decided to use subscription instead of contract. I'm sure that their decisions were quite similar as ours: the current complexity of contract module. I agree to separate the contract module in different pieces, and deprecate subscription module for next versions (V18...) but I think it's already impossible to make that huge refactoring in a stable version (V17) without creating a huge trouble to other Odoo partners that are using it in their clients. Denis, we would love to go to the OCA Days, but I think that we're no coming this year, neither 😢 How could we solve everything with a decision that satisfies all parts? The main objectives are:
Let's brainstorming 👍😂 |
As commented directly, Ripping out in new extra modules the renewal and successors/ancestors features will totally light the module. Also an option can be enabled for not showing the line recurrency boolean and always work in the "simple mode". About the existing users, I hardly believe somebody is using those features, but they can be detected through migration scripts, and putting that extra modules in state |
Considering your mentions, I understand that we would have something like:
WDYT? |
Yes, the last one can be one called |
Hi, I agree with both of you on splitting the base module and extracting the renewal feature and the contract line relation. This should help with maintaining and evolving the project. As @pedrobaeza proposed, we should consider a migration script for existing projects using those features. Additionally, I believe it's time to review the mixin implementation and simplify the abstraction level. IMO, This is currently the most complex part, which discourages developers and causes them to lose interest in the contract module. |
Yes, there are two mixins created:
but at the end, this makes it more confusing. I vote for removing both. |
Hi @pedrobaeza @sbejaoui ,
Do we need to delete abstract models with the inconvenience of having to create the fields/functions/etc manually in other models? I have created a diagram of the inheritances to have a visual reference: WDYT ? |
In fact, maybe recurrence functionality could be done somehow in a separate module (e.g.: base module to define base models, security, menus). FYI, I've already externalized some functionalities that can be used by other flows about recurrence there : https://github.com/OCA/server-ux/tree/13.0/base_recurrence |
We would be doing the same thing but extending it to external modules. The base_recurrence module would have to be extended, so instead of the "contract.recurrency.basic.mixin" class we would have an extension of the "recurrence.mixin" class. But it is a possible idea. |
Yes, that was just a pointer to reuse some code |
I think About |
Hello,
We were considering the following issue and we need some clarification on certain questions that have arisen from studying the needs for the subscription_oca module.
Currently, the subscription_oca module is designed and intended to work only with sales; however, we are considering the possibility of refactoring it in order to make it more versatile and usable in purchases as well.
To achieve this, we will need to do the following:
This way, the module will be much more versatile.
We believe that the module should have been designed this way initially (more or less):
We would do this in V17, as we recently performed the migration ourselves (3 weeks ago), so there will be few users using it in production. This will minimize any problems to other users that may arise.
@rousseldenis @etobella @pedrobaeza could share your opinion about this?
THX in advance!
P.S: We have considered contract module as well, but it doesn't cover the needs of our project. Subscription suits better for us.
The text was updated successfully, but these errors were encountered: