I'm stuck.I have field.date contract_start ,field.selection contract_duration and field.char contract_expired.What i want is when a person chooses a date they want their contract to start and for how long they want their contract to last, contract_expired get the date for when the contract ends.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
1
Respondre
2211
Vistes
Hi Zlatt,
You can calculate the expiration date by adding the duration to the start date. In Python, you can use the datetime module for this:
pythonCopy codefrom datetime import timedelta contract_start = # Your contract start date contract_duration = # Your selected duration, e.g. 3 (for 3 months) contract_expired = contract_start + timedelta(days=30 * contract_duration)
This will give you the date when the contract will expire.
Regards,
Team Ksolves!
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
1
de març 21
|
4105 | ||
Add month to date field
Solved
|
|
2
de juny 22
|
17697 | |
|
0
de jul. 20
|
3316 | ||
|
1
de jul. 19
|
6746 | ||
|
1
de maig 16
|
16872 |