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
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
2234
Tampilan
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!
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
How to show field if selected
Diselesaikan
|
|
1
Mar 21
|
4122 | |
Add month to date field
Diselesaikan
|
|
2
Jun 22
|
17720 | |
|
0
Jul 20
|
3323 | ||
|
1
Jul 19
|
6764 | ||
|
1
Mei 16
|
16898 |