When performing an email or SMS mailing on functional models a default domain
is a good start to avoid sending notifications to dead records, aka
* canceled registrations;
* canceled tracks;
* canceled sale orders;
Task ID-2431217
COM PR odoo#67322
ENT PR odoo/enterprise#16876
UPG PR odoo/upgrade#2236closesodoo/odoo#67322
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Remove hardcoded list of models on which mailing is possible. Indeed it is
not modular and not really smart with enterprise code not being reachable
in community.
SPECIFICATIONS
Replace hardcoded list of models on which mailing (both mail or sms) is
possible by a computed searchable field on ``ir.model`` based on a class
attribute.
It allows to cleanly define models having mass mailing capabilities and add
this attribute in bridge modules (when existing) or directly on base model
definition to avoid bridge modules.
In this commit we introduce a basic ``_mailing_enabled`` class attribute
activating mailing on model.
Mailing models may also have a ``_mailing_get_default_domain`` method allowing
to define a custom default domain when sending a marketing mailing on records
on this class.
Mailing models can now define a ``_mailing_get_opt_out_list(_sms)`` method
allowing to define custom behavior to fetch opt-outed records. Instead of
defining a model-based behavior on Mailing itself, it now calls the model
defined one. We still have two methods, one for mailing and one for SMS
opt out computation as it relies on different underlying models and fields.
LINKS
Task ID-2431217
COM PR odoo/odoo#67322
ENT PR odoo/enterprise#16876
UPG PR odoo/upgrade#2236
In this commit we rewrite the compute on mailing domain to simply reset it
once the mailing domain is changed. Indeed trying to keep a previous domain
based on try / except has no meaning from functional point of view. If model
changes then domain should change as it is a business record, not just a
technical domain to try to apply.
LINKS
Task ID 2088577
PR #41877
Enterprise PR odoo/enterprise#7278
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Aurélien Warnon <awa@odoo.com>
PURPOSE
Try to move from onchange / default_get to stored editable computed fields.
Normally behavior should be the same (computed or set by user), with support
in create / write + onchange without additional code.
SPECIFICATIONS
Update classic fields with onchange to stored editable computed fields. It
means their value will come either from manual user input, either computed
based on triggers. Purpose is to remove all onchange and default_get when
possible.
Clean fields definition inconsistencies, like default / required on computed
fields. Indeed computed fields should always have a value, maybe coming from
user input. They should not have default / required that are attributes for
classic fields.
LINKS
Task ID 2088577
PR #41877
Enterprise PR odoo/enterprise#7278
Specifications
* sms, in the form view of sms composer : the count of all record doesn't
match the reality in a multi-company environment. The search_count was
done is sudo, then records of other company was taken in account in the
count. Fix by explicitly setting fields as computer_sudo=False;
* mass_mailing, in the kanban view of mail marketing : A warning ribbon
("insufficient credit") appeared on the kanban item of mass mailing, but
the message was for sms marketing views only. Change the attributes to be
invisible for mail marketing;
* mass_mailing, in the form view of mail mailing : Weird default domain
filter ([0 = 1]) was display instead of an empty domain filter;
* mass_mailing_sms, in the test sms wizard, remove a duplicate error message :
When the number format was wrong a duplicate error message pop up. Fix by
simplify the model and remove useless computed fields.
* mass_mailing_sms, in the test sms wizard, rename the label "Number" to
"Number(s)" to show that it can multiples ones.
Task ID 2073016 (sms fixes)
PR #37185
PURPOSE
Mass mailing is currently a bit messy. As SMS will be added as a way to notify
people in mass through SMS let us take this opportunity to somehow clean this
application: organization, light code cleaning, model renaming.
SPECIFICATIONS
Rename mail.mass_mailing model to mailing.mailing. Rationale :
* mailing is now a prefix for mass mailing models;
* mailing.mailing is easier to read / find / understand;
Note that mail.mass_mailing.campaign is not updated as it is likely to be
removed soon and replaced by simple utm.campaign model.
MIGRATION
mail.mass_mailing model -> mailing.mailing
mail_mass_mailing table -> mailing_mailing
LINKS
Task ID 2037906
Preparing task ID 1997464 (SMS addition in mass mailing)
PR #34938
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.
Task 1937686
closesodoo/odoo#31243
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- Create an event, add an attendee
- Click on the stat button 'Mail Attendees'
The domain is shown as 'Event', '?', [id].
This is because the domain selector widget doesn't support the `in`
operator. Supporting it is not trivial, since ultimately `field_utils`
cannot parse a list of ids for a Many2one. It's less intrusive to change
the domain, since a standard use of the method will simply contain a
single id.
opw-1878322
Before this commit, when cliking on "mass mail attendees" on a event form
the default domain on the attendees for determining the mass mailing recipient
was lost in an onchange
After this commit, we retrieve the right domain
OPW 1869308
closes#26081
This commit removes the strange selection box based on a magic flag and
some strange methods returning a string. Instead just allow to send mass
mailing on all models inheriting from mail.thread using the is mail
thread flag.
Various addons are updated to remove the _mail_mass_mailing class
attribute used to determine mass mailing capability.
We consider people could send a mass mailing on every model inheriting
from mail.thread. It makes no sense to limit it to a given set of addons.
If the event has some attendees a button is displayed to launch a mass
mailing on those attendees. This button requires a new bridge module
between mass mailing and event.