This question has been flagged
2 Replies
2023 Views

Hello guys, 

with this post i know it is possible to create a task when an order is validate "Automatically create Task When order validate - Odoo V12"

Now I would like to be able to create only one task per quote and not per product in the quote. 

For that I see 3 solutions: 

- Add a line in the quotation that allows you to create the task (for example the product development) and make it invisible (customers don't need to see that)

- Create a task for a quote and not for a product

- Create a task for a product set


Do you have any simpler ideas or a way to do one of the 3 above?


In addition to that I would like to modify the name of the task created according to the elements of my estimate, is it native or do you know the location of the code allowing the transfer of information from the estimate to the task to be able to overload it?


edit : 

so in reality what I really need is to know where the method that creates the task or project since the validation of the quote is, do you know where I can find it and what its name is?


edit 2 :

I finally solved my problem, the function to overload to add new fields or modify existing ones is the following method :

https://github.com/odoo/odoo/blob/master/addons/sale_timesheet/models/sale_order.py#L267

the entry point is here:  

https://github.com/odoo/odoo/blob/master/addons/sale_timesheet/models/sale_order.py#L193

To have only one task / project per quote and not per product, you must override the _timesheet_service_generation method of the SaleOrderLine class located in sale_timesheet/models/sale_order.py


This subject can be closed.

Avatar
Discard
Best Answer

Hi Anatole,

Why don't you created an automated action? In this automated action you can create a task on the moment that the quotation is confirmed.


Regards,

Yenthe

Avatar
Discard
Author Best Answer

Hi Yenthe,

because it is possible to do it with an native function in odoo and i would like to override this function to personalize the way it works. My problem is that I don't find this function in the code of the "Sales" and "Projects" modules

But thank you for your answer I will still look at the automatic actions.

Avatar
Discard