Currently partners have a boolean field to choose whether to receive notifications only in their Odoo inbox or to receive them in their inbox and by email. This leads to several issues : * if a customer is configured to not receive emails he will not receive any notification on sales orders, leads, ... This is not clearly indicated to the salesman and it is not easy to know how to change that behavior * if an user chooses to receive emails and does not use its inbox a lot of notifications stay in Odoo. The user has to manually set them as done to make them disappear which is redundant. This commit changes that behavior. From now on customers will always receive all notifications by email. Indeed Odoo is not a customer oriented mailbox. Moreover sales orders or discussions on leads send to customers should always be sent by email as it is the standard communication mechanism. Users will be able to choose to receive notifications in Odoo or by email. The choice is no longer inbox or inbox + email, but inbox or email. Choosing one option or the other one depends on the way the user wants to work. Technically the field is moved on the users model and selection keys are renamed. Notification process is modified * notified_partner_ids contains as before specified recipients as well as followers matching the subtype * customers and users working with emails are notified. During that process customers notifications are marked as done to be able to track the email state without having needaction. Users notifications are currently deleted as we do not track their email state. The removal of partner field implies changes in various addons that define partner data with this field set in the values.
82 lines
4.3 KiB
XML
82 lines
4.3 KiB
XML
<?xml version="1.0" ?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<record id="res_partner_view_form_inherit_mail" model="ir.ui.view">
|
|
<field name="name">res.partner.view.form.inherit.mail</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='user_id']" position="after">
|
|
<field name="opt_out" string="Mailing Opt-Out" groups="base.group_no_one"/>
|
|
<field name="message_bounce" groups="base.group_no_one"/>
|
|
</xpath>
|
|
<xpath expr="//sheet" position="after">
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="res_partner_view_search_inherit_mail" model="ir.ui.view">
|
|
<field name="name">res.partner.view.search.inherit.mail</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_res_partner_filter"/>
|
|
<field name="arch" type="xml">
|
|
<filter name="supplier" position="after">
|
|
<separator />
|
|
<filter string="Available for mass mailing"
|
|
name='not_opt_out' domain="[('opt_out', '=', False)]"
|
|
help="Partners that did not ask not to be included in mass mailing campaigns" />
|
|
<separator/>
|
|
<filter string="My Activities" name="activities_my"
|
|
domain="[('activity_ids.user_id', '=', uid)]"/>
|
|
<filter string="Today Activities" name="activities_today"
|
|
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter string="Upcoming Activities (7 days)" name="activities_week"
|
|
domain="['&', ('activity_ids.date_deadline', '>=', context_today().strftime('%Y-%m-%d')),
|
|
('activity_ids.date_deadline', '<=', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))
|
|
]"/>
|
|
<filter string="Overdue Activities" name="activities_overdue"
|
|
domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
|
help="Show all records which has next action date is before today"/>
|
|
<separator/>
|
|
</filter>
|
|
</field>
|
|
</record>
|
|
|
|
<!--Definition of an email template with an empty body that will be used in partner mailing. Used to give a
|
|
basis for email recipients, name and to ease the definition of a further elaborated template. -->
|
|
<record id="email_template_partner" model="mail.template">
|
|
<field name="name">Partner Mass Mail</field>
|
|
<field name="model_id" ref="base.model_res_partner"/>
|
|
<field name="auto_delete" eval="True"/>
|
|
<field name="partner_to">${object.id}</field>
|
|
</record>
|
|
|
|
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
|
|
<act_window name="Partner Mass Mailing"
|
|
res_model="mail.compose.message"
|
|
src_model="res.partner"
|
|
view_mode="form"
|
|
multi="True"
|
|
target="new"
|
|
key2="client_action_multi"
|
|
id="action_partner_mass_mail"
|
|
context="{
|
|
'default_composition_mode': 'mass_mail',
|
|
'default_partner_to': '${object.id or \'\'}',
|
|
'default_use_template': True,
|
|
'default_template_id': ref('email_template_partner'),
|
|
}"/>
|
|
|
|
<record id="email_template_partner" model="mail.template">
|
|
<field name="ref_ir_act_window" ref="action_partner_mass_mail"/>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|