Can anyone advise where to change the lead time to "x" amount of weeks and not days or alternatively make it a fillable field and not a certain amount
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
Hi,
- Odoo uses days internally for lead time calculations (security lead time, supplier lead time, customer lead time, manufacturing lead time, etc.).
- The field type is Integer or Float (days), and Odoo converts that into expected dates in planning/delivery.
- This is why you only see days, not weeks/months.
Options to Handle Weeks Instead of Days
1- Options to Handle Weeks Instead of Days
* If you want “2 weeks”, just enter 14 days.
* Simple and works with Odoo’s logic.
* You could also add a helper note in the field’s label (Lead Time (in days, e.g., 14 = 2 weeks)).
2- Change Field Behavior to Accept Weeks (customization)
* If you want the field to be in weeks, you can override it:
Example (for customer_lead on product):
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
customer_lead_weeks = fields.Float(
string="Customer Lead Time (Weeks)",
help="Lead time expressed in weeks instead of days."
)
def _convert_weeks_to_days(self):
for product in self:
product.customer_lead = product.customer_lead_weeks * 7
* You then hide the original customer_lead field in views, and show your new customer_lead_weeks.
* Use onchange or computed field to keep both fields in sync.
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Aug 25
|
2 | ||
|
2
Aug 25
|
322 | ||
|
0
Aug 25
|
4 | ||
|
0
Aug 25
|
7 | ||
|
0
Aug 25
|
5 |