[FIX] sale_timesheet: fix default value in service invoicing policy
Purpose of the task is to fix the default value of service invoicing policy of existing products when sale_timesheet is installed. when first sales app is installed and product is created with type service then later on sale_timesheet module is installed then on that product default value in service invoicing policy is none while the product is worked as 'Ordered quantities' so in compute set service invoicing policy to 'Ordered quantities' for those products. closes odoo/odoo#41515 Task: 2146778 Closes: #41515 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Barad Mahendra
parent
5d1837d250
commit
80f7c3fbd6
@@ -33,7 +33,7 @@ class ProductTemplate(models.Model):
|
||||
policy = None
|
||||
if product.invoice_policy == 'delivery':
|
||||
policy = 'delivered_manual' if product.service_type == 'manual' else 'delivered_timesheet'
|
||||
elif product.invoice_policy == 'order' and product.service_type == 'timesheet':
|
||||
elif product.invoice_policy == 'order' and (product.service_type == 'timesheet' or product.type == 'service'):
|
||||
policy = 'ordered_timesheet'
|
||||
product.service_policy = policy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user