跳至内容
菜单
此问题已终结
5 回复
5345 查看

So basically I have Maintenance addon and it is sending email whenever there is for example stage change of the maintenance request. But I can't find where it is defined. There is nothing inside tab Technical > Templates in developer mode. I tried searching for key phrases in odoo files but without success.
How do I access them?

形象
丢弃

Have you checked the code of that specific addon?

编写者

Yes, I tried searching for it but without success.

最佳答案

Hi Andrzej:

The "Tracking" attribute is enabled at the field level.

  • Enable Developer mode

  • Go to Settings > Technical > Models (under Database Structure) and open the "Maintenance Request" model

  • Open the "stage_id" field. In the Base Properties section, "Tracking" has been set to "On Change".

This is causing all the changes in this field to be tracked in the Chatter which in turn is triggering the notifications to the followers.

形象
丢弃
编写者

I see... But how do I change the format of this message?

Please elaborate on what you mean by "format of this message". I didn't quite understand your question.

编写者

I want to change body of that message, write something else in the email.

It is defined as a "System Notification". Go to Settings > Technical > Messages and group by "Type". Looks like the message cannot be changed since there is no "template" associated with it.

编写者

Even in the files somehow? I have no problem with modifying source code, but I couldn't find the thing.

This seems to be where the emails are getting composed in the code:

https://github.com/odoo/odoo/blob/12.0/addons/mail/models/mail_thread.py#L2202

编写者

And from where does the body of the message comes from? I'm having trouble tracing it back to the source.

The body of the message is being compiled by looking at all the tracked fields in the model and logging the values of the fields that have changed. Take a look at this piece of the code that is part of the base functionality.

https://github.com/odoo/odoo/blob/12.0/addons/mail/models/mail_thread.py#L625

最佳答案

Hi,

   Make sure that if there any automated action defined for maintenance.for that Enable Developer mode --> technical --> Automation -->Automated actions           

形象
丢弃
编写者

No, there is no automated action defined.

相关帖文 回复 查看 活动
0
8月 19
2170
0
8月 19
2571
2
2月 25
1443
2
1月 24
1680
2
12月 23
1659