[IMP] sale_timesheet: update product type onchange to avoid a empty invoice policy

task-2047389         closes-5388
This commit is contained in:
MaxLarue
2019-09-18 12:05:19 +00:00
committed by Geoffroy Larue
parent 740d2f2617
commit a40e734ac3
+2
View File
@@ -94,6 +94,8 @@ class ProductTemplate(models.Model):
if self.type == 'service' and not self.invoice_policy:
self.invoice_policy = 'order'
self.service_type = 'timesheet'
elif self.type == 'service' and self.invoice_policy == 'order':
self.service_policy = 'ordered_timesheet'
elif self.type == 'consu' and not self.invoice_policy and self.service_policy == 'ordered_timesheet':
self.invoice_policy = 'order'
return res