Commit Graph
12 Commits
Author SHA1 Message Date
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
Thibault Delavallée 3e7acff8d9 [FIX] website(_sale): fix logs coming from website forms
Purpose of this commit is to avoid html entities in logged message by correctly
managing enclosures. For that purpose a new tool 'nl2br_enclose' is added that
eases Markup management on top of 'nl2br' simple tool.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:31 +01:00
Thibault Delavallée eccac1ce7b [FIX] website(_sale): stop creating message manually
In website(_sale) messages are created from website forms. However those
are technical models, you should always use the MailThread API notably to
ensure values coherency. In our case using message_log seems to be what
original committers wanted to do (even creating a message as a comment
which has no effect as the notification process is not called that way).

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:31 +01:00
Wolfgang Taferner 7f684fcac0 [FIX] website_form: prevent crash on form many2one attachment upload
The current implementation of the many2one file upload in website form
will lead to a traceback in case of m2o fields.
It is currently only working with x2many fields. Note that it was
introduced as such with [1].

Step to reproduce:
- install website_sale
- drag & drop form snippet and click on it
- select "create customer" as action option
- add new existing field
- select "Main attachment" and save
- try to submit the form with a file uploaded in that new field
-> Traceback `ValueError: Wrong value for..`

This commit makes it work for all type of relational field.

[1]: https://github.com/odoo/odoo/commit/a77f5cf42faa75a2dd3931d83ad8ea86648248c0

closes odoo/odoo#104241

X-original-commit: addea33a8cb6c47bacdbfad0f3082f88763b59ef
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-27 11:38:50 +02:00
Romain Derie 1ac43fab05 [IMP] website: fix python linter errors
Just a nice to have. It will prevent those errors to be replicated when
copy pasted and will help reading the files in the IDE.

closes odoo/odoo#97282

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-04 20:11:00 +02:00
std-odoo bfee828603 [FIX] website: add the email of when a user fill the website form
Purpose
=======
When a public user fill a form on Website (e.g. /contactus), an email
will be sent. The email filled in the form will be used as the "email
from", but if no mail server match this email address it will be
encapsulated into "`notifications@mycompany.com`" (see odoo/odoo#61853).

Even though the email is still present in the "Reply-To" header, we
want to add it at the end of the email, so the receiver has this
information easily.

Task-2833093

closes odoo/odoo#94728

X-original-commit: a57944cc387a0b2f0eb6450a14a14e149c720181
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-06-28 11:41:18 +02:00
Julien Castiaux c0647b5c52 [REF] core: HTTPocalypse (14) changes all addons
This commit is the 14th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.

* `request.uid = x` => `request.update_env(user=x)`.
* `request.context = x` => `request.update_env(context=x)`.
* `request.context = dict(request.context, x=y)`
   => `request.update_context(x=y)`.
* `request.cr = None` => `request.cr.close()`.
* `http.mono_db()` => `request.db`.
* `http.dispatch_rpc()` => `service.dispatch_rpc()`.
* `@service.model.check` => `service.model.retrying()`.
* `request.endpoint`
   => `env['ir.http']._match(request.httprequest.path)[0].endpoint`.
* `request.routing_iteration `=> `removed`.
* `request.jsonrequest` => `request.dispatcher.jsonrequest`.

Note that `request.params` is now set much later in the process. If you
are in a situation where you values from the query string or the
http body you can use `request.get_http_params()`.

Note that using the new `request.future_response`, it is possible to
add headers and cookies on the response object before the response
object is initialized. Please note that headers/cookies saved on
the future response will NOT be injected in case of error.

PR: odoo#78857
Task: 2571224
2022-02-24 13:30:51 +00:00
Florian Damhaut 1c4ac7799e [FIX] website: website_form_project get wrong arguments
Step to reproduce:
- Create a website form with its action set to 'create a task'
- Set a project for the task to be created in
- Submit the form while logged in as a portal user

Current Behaviour:
- Task is created but the data from fields is not take into account
This lead to the task not being linked to the project and ending as 'Private'
- Due to the changes of sudo in V15, authorized fields are not fetched
and thus cannot be set properly.

Behaviour after PR:
- The data is fetch via the SUPERUSER instead of sudo to ensure correct data
- The fields are correctly set and the task is created
in the corresponding project.

opw-2743065

closes odoo/odoo#84020

X-original-commit: de03ee2198e039e14d0852d2346cb8aaf3885b5b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-02-07 08:08:52 +00:00
Jeremy Kersten 27df588c15 [FIX] *: remove trailing slash from controllers
Follow-up of c1ae086cdb

closes odoo/odoo#80139

X-original-commit: 58ee1a5906e4b2a50fb248085abd9caab97f4c52
Related: odoo/enterprise#22421
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-11-19 18:53:45 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Matthieu Stockbauer 2709602006 [REF] website, *: adapt files moved to website after website_form merge
*: website_crm, website_form_project, website_hr_recruitment,
   website_sale

Part of https://github.com/odoo/odoo/pull/69888
task-2462993
2021-07-16 19:13:18 +00:00
Matthieu Stockbauer f8882698e8 [MOV] website, website_form, *: merge website_form app into website
*: crm_iap_lead_website, website_crm, website_form_project,
   website_hr_recruitment, website_sale

Part of https://github.com/odoo/odoo/pull/69888
task-2462993
2021-07-16 19:13:18 +00:00