hi
I want to set delivery lead time/manufacturing lead time in hours unit.
Is there any solution to change default unit of days to hours?
Thank you so much
HB
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
hi
I want to set delivery lead time/manufacturing lead time in hours unit.
Is there any solution to change default unit of days to hours?
Thank you so much
HB
Hi,
Please refer to the code below:
class ProductTemplate(models.Model):
_inherit = 'product.template'
delivery_lead_time_hours = fields.Float(
string='Customer Lead Time (Hours)',
compute='_compute_delivery_lead_time_hours',
inverse='_inverse_delivery_lead_time_hours',
)
@api.depends('sale_delay')
def _compute_delivery_lead_time_hours(self):
for rec in self:
rec.delivery_lead_time_hours = rec.sale_delay * 24
def _inverse_delivery_lead_time_hours(self):
for rec in self:
rec.sale_delay = rec.delivery_lead_time_hours / 24
Hope it helps.
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
Customer Lead Time + Multiple Products Ordered
Diselesaikan
|
|
2
Jan 25
|
1102 | |
|
0
Jun 25
|
915 | ||
Delivery Lead Time/Delivery Date on PO Not Working
Diselesaikan
|
|
1
Okt 21
|
4709 | |
|
1
Jul 18
|
2639 | ||
|
0
Mar 15
|
3359 |