Skip to Content
Menu
This question has been flagged
1 Reply
2469 Views

We have Odoo setup now to create a project from SO's, with tasks in that project generated from appropriate services the customer is purchasing. This is a great way for them to be able to track the progress of their order via the portal, we've found.


However, it seems we have to manually add the customer as a follower to the project once it's created. The closest to a resolution I've found was a feature request for v7: https://bugs.launchpad.net/openobject-addons/+bug/1099181


I still can't find a way to do it in v9c. Suggestions?    

Avatar
Discard
Best Answer

Hello,

I think it depends on they way you're linking the SO to the Project as:

* if you're modified the Project to fetch the SO ID, or the Customer ID [m2o to customer or SO]. Then you can add the customer to the follower from the automated actions under Technical -> automation -> automated Actions. 

* But if there is no relation between the project and SO/SO customer, I think you need to modify the method that creating the Project from the SO, to subscribe the customer as:

project.message_subscribe_users(user_ids=[so.partner_id])


Update:

If you'll override the _get_project function then you can add after this line:

project.message_subscribe(partner_ids=[project.partner_id.id])


So this will add the customer to the Project ..


Hope this could help a little bit ...

Avatar
Discard
Author

Definitely helpful, thank you. I'm only stuck in finding how exactly Odoo is creating the project from the SO. I did this via the setting Project->Configuration->Settings->Sale Service->Generate tasks from sales orders

It didn't create any automated actions that I can see, but it is able to create a project named after the SO, and all tasks contain the SO in them as well as the item/product name.

Author

I did try throwing "project.message_subscribe_users(user_ids=[so.partner_id])" into sale_service.py, under "if not project:" (line 67) and it's coming back with "NameError: global name 'so' is not defined" when I confirm the SO/generate the project.

Mate !, I just thought you made some customization on generating the Task ... So I think you need to modify the method that generating this tasks .. I'll post here again if I found spare time ...

I've updated my answer ...