CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I like to trigger an email to some users on every change in all project issues (notes logged, email sent or received, state changed, opened, closed, deleted). How can I achieve this? I don't fear hacking in Python or XML, no problem.
This is what the follower/notification system in OpenERP 7.0 does.
Notifications in OpenERP 7.0
When you are following an issue, you get an email for new entries added in the history log at the bottom of the issue, depending on the kind of notifications you are following. You can select the kind of notification you want to receive using the checkboxes that are located below the "Follow" button:
Each notification for any of those events will be sent to your Inbox inside OpenERP (in the Messaging/Inbox menu), and you can then control whether those notification should also be sent to your external mailbox in the user preferences. By default you only follow new comments, and they are automatically forwarded to your external mailbox.
You don't need to do any custom development unless you want to change this behavior in any unforeseen ways. Note that users automatically follow new issues if they are followers of the project.
Additionally, OpenERP v7 provides a convenient "email alias" system, as described here in the release notes. This lets you map a specific email address for each project, as soon as you have configured a global domain redirection. Then any inbound email will create an issue or task in the appropriate project directly.
Let's say you configure the email subdomain "erp.mycompany.com" as a catch-all that redirects all incoming emails to the OpenERP inbound mail script (located in the
mail/static/scripts/mail_gateway.py). This requires an appropriate configuration of your inbound mail system (outside OpenERP), and then a proper configuration of the corresponding OpenERP setting:
The email alias system also works if you have configured manual fetchmail rules instead of a global catchall redirection.
Basically whenever any incoming email is routed to OpenERP (through fetchmail rules or the
mail_gateway script), the "To" address will be looked up in the aliases mapping, and the fallback routing (such as the one you can configure on a fetchmail rule) will only be applied if no alias matched.
Projects (and other objects like Sales Teams, etc.) will automatically setup appropriate email aliases when you create them. You can change the alias address on the project itself, it's visible on the project form as soon as a catchall domain is configured, or you can manually create and edit aliases in the alias menu (
Settings/Technical/Email/Aliases, requires Technical Features access right).
Each email alias has an optional set of "Default values" that will be applied to new documents created through this alias - this is actually how the automatic assignment of a project on new issues or task works. The system configures it by default but you can edit the default value to do other things, automatically assign a responsible user, etc.
These concepts may be a bit complicated to understand but they are in fact pretty simple yet extremely flexible and powerful. You can create as many email aliases as you want and dynamically route them to any destination table in the system, with any default value you want.
Technical precision about the setup: a global "catchall" redirection is the most flexible way to setup this system, but it requires technical skills, management access to the company's mail servers, availability of a DNS subdomain that can be assigned to this, etc. This is automatically configured for all users on OpenERP Online, but may not be easy to setup for on-site deployments.
When this is not possible you can still benefit from the dynamic email aliases by using fetchmail rules, and you don't necessarily have to setup one external email box to fetch for each alias. Many modern email systems and providers such as GMail support a feature called "plus addressing": if you have an account
firstname.lastname@example.org, you will also receive emails sent to
email@example.com, etc., without having to configure anything. Then because these emails will be fetched by your OpenERP rules, you can setup email aliases in OpenERP to match the relevant "plus addresses" that you are using. An alias
mycompany+project1 would then match all emails sent to
firstname.lastname@example.org if you have configured a fetchmail rule for GMail account
One question regarding this thread...
normaly in a standard installation there is
email@example.com as the basic alias for everthing in this model. everything after "project" is added but i need to change the basic project. (hardcoded or configureable somewhere ? )
i have searched around but could not find anything to change the "project" to something else as the NEW STANARD in this DB like ....
example why i want this ...
2 companies --> one domain 2 databases to separate the companies.... so i wanted to separate it with a subdomain at least
or having 2 different mailboxes used... BUT in one domain i can only have ONE Mailbox called "project"
so i wanted to use firstname.lastname@example.org and email@example.com as mailbox but i need to change the model alias base from "project" to projectcompany1 or 2 in each DB ...
QUESTION is ...
is it possible ? where ? i know only the place of the project itself and change the mailalias on every project creation for theproject, but this means taking a lot of care cause standard is still "project" ..... so if a user forget to do this mails gets lost ...
is it a good idea ?
otherwise YES I KNOW make a second domain for this kind of setup ..... but lets say this is not possible
would be nice to read from someone about this
About This Community
Odoo Training Center
|Asked: 11/7/13, 1:08 PM|
|Seen: 9407 times|
|Last updated: 4/21/15, 1:29 PM|