Comments (12)
Well, being strict, it's called "Inheritance by delegation". Here is a good definition: https://www.odoo.com/es_ES/forum/ayuda-1/question/delegation-inheritance-in-odoo-v8-when-is-it-useful-84890
from contract.
In the description, I see purchase in one side, and sale in other. What exactly do you want?
from contract.
Basically I just want a way to sell a contract, sorry for the bad wording.
I need a customer to be able to purchase one product through sales processes that would then create a live contract based on the template assigned in the product. The first invoice will be generated by normal sales, and the subsequent ones via the contract invoice lines.
Example:
- Customer purchases
Odoo
instance- Customer is immediately billed Odoo startup fee rate (determined in product)
- Subsequent billing is based on recurring invoice lines in contract
from contract.
My idea of this is to have a new module that adds at product level a check "Create automatically a contract" (similar to the current one "Create automatically a task"), that makes visible a field to select a template contract (with the other module you have made the RFC), or directly an existing contract (we can add a feature to mark a contract as a template, invalidating in the invoice generator role - I prefer this way as we save several new models -).
When a sales order with this product is created, then the template contract is duplicated, the customer is assigned in the copy, and the next invoice date is set for the next period starting on the order date.
What do you think?
from contract.
Sweet your plan pretty much aligns with what I was thinking too.
Regarding the marking of a contract as template, I added that functionality in #42 via changes outlined in #42 (comment). I debated as to whether or not to use the same model, but landed on a new one because it will allow for the integration of logic such as deltas for use as dates when filling in the actual contract.
from contract.
OK, I see. Well, I like the idea of reusing code via inheritance, although there are physically 2 tables in the DB.
from contract.
Yeah this is true, and technically there would be some data duplication between contract templates and the real contracts.
I feel that a contract template does not meet the definition of an analytic account though. They will never be billed or reported on in their form, but would contain a bunch of logic for doing so.
On a similar note, I plan to add some other logic into the templates that would be unrelated to an analytic account. An example of some of the logic I am thinking are things like the existing markers, but for the templates:
- Add the customer name into the analytic account name
- First contract invoice date is +X days from contract create date
I felt like that was all a decent reason to provide the isolation and allow the data dup.
from contract.
Maybe a polymorphic inherits makes more sense? Still two tables, but no dup
from contract.
OK, I think this approach is also good.
from contract.
That doesn't serve, because you can modify certain things in the contract after assigning the template, and with delegated inheritance (that's the chosen name for this 😉), you will change the template, not the contract.
from contract.
you will change the template, not the contract.
Ahh yeah good point, that could cause some major issues!
delegated inheritance
Good to know thanks. Weird that the given name conflicts with the all other languages' definition of delegate inheritance, which includes methods as part of the definition. Polymorphic is usually only properties, so you'd think that'd be the name! Oh well 😕
from contract.
Closing to track in PR #49
from contract.
Related Issues (20)
- Issue with auto pricing on contract template lines HOT 1
- Migration to version 17.0 HOT 5
- Error when selected auto renew in contract template HOT 3
- Invoice lines are not assigned with the correct partner_id HOT 2
- Question regarding subscription and contract modules HOT 7
- [16.0] contract: Error migrating from 15.0 to 16.0 HOT 5
- [16.0] Bugs and improvements in subscription_oca HOT 3
- [16.0] Problem with post-period contracts HOT 2
- [16.0][BUG] contract: 'last_date_invoiced' is not calculating correctly on the lines.
- [16.0] contract: Invoices after contract termination HOT 6
- [16.0] subscription_oca: error when creating subscription invoice (manually or cron) with "Next Invoice Date" value is empty
- Reccuring Stopped
- [16.0] Error Group by date end
- [17.0] New module: subscription_oca_purchase HOT 1
- Purpose of refactoring subscription_oca module HOT 18
- [17.0] Bug in subscription_oca
- [17.0] bug in contract HOT 1
- [16.0] Wrong translation HOT 2
- [16.0] Wrong translation HOT 1
- When creating invoice, the last_date_invoice is with wrong date for 2 or more products HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contract.