This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.
We removed redirect_with_hash that was only for retro compatibility
local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.
Default code for redirect is 303 now instead of 302.
Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.
All werkeug.utils.redirect has been replaced by request.redirect.
Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.
Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.
Migrate your code:
http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect
Courtesy of odony for help and review ;)
closesodoo/odoo#72599
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
_("Foo %s", bar)
to progressively migrate the code to the new syntax.
A few calls were not technically incorrect but still detected by the
linter.
_("Foo" +
"Bar")
has been converted to
_("Foo"
"Bar")
as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).
closesodoo/odoo#53683
Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Issue
- Go to unsubsribe sms page where the 'sms_code' is the same
in multiple traces
- Fill the correct phone number (same one of any traces)
- Click on 'Unsubscribe me'
Traceback is raised.
Also, if empty phone number, still have successfull message.
Cause
Multiple traces with same "sms_code" but different "sms_number".
The current behavior does not handle multiple traces.
Solution
- Filter and retrieve the trace with the correct "sms_number".
- Add 'required' attribute on phone number input.
opw-2264200
closesodoo/odoo#52452
X-original-commit: 34a8f63332e8269c2dbf5fa2b3ca16913798532c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
- Change the name of "Mass SMS" by "SMS Marketing"
- Improve the Mass Mailing views (kanban, form)
- Improve the Mass SMS views (kanban, search, form)
- Hide the sanitized numbers from views (sometime replace by mobile)
- Fix demo data of sms
- Explain the language field of sms template
- Improve the render of the sms composer wizard
TASK_ID : 2053631
PURPOSE
SMS are a powerful marketing tool. For instance it is perfect to announce a
sale or to communicate a coupon code, to welcome a new customer in a fidelity
program, ...
Purpose of this task is to integrate SMS sending in batch in mass mailing. It
will use same mailing objects but sending SMS instead of emails. Some metrics
and flows will have to be slightly updated at the same time.
SPECIFICATIONS
Create a new application called "Mass SMS" that follows the structure of
mass_mailing application.
General guidelines
* use the fa-comment icon for this module;
* add a "Notification type" field to the mailings: email or sms. Set it
invisible and set as domain from context when choosing mass mailing or
mass sms application (menus / action specific);
* adapt the metrics from Mass Mailing to SMS
* sent = received = whether the SMS was sent or not;
* opened => we don't have this information;
* replied => we don't have this information;
* clicks = from link tracker (no change of behavior);
* bounced = SMS that failed to be delivered because the format is wrong;
* exception = any issue when sending SMS;
* keep the Mailing Lists menu, hide email related fields on contact model;
* settings: hide the "Specific Mail Server" feature
Mailing form view
* add an "SMS Content" tab between Mail Body and Options. In there, we should
have the following fields:
* content
* opt-out link: provide a link to the Unsubscribe page. Make it as short
as possible;
* SMS Template
* add an "SMS Text Message" Medium;
Mailing actions
* add an "SMS Sent" smart button. Use the fa-comment-o icon and it should
redirect to the same list views as the "Email sent" smart button and list
the contacts to which an SMS was sent;
* add a "Mobile" field in the list views of the "Email sent" smart button:
* adapt the TEST button > Test Mailing modal to SMS (we should have 1 button
for Email and 1 for SMS); update description;
* default value for the Recipients field should be Name of the current
user, work mobile/phone number;
* If there are no Work Mobile/Phone numbers set on res.users, display
(123)-456-7890 instead;
* rename the Send Sample Mail button into Send Sample SMS;
* adapt the SEND NOW button > Confirmation modal to SMS. Change the message
into "This will send the SMS Text Message to all recipients. Do you still
want to proceed?"
* hide the following elements: Subject, From, Reply to, Attachments, Mail
Server, Mail Body tab; Opened, Replied;
* adapt the label of the following "warnings" to SMS
* x SMS Text Message(s) have been ignored and will not be sent.
* x SMS Text Message(s) are in queue and will be sent soon.
* x SMS Text Message(s) could not be sent.
Mailing kanban view
* hide the following stats: https://nimb.ws/grvBn0: Opened, Replied;
Mailing list / contact management
* following fields should be left empty: https://nimb.ws/3HBeJL: Opened,
Replied;
* when browsing through mailing lsits and contacts through the Mass SMS
application, update actions and views to hide fields related to
email and display only phone-related information;
UTM Campaign
* form view > Related Mailings tab: the following fields should be left
empty if notification type = SMS: https://nimb.ws/nfvr1O: Opened, Replied
Mass Mailing > Reporting (mail.trace.report model)
* adapt the reporting based on the fact that we do not have the following
metrics for SMS: Opened, Replied;
Mass Mailing > Configuration > Blacklist
* do not display any email information (phone blacklist is about phone);
* support phone blacklist. Phone blacklist is therefore a separate model
from mail.blacklist to simplify management. It is included in sms sending
process like mail blacklist when mailing in mass;
Opt-out and blacklist handling
* we do support mailing lists because they could come from different sources
and are a way to communicate with a specific audience (and not just a list
we bought), e.g. subscribe to this list to be kept updated whenever this
product is back in stock, or to receive results of this ...
* if the SMSing is from a list, opt-out removes ourselves from the list;
* if it is from the contact ==> Sent to blacklist;
* allow to attach unsubscription links in sent SMS, redirecting to a new
route in mass mailing SMS allowing quick unsubscribe and/or blacklist
of phone numbers;
Error management
* if the user clicks on Send Now / Schedule / Test and does not have enough
credits, open the "Insufficient credits" modal in a lazy option (aka when
having failed statistics linked to insufficient credits);
* on the mailing, we however display this failure as :
* a message on the mailing kanban view
* a message on the top of the form view + same behavior as the mailing and
"Could not be sent" https://www.screencast.com/t/BExgd1Gc;
LINKS
Task 1997464
PR #34424
Original SMS addition: Task 1922163 (4287481)