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
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
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
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
1
ago 25
|
711 | ||
|
0
ago 25
|
64 | ||
|
1
ago 25
|
1027 | ||
|
2
ago 25
|
489 | ||
|
2
ago 25
|
535 |