91 Commits
Author SHA1 Message Date
Jairo Llopisandxmo-odoo 18b4902a19 [FIX] base: allow browsing form view of missing module
Before this patch, if you once had one module available and, later, remove it, you'd be getting an exception when browsing its form view and trying to get its icon image.

Now it gets the base module icon image, just like it should.

@moduon MT-1524

closes odoo/odoo#151870

X-original-commit: 4543f45e0066814d5722acfcac3c8bc8d09b8cb1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
2024-01-31 18:59:10 +00:00
Jairo Llopis aaf7eb1660 [FIX] mail_client_extension/mail_plugin: let users allow mail plugin to work
This commit fixes a regression introduced in https://github.com/odoo/odoo/pull/104323.

That fix was preventing the default behavior of the 1st `.oe_login_form button[type=submit]` found.

It turns out that, for allowing the mail plugin to work, you actually need to have the default behavior of that element working normally.

Without this patch, the `&do=1` query is never added to the POST parameters. Thus, the user is unable to authorize their mail plugin.

@moduon MT-2552 MT-2553 OPW-3230686

closes odoo/odoo#115733

X-original-commit: d350b084317057d62a018a86f57a0a26b454100f
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-20 07:58:46 +01:00
Jairo LlopisandJulien Castiaux 5f1a77236a [IMP] bus: allow debugging websockets worker
Previous behavior: when debugging the websockets worker, source code is always minified.

Now, if user is in `debug=assets` mode, the asset won't be minified and it will be easier to debug.

@moduon MT-1900

closes odoo/odoo#109583

X-original-commit: 6360bbdbdcc6f2c150ceaa9f7fb5b0760e0f8940
Signed-off-by: Julien Castiaux <juc@odoo.com>
Co-authored-by: Julien Castiaux <Julien.castiaux@gmail.com>
2023-01-11 19:26:43 +01:00
Jairo Llopis 4f5491b347 [FIX] account: extensible subtree views
Both the CE and EE web clients don't support proper responsivity when a subtree view is inside a `<group>`.

By removing them (they were unnecessary anyway) we recover proper responsivity in these views.

@moduon MT-688 OPW-2843895

closes odoo/odoo#90946

Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-05 12:42:25 +02:00
Jairo Llopis abb1a69ad4 [FIX] mail: Properly set socket timeout
The connection socket is initialized before actually creating the connection object. This means that setting the socket timeout after connecting to server could still lead to an endless connection if a timeout is produced while connecting.

To fix this problem, I opened https://bugs.python.org/issue38615 (which explains the problem in `imaplib` itself) and I publish here the workaround.

`poplib` supports setting the timeout before initializing the connection, so it's used instead of the workaround.

@Tecnativa TT20364

closes odoo/odoo#89717

X-original-commit: e0d7dffe167b642f14fdc207ebd80fafb1d82e3d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-27 07:52:02 +02:00
Jairo Llopis cba2ca9003 [CLA] Remove Jairo Llopis from Tecnativa
closes odoo/odoo#82715

X-original-commit: 804fdc0b3a0eb38b821f26ffd4c30c56f6f900f0
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-13 15:29:54 +00:00
Jairo Llopis 9c25891e29 [FIX] crm: move iap widget where it belongs
To reproduce the bug:

1. Install `crm`.
2. Uninstall `iap`.
3. Go to any `res.config.settings` view.

Odoo will crash because the `iap_buy_more_credits` JS widget doesn't
exist (defined in iap).

Moving the widget from `crm` to `crm_iap_lead_enrich`. Since
`crm_iap_lead_enrich` depends on `iap`, this problem will not happen
anymore.

@Tecnativa TT20916

closes odoo/odoo#42258

X-original-commit: ec1be332c984bfcd0db3517db718fa85dbce7414
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-20 12:47:11 +00:00
Jairo Llopis 8ad360ccd3 [FIX] Log failed queries decoded
Starting with Python 3, queries sent by psyocopg2 are stored as `bytes()` objects.

Logging those raw makes them appear unformatted, harder to read than in v10 or lower Odoo versions (i.e. `\n` instead of a raw newline character).

Decoding the query into unicode makes it easier to read in the logs.

closes odoo/odoo#38074

X-original-commit: 329accde2ed6d4dbfdde6d3d99d71e21d15396b7
Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-10-08 14:12:23 +00:00
Jairo Llopis 9a787b985e [FIX] website_sale: Instruct crawlers to not sort
Follows https://github.com/odoo/odoo/pull/35852. More useless crawls saved.

closes odoo/odoo#38114

X-original-commit: 42cbe36f6fff02b71d549caf77d92f776d615863
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-07 15:03:00 +00:00
Jairo Llopis fd0de2261e [IMP] website: Remove hardcoded domains from website menus
A common software development pattern is to have the same data replicated across different environments, such as production and staging. This happens i.e. in Odoo.sh.

Let's assume your production instance is in ``https://www.example.com`` and your staging one is in ``https://staging.example.com``. Then:

1. A user in production modifies a website menu and makes it link to ``https://www.example.com/my-cool-page``.
1. A new change lands in staging, with a fresh copy of the production database.
1. The user goes to ``https://staging.example.com`` and navigates through the menus to validate the changes.
1. While navigating, he clicks in the website menu that links to ``https://www.example.com/my-cool-page``.
1. He makes some changes. **He didn't realize he was modifying production**.

To avoid this kind of problems, if a user pastes a link that starts with the current domain, it gets removed.

closes odoo/odoo#35715

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-03 12:27:55 +00:00
Jairo Llopis 379f6410c1 [FIX] barcodes: Whitelist search inputs
Before this patch, on mobile chrome, if user had focused in a `<input type=search>` element and writes something, the value never lands in the target input element and the on-screen keyboard hides.

closes odoo/odoo#37843

X-original-commit: 12d4040b7196ae8f7a27d0081638413b52340019
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-02 18:41:01 +00:00
Jairo Llopis c780caae50 [FIX] event: Allow to navigate from registration to event
This patch fixes a functional regression introduced in fd3febf7d7. Before that commit, users were able to navigate from a registration to the related event. Now it's impossible, and under some circumstances this confuses the user (i.e. when he comes to the form from an URL that another user shared to him, and there are no breadcrumbs to follow).

Now, users will be able to click in the event and go to its form.

closes odoo/odoo#37834

X-original-commit: eb46c13704bf3aa515fe3a92cc588b762c5e5164
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-02 17:44:38 +00:00
Jairo Llopis 8b899af625 [FIX] event: Do not send unpublished event link
Before this patch, the event link could be sent in the email even
if it was unpublished by hand.

Now, if the event is unpublished, no link appears in the
registration and reminder email.

closes odoo/odoo#37842

Closes: #37700
X-original-commit: 9878f319520861578ccc49796f4335f99ad49f9b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-02 18:06:35 +00:00
Jairo Llopis b6597fdd90 [IMP] base: allow buttons with tabindex
Adding `tabindex="-1"` is the only way a button could be set to not
have a hotkey when user presses <kbd>Alt</kbd>

closes odoo/odoo#37835

X-original-commit: 9e5b8db72e789064f99f58c4f64867307846acc9
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-10-02 17:44:56 +00:00
Jairo Llopis 7d93c80693 [IMP] mail: allow auto_commit parameter with templated message posts
The underlying `mail.compose.message` model has a useful `auto_commit`
argument when sending emails, which is unavailable when posting messages with
template through message_post_with_template.

This patch simply exposes the preexisting feature, to ease developments that
need it.

closes odoo/odoo#37783

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02 12:57:32 +00:00
Jairo Llopis 32c1c5ab1b [FIX] website_event_track: rename Partner to Speaker and remove duplicated fields
Before this patch, the word "Partner" wasn't specific enough to make the user
know that it was referring to the speaker. This was OK in the form, bug i.e.
in the calendar view it's very confusing.

This change comes from 1e61522d19 and we revert back to Speaker labelling.

Also, in the form view, the partner field was duplicated, contributing even
more to the confusion. It probably comes from c058562d73 that duplicated the field
probably because of a bad conflict resolution.

Now partner is labelled Speaker and multi company domain is correctly taken
into account.

closes odoo/odoo#37781

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02 12:36:19 +00:00
Jairo Llopis 974913c316 [IMP] Support psycopg2.sql module
[`psycopg2` includes a submodule called `sql`][1] which provides more safety and comfort when dealing with raw SQL queries.

As of today, it works fine with Odoo unless SQL query logging is enabled.

This patch fixes that problem, allowing usage of that module.

[1]: http://initd.org/psycopg/docs/sql.html

closes odoo/odoo#37561

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-30 08:08:07 +00:00
Jairo Llopis e5f673087b [FIX] mail: Support nameless attachments
`ir.attachment` records do not require to have a filename set.

In `AttachmentBox`, a filename is always set, although in case it's missing it was untranslated. I fixed that.

In cases where `AttachmentBox` is not used but its underlying templates are rendered using other means, a user could get a client-side error like this one when browsing a record that had an attachment without filename:

<details><summary>Error</summary>

```
Error:
TypeError: dict.attachment.filename.split is not a function

https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:26
Rastreo de error:
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:26:45
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous/<@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:340:33
foreach@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:180:25
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:338:25
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous/<@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:27:31
foreach@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:180:25
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:11:23
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:20:30
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:15:31
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
call@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:154:35
anonymous@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js line 469 > Function:11:31
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:458:58
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
_render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:480:29
render@https://www.tecnativa.com/web/static/lib/qweb/qweb2.js:450:26
render@https://www.tecnativa.com/mail/static/src/js/thread_widget.js:183:28
_fetchAndRenderThread/<@https://www.tecnativa.com/mail/static/src/js/thread_field.js:124:36
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
rpc/<@https://www.tecnativa.com/web/static/src/js/services/ajax_service.js:16:29
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3321:62
genericJsonRpc/<@https://www.tecnativa.com/web/static/src/js/core/ajax.js:65:18
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3276:89
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
then/</</<@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3283:104
fire@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3119:58
fireWith@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:3231:49
done@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:9275:42
callback@https://www.tecnativa.com/web/static/lib/jquery/jquery.js:9685:57
```

The error is produced when trying to render this line: https://github.com/odoo/odoo/blob/66c5053a3d1f8cb456929453a62869c95eccf86a/addons/mail/static/src/xml/thread.xml#L506

</details>

This patch ensures all attachment has a filename, and fixes that problem.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
@Tecnativa TT19555

closes odoo/odoo#37546

Forward-port-of: odoo/odoo#37253
X-original-commit: ebba3c9fa709dccf4cab91e9f37aa3eaa24c7d21
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-27 17:14:07 +00:00
Jairo Llopis 5dad570423 [FIX] *: remove buggy calls to with_context
When .with_context() is called with a dictionary as 1st positional
argument, it will replace context (and not modify the referenced keys)
It may create bugs when losing the content of the context (e.g. remove
partner's language)

This is a partial merge of #36164 without the inventory part as
discussed.

closes odoo/odoo#36729

X-forward: 4717ccfa
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-12 06:18:18 +00:00
Jairo Llopis 73363e24e5 [FIX] Increase werkzeukg version
Repeat #22988 before v13 is released.

Until #35085 is fixed and we can use 0.15.x, at least with this patch people installing Odoo v13 with these requirements will no longer hit #18052.

closes odoo/odoo#36553

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-09-09 11:18:06 +00:00
Jairo Llopis 4497077f55 [IMP] base: allow private addresses for contacts
For contacts without company, it was not possible to modify the type
and set a private address

opw-1944234

Closes odoo/odoo#31491

closes odoo/odoo#36701

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-11 12:51:42 +00:00
Jairo Llopis eebb8e1484 [FIX] *: remove buggy calls to with_context
When .with_context() is called with a dictionary as 1st positional
argument, it will replace context (and not modify the referenced keys)
It may create bugs when losing the content of the context (e.g. remove
partner's language)

This is a cherry-pick to saas-12.5 of odoo/odoo#36164 of the logistic
part as discussed

closes odoo/odoo#36690

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-11 11:17:50 +00:00
Jairo Llopis 34cbbff7b3 [IMP] sale: Show untaxed and tax totals in tree views
This is **very** useful for B2B customers. 😊

closes odoo/odoo#36366

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-04 09:24:50 +00:00
Jairo Llopis 481ad586cc [FIX] website_blog: Saner crawler instructions
The fixes that this patch includes are:

- The tag URL for tags printed in short and expanded blog posts had no slug, thus producing a brand new URL. Now they have the slug.
- Any request landed without that slug is slugified with a 301 code, as with the rest of Odoo.
- The `<a>` elements in right column archives have now `rel="nofollow"`.
- The `<a>` elements in right column tag cloud, where more than 1 tag is used, have now `rel="nofollow"`.

closes odoo/odoo#30832

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-29 11:27:56 +00:00
Jairo Llopis f2b7427fb4 [FIX] website_event_track: suggest recipient with an email
If an event track had a speaker assigned who had an email, and the
email field in the track itself was empty, Odoo was suggesting the
user to send an email to an empty recipient, making an error

Now it only suggests the email if there's one.

Fixes odoo/odoo#35941

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-22 08:05:47 +00:00
Jairo Llopis 21ede5365a [FIX] website: Delete redirections if website is deleted
Before this patch, if a website is deleted, its redirections will stay, affecting other websites.

Now, website-specific redirections will disappear along with their corresponding website.

closes odoo/odoo#35130

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 10:16:43 +00:00
Jairo Llopis e6225eeb12 [FIX] portal: Make .text-muted inside colored sections work
This was working fine previously in v11.

Now in v12 it stopped working because Bootstrap 4 adds `!important` to `.text-muted`.

Adding `!important` makes these styles useful again.

closes odoo/odoo#35011

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-19 11:18:28 +00:00
Jairo Llopis a78d743251 [FIX] website: Never find pages from other websites
Steps to reproduce:

1. Go to "My Website".
1. Click *New > New Page*.
1. Page title: "hello", add to menu: yes.
1. Add a snippet, write "hello 1", save.
1. Go to "My Website 2".
1. Click *New > New Page*.
1. Page title: "hello", add to menu: yes.
1. Add a snippet, write "hello 2", save.
1. Go to *Pages > Edit Menu*.
1. Edit the "hello" menu.
1. Change URL to `/hello-world` and save.
1. Click on the "hello" menu.
1. A page with "hello 2" appears.
1. Go to "My Website".
1. Go to *Pages > Edit Menu*.
1. Edit the "hello" menu.
1. Change URL to `/hello-world` and save.
1. Click on the "hello" menu.

Current behavior: Error 404

Expected behavior: A page with "hello 1" appears.

closes odoo/odoo#34913

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-17 07:54:45 +00:00
Jairo Llopis 7c99310b23 [FIX] auth_oauth: Override qcontext in the right place
Before this patch, if some module was based on top of `auth_signup`, and `auth_oauth` was also installed in the same database, the only way to get the proper qcontext would be to call `super()` inside `web_auth_signup_qcontext`, which would produce a login, which is most likely not desired because such addon would try to add some logic on top of it that maybe prevents login based on some circumstances.

After this patch, any submodules can work properly without workarounds.

closes odoo/odoo#34690

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-09 11:31:25 +00:00
Jairo Llopis fb95cf7b51 [FIX] mass_mailing: Do not alter method signature
Before this patch, this method was altering the signature of its parent method, moving the position of `failure_type` to 1 and making the other 2 arguments kw-only.

It seems this accidentally didn't break anything because all calls happened to be done in kwarg mode. However, it's very possible that a downstream module that is not based on `mass_mailing` and makes positional calls gets broken when `mass_mailing` is installed.

The fix is to respect original method signature.

closes odoo/odoo#34648

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-09 07:14:57 +00:00
Jairo Llopis 743c790fa1 [FIX] mass_mailing: Proper translation string
Computed expressions cannot happen inside a translation string.

closes odoo/odoo#34643

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 12:09:13 +00:00
Jairo Llopis ab1bd93dde [FIX] web: Trim spaces when selecting option by text
It's quite common that the `$().text()` method returns lots of random whitespaces at the beginning and end of the string. They're pretty unpredictable (extension views can add or remove them) and invisible to the end user.

This code chunk should allow to select an `<option>` based on its raw text content, but most of them will just fail without this patch. And most chances are that current ones just work equally with this patch.

This will make frontend tours more pleasant to write.

closes odoo/odoo#32791

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-18 09:45:52 +00:00
Jairo Llopis 94e35a19b3 [FIX] web: Trim spaces when selecting option by text
It's quite common that the `$().text()` method returns lots of random whitespaces at the beginning and end of the string. They're pretty unpredictable (extension views can add or remove them) and invisible to the end user.

This code chunk should allow to select an `<option>` based on its raw text content, but most of them will just fail without this patch. And most chances are that current ones just work equally with this patch.

This will make frontend tours more pleasant to write.

closes odoo/odoo#32718

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-16 11:53:47 +00:00
Jairo Llopis 88e455b6e9 [FIX] event: Allow to override default method
Without this patch, you have to redefine the field to be able to override this field.

closes odoo/odoo#33049

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-02 08:19:20 +00:00
Jairo Llopis 8da3750cee [FIX] core: remove extra exception log, redundant in P3
Reverts 2b1d3ff82d introduced in 10.0 via

It was relatively useful in Odoo 10.0 because in Python 2 the exception
was missing a root cause traceback. But Python 3 includes exception
chaining by default, so it comes for free.
See [PEP3134](https://legacy.python.org/dev/peps/pep-3134/)

On top of being redundant in P3, it can also break some testcases
by causing an extra ERROR log entry, even when the final exception is
expected and caught. So it's simpler to remove it.

closes odoo/odoo#31699

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-03-08 10:46:23 +00:00
Jairo Llopis 2b1d3ff82d [FIX] core: log unexpected validation exceptions
Before this patch, any exception raised by a constraint method that
were not of type `ValidationError` were hard to debug, because the
origin line was never logged.

Explicitly logging the error (with traceback) when we catch it
ensures proper contextual info, even in the absence of exception
chaining.

closes odoo/odoo#28612
2019-02-20 09:47:56 +00:00
Jairo Llopis d76182c582 [FIX] base: prevent cutting app titles in kanban
closes odoo/odoo#28628
2019-01-10 11:32:09 +00:00
Jairo Llopis 81c26383b0 [FIX] auth_ldap: Avoid sending email for newly created user
If installed along with `auth_signup`, it sends an email when creating a missing user authenticated through LDAP.

It is a confusing message that makes no sense, because the user is, from his POV, not actually creating a new user, but just authenticating with a new app with his known company-wide credentials.

Besides, that invitation leads the user to change his password in Odoo, although he probably doesn't want to do that and have a password for Odoo and another in the LDAP server.

The best option is to disable that email completely, which is what this commit does.

closes odoo/odoo#29243
2018-12-04 12:13:39 +00:00
Jairo Llopis a362d0eb9f [FIX] tests: Make at_install and post_install backwards compatible
Fixes #27471 by just using `tagged()` behind the scenes.

calls to `tagged` were done in the wrong order

closes odoo/odoo#27531
2018-10-08 12:16:08 +00:00
Jairo Llopis 71334b13bd [IMP] web: Expose datepicker configuration to view declarations
The lower-level widget itself supports passing options to the underlying
datepicker library. However this is not exposed to higher-level view
declaration. With this patch, one can declare a field in a view such as:

```xml
<field name="datefield" options='{"daysOfWeekDisabled": [0, 6]}'/>
```

That option would land in the widget and disable those weekdays.

Documentation has been updated accordingly.

Closes #25044.
2018-06-13 14:53:11 +02:00
Jairo Llopis 8357e7395e [FIX] link_tracker: do not give a date to a datetime
Creation date is a datetime field. However code is giving a date value.
as create date is a magic field with a default value there is actually
no need to override it.

Closes #22447.
2018-06-12 17:48:56 +02:00
Jairo Llopis 228df6a29f [FIX] link_tracker: do not die if statistic was unlinked when the user clicks on a tracked link
[There's a chance mail statistics disappear](https://github.com/odoo/odoo/blob/b3b8a471cc3e02488dcc0da991fd1d828978220d/addons/mass_mailing/models/mass_mailing.py#L519), which is probably not a very good decision, but there it is. Then, `add_click()` produces a 500 error when a user clicks on the mass mailing if the email comes from an old attempt.

Fix is to check the statistic record effectively exists before linking it.

Closes #22447.
2018-06-12 17:48:56 +02:00
Jairo Llopis ce6b6e6458 [FIX] event: do not suggest public user email in registration chatter
Chatter suggests to include recipients on several objects, notably on
registrations. When a registration is done through a public interface
like website in website_event associated partner is the public user.
In that case proposing to mail the public user does not make sense.
It should propose the real email stored on the registration record.
To fix that we filter the partner if it is linked to the pubic groups.

The fix includes a sudo + context switch in a loop. As this method is
called only on a recordset of one element this has no impact on real use
case. Purpose is to keep the diff minimal.

Closes #23187 .
2018-06-12 15:42:40 +02:00
Jairo Llopis 30aa75329c [FIX] website_form: Disable form send on editable mode
Before this patch, when a user was editing a website page containing a form
and he clicked "Send", for some reason, the form tried to be sent.

Now, the button behavior is disabled when entering editable mode.

Closes #23852
2018-04-11 15:45:47 +02:00
Jairo Llopis 9543e24a8d Search failure obvious for user.
Before this patch, when a user searched something in the shop and no results were yielded, there was no clue that the problem might be the search query itself.

After this patch, this UX becomes more obvious:

- *(0 found)* appears next to search button.
- _No results found for **"search term"**_ appears clearly in the middle of the page.

This commit closes #14359
2018-03-21 17:08:32 +01:00
Jairo Llopis 9e981f6535 [FIX] website_project_issue: No buttons for portal, customers
Customers without an user account can do nothing with the button
in the notification, so it's better they don't have it.

partial backport of #4732a1

This commit closes #22487
2018-03-21 12:20:33 +01:00
Jairo Llopis 6bd3bae04e [FIX] mass_mailing: domain translation
As Admin:
- Set up 2 languages for the installation, e.g. English and French
- Admin language is English, Demo language is French
- Create a `res.partner.category` named 'Test English'
- Assign the category to a newly created partner
- Create a French translation for 'Test English', e.g. 'Test Francais'

As Demo:
- Create a Mass Mailing
- Select a custom domain: ('category_id', '=', 'Test Francais') => it
  should match one partner
- Save and validate

Now either:
- manually run the scheduled action "Process Mass Mailing Queue" as
  Admin
- wait for the cron to process the mass mailing

No mail will be sent since the domain will be evaluated in the Admin
language, i.e. English. Indeed, the domain
`('category_id', '=', 'Test Francais')` does not match any record in
English.

The solution/workaround is to use the language of the last user who wrote
on the mass mailing.

Closes #20906, Closes #15467, Closes #15445

opw-778922
2018-03-20 13:48:49 +01:00
Jairo Llopis 055bac5fcc [FIX] website: Form editor addon is enterprise
Introduced at f90290d1

Closes #22370
2018-01-26 11:09:46 +01:00
Jairo Llopis 05938ceb3e [FIX] website: Use current website's menu to determine home page
This commit closes #20722
2017-11-29 16:59:31 +01:00
Jairo Llopis 9822c42707 [FIX] mass_mailing: switch to theme images at 1st theme selection
Without this patch, default images for themes are not used automatically
in themes' templates when one is chosen for the 1st time. This was not
inducing any bug in standard 10.0 but with custom-made templates, you had
to put the correct themes images in the defined template. This allows to
just `t-call` snippets instead of having to fully hardcode them in theme
templates.
2017-11-13 12:03:58 +01:00
Jairo Llopis d329b946d6 [FIX] website_portal: improve mobile layout
This commit closes odoo/odoo#19267
2017-10-11 17:56:23 +02:00
Jairo Llopis 348b2d713a [FIX] P3 syntax errors preventing compileall
Not that we really care about compileall, but some people apparently
do.

Fixes #19871

Closes #19849
2017-10-10 13:32:28 +02:00
Jairo Llopis 88b75f150d [IMP] website_sale_wishlist: Allow public users to wishlist
Current behavior before this patch:

- Only authenticated users were able to set items as wishlisted.
- A product template is displayed as wishlisted if the first variant is so.

Desired behavior after this patch:

- All users are able to wishlist items.
- When a user logs in, his dangling wishlists join him.
- A product template is displayed as wishlisted when any of its variants is so.

This commit closes #19777
2017-09-30 12:21:27 +02:00
Jairo Llopis 35441cfd62 [IMP] doc: add test classes documentation
Closes #13902
2017-09-19 17:00:59 +02:00
Jairo Llopis 48fe0a5953 [FIX] website: get website-specific view ids if available
In a multiwebsite environment, (de)activating some theme views produces
undesired results if the same view exists in different ways for different
websites.

With this patch, we search before for a website-specific view with the provided
 key, and fall back to the XMLID-found one if there is no specific view.

This commit closes odoo/odoo#17970
2017-08-22 13:18:05 +02:00
Jairo Llopis 7c6714d7fe [FIX] website: check website_id on view when applying inheritances.
Before this patch, if some view had both `inherit_id` and `website_id`,
its inheritances were being applied even in different websites.

After this patch, if a view inherits from another, inheritances will only apply
 when both views belong to the same (or none) website.

Refactoring based on the pr #17635
This closes odoo/odoo#17635
2017-08-22 13:18:05 +02:00
Jairo Llopis 15bf41270d [FIX] website: Make Qweb cache website dependent
Without this patch, all Qweb cache is shared among all available websites.
This turns impossible in practice to actually create multiple websites with
different look.

This closes odoo/odoo#18462
2017-08-22 12:03:23 +02:00
Jairo Llopis ecc093033d [FIX] service.server: bump up socket timeout to 2s
Rev. 8245c1d1d8 introduced a timeout to
avoid lockup situations with wkhtmltopdf's requests on servers with low
numbers of free HTTP workers.

The initial timeout of 500ms was chosen based on average network
latency, but turned out to cause spurious disconnections on congested
networks combined with slow links.

Bumping up the timeout to 2s seems to be a better sweet spot, causing
less spurious disconnections while still recovering reasonably fast from
the wkhtmltopdf lockup situation.

See also these discussions:
 - https://github.com/odoo/odoo/commit/8245c1d1d87b443701b161d8d4a42df2b4d13aec#commitcomment-22904347
 - PR #12356
 - Issue #2114

Closes #17998
2017-07-04 12:57:05 +02:00
Jairo Llopis a567cd796e [IMP] service: Display a warning when launching tests in multi-workers mode
Indeed, running the testsuite is not supported in multi-process (worker/pre-fork) mode, for multiple reasons: no multiple/concurrent execution of tests, necessity for in-memory cross-request statefulness (test cursor), etc.

We have no plan to work around these issues, as there seems to be no strong use case.
Our testsuite is mainly focused on the business/framework aspects, and not scalability/deployment aspects - which would require a much more complicated test infrastructure.
2017-06-01 11:51:24 +02:00
Jairo Llopis a5565cde76 [CLA] Deprecate Yajo from grupoesoc 2017-06-01 11:51:24 +02:00
Jairo Llopis bef9b1114c [IMP] website_sale: Allow to validate VAT without country code in checkout step
Closes #17316

If the user already specifies the country and does not give the country vat prefix, use the one from the address to validate the VAT.
2017-05-31 10:47:51 +02:00
Jairo Llopis 5fc3979262 [FIX] web: Avoid double-fetching many2many tags in list views
Before this patch, #15920 was happening. The problem was that calling `render_cell` produced a call to [`record.set(column.id + '__display', value)`][1], which triggers the `change` event, which called `render_record` the first time, which called again `render_cell` and produced the 2nd data fetch.

After this patch, `render_record` is only called if there is some place where to put the result, which does not happen in those situations.

There is still the problem that there is one call to name_get for each many2many widget found in a list view (instead of one per full view rendering), but at least they are not two calls!

[1]: https://github.com/odoo/odoo/blob/5d17749ff47c02294d5ff2ae56bbcef9d082562e/addons/web/static/src/js/view_list.js#L1125
2017-03-28 15:12:56 +02:00
Jairo Llopis e7fdd6df73 [IMP] website_event(_sale): make registration form responsive
+ remove redirect that create loop if not child menu and state == 'done'

TODO: make attendees registration popup responsive

This commit closes #15473
2017-03-24 17:03:20 +01:00
Jairo Llopis f1bf457803 [FIX] mass_mailing: do not remove image with link
If you followed these steps, Chrome deleted the link and image:

1. Create a new mass mailing, fill the subject.
2. Drag & drop any snippet with pictograms.
3. Change a pictogram for an image.
4. Add a link to the image.
5. Save the record.

This happen in chrome if the image was for example floating in
the link, so this change check if an element is a contained element
is visible before removing it.

This issue doesn't happen with [jQuery 3][1] and may be linked to
[this][2].

[1]: http://api.jquery.com/visible-selector/
[2]: http://stackoverflow.com/a/8337382/1468388

closes #15623
opw-710237

note: this is only needed in 9.0 and saas-11 because this features
doesn't seem present in version 10.0
2017-03-21 12:47:09 +01:00
Jairo Llopis 9d535ee2c7 [FIX] mail: check all parameters are set
Since `model` is not a required field, the invalidation may crash when one is
missing.
It should never happen than a mail.message has a res_id but not a model as it
makes no business sence.
However it is possible than a message temporarly misses one of the two, e.g:

```
self.model = False
self.res_id = False
```
will trigger two writes and will crash at the first.

Above code should probably be refactored to have only one write but this commit
fixes a regression introduced at 8f1c2bfc (the above code did not crash).

Closes #15199
2017-01-24 16:56:33 +01:00
Jairo Llopis 2c60356332 [FIX] website_slides: Preserve context when sending emails.
When you pass a dict to `.with_context()`, it completely replaces the context,
removing the language from it.

This causes that when the publisher publishes a slide in another language, the
template gets mixed languages rendering.

Closes #15017
2017-01-11 15:03:25 +01:00
Jairo Llopis 23ed2805b8 [FIX] event_type: allow to select typeless event
The requirement for somebody to choose a ticket product should be that it is an
event, not that it has an event type attached, mostly when `event_type_id` is
not a required field.

The event has been improved in upper version but as this field is only
informative, relaxing a bit the domain.

Closes #12475
2016-12-19 13:58:35 +01:00
Jairo Llopis f6692139da [FIX] event: add missing name attribute
This breaks nothing, but allows to enable this filter by default.

Closes #12997
2016-12-14 15:50:32 +01:00
Jairo Llopis fbdac9c853 [FIX] website: fix search in existing pages
Previous implementation did not allow the user to search for pages 'name'
but only on the slugified name.

Now we slugify the needles before to find a match.

1. Create a new page: 'The new'
2. add a link on your website and try to find this page...
    - Before this commit, the only ways was to type 'the-new'
    - After this commit 'the new', 'The new', 'The-new', ... will match

This commit closes #10771
2016-11-22 13:47:17 +01:00
Jairo Llopis 954fb6da3c [FIX] website_event_sale: Preserve context when updating cart
Without this patch, when a product was added to cart, if this addon
was installed, it always landed in English in the SO.

This happened because the context, containing the current language,
was being aborted here (`context=None` instead of `context=context`).

This commit closes #14340
2016-11-21 22:18:48 +01:00
Jairo Llopis 4d23595af5 [IMP] mass_mailing: add security token to unsubscription URL
Should prevent rogue unsubscriptions without making the
process more complicated for legit cases.

Closes #12040
2016-11-14 15:34:12 +01:00
Jairo Llopis 85b34f4be3 [FIX] openerp: tests: make failing PhantomJS tests actually fail 2016-10-17 13:45:23 +02:00
Jairo Llopis a2f0dda366 [FIX] website_portal: redirect to login for '/my' controller
Current issue without this patch:
On a bare database, install `website_portal` and go to `/my/home` logged out.
You get to an empty page where you can see Public User's details.

Expected behavior with this patch:
User should be redirected to the login page.

Additional notes:
- Other submodules (`website_portal_sale` and `website_project_issue`) were
  actually implementing this, so that is removed BTW and relies in base
  module's now sensible behavior.

This commit closes #12775
2016-10-13 16:30:03 +02:00
Jairo Llopis 295f62741d [FIX] tools: cherry-pick of 0529a7f9
extract terms in correct folder

If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).

In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.

Force the module path to ends with a folder separator to avoid wrong matching.

Closes #13363
2016-09-28 13:43:41 +02:00
Jairo Llopis f0dd8feee5 [FIX] website_portal: fix 403 when changing account details
A portal user couldn't change his address details if he was
of type `contact`

This happens because users usually
have no access to write their parent company.

opw-688192
Closes #13430
2016-09-13 15:18:02 +02:00
Jairo Llopis 4faed0b792 [FIX] website_blog: fix pager when existing filters in url
Go to a URL such as `/blog/our-news-1?date_begin=2015-01-01`
Now click on page 2.

Without this patch you will go to `/blog/our-news-1?date_begin=2015-01-01/page/2`.
With this patch, you will go to `/blog/our-news-1/page/2?date_begin=2015-01-01`.

This commit closes #13206
2016-08-22 10:30:56 +02:00
Jairo Llopis 0529a7f9ba [FIX] tools: extract terms in correct folder
If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).

In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.

Force the module path to ends with a folder separator to avoid wrong matching.

Closes #12757
2016-07-13 09:43:38 +02:00
Jairo Llopis ee365bbf98 [FIX] modules: choose the right addons path
When launching a server with two similar addons path, e.g.:
- /home/alice/dev
- /home/alice/devodoo

launching the server in dev mode may crash due to the poor matching using
`path.startswith(...)` method which may make `/home/alice/devodoo/bob/main.xml`
match in addons folder `/home/alice/dev` and with a non-exitant local path
`odoo/bob/main.xml`.

Instead of relying on the name, use the `os.path.commonprefix()` method to match
on real paths and avoid partial matching.
commonprefix will only work if the folder name ends with the appropriate
separator (which is not guarantee for a user provided addons-path) so force a
trailing `/` using os.path.join(..., '')`.

Closes #12359
2016-07-12 17:21:50 +02:00
Jairo Llopis 5cfadf5e41 [IMP] tools: support wdb in dev mode. 2016-06-09 16:01:54 +02:00
Jairo Llopis 87d1c4abd3 [IMP] website_portal_sale: depends on portal_sale
portal_sale adds the security rules for website_portal_sale to work proprerly

Closes #12283
2016-06-08 15:57:51 +02:00
Jairo Llopis f94f570be6 [FIX] doc: declaration of computed fields
Cannot link a method before declaring it.

Closes #12057
2016-06-02 17:56:23 +02:00
Jairo Llopis 57e5d703c2 [FIX] mass_mailing: filter emails to avoid duplicates
When subscribing a user to a mailing list, the `mail.mass_mailing.contact`
created is processed to identify it's name and email from the address (method
`get_name_email` called in `add_to_list` and `name_create`).
For a better consistency, the search of existing contacts should also be done
using the method `get_name_email`.

This avoids that subscribing twice `Example <example@example.com>` fails to
detect duplicates and creates two subscriptions.

Closes #12265
2016-06-02 11:38:00 +02:00
Jairo Llopis 3451ac5254 [FIX] purchase: typo at field declaration.
Closes #12260
2016-06-02 10:11:18 +02:00
Jairo Llopis 3c5e760e9d [8.0][FIX] Fix broken layout on xs Firefox.
Before patch (screenshot from runbot):

![](https://cloud.githubusercontent.com/assets/973709/13699411/6fc781b2-e77a-11e5-92fe-1e181f9e6b7f.png)

After patch:

![](https://cloud.githubusercontent.com/assets/973709/13699410/6fc774a6-e77a-11e5-83ab-dd31ccb1c4df.png)
2016-03-14 10:47:00 +01:00
Jairo Llopis 906bf16a76 [8.0][FIX] Make on_change in address_format divs work
To reproduce the bug:

- Create a partner.
- Set it state "Alaska".
- Country becomes "United States".
- Set a country for YourCompany, such as Spain.
- Create a partner.
- Set it state "Alaska".
- Country remains blank.

Also, `node.xpath("//field")` was running over every `<field>` in the
view, not just those inside the `<div class="address_format">`. Now it
only traverses the right nodes, which renders every affected view
faster.
2016-03-08 13:40:40 +01:00
Jairo Llopis 528111db69 [IMP] models: make method update multi-record aware
This way we can have a `write()` equivalent in draft and onchange environment
status.
2016-01-26 17:25:42 +01:00
Jairo Llopis 7f230a540e Remove the right backdrop.
If anybody adds a new modal in the `then()` part of the promise, without
this code, all `.modal-backdrop` elements will be deleted, and further
dialogs will not be modal; with this, only the current modal's backdrop
will be deleted.
2016-01-07 11:40:39 +01:00
Jairo Llopis 5425316eff [FIX] auth_signup: no SQL error for duplicated user
In case of registration with an already existant user, an SQL error 'duplicate
key value violates unique constaint res_users_login_key...'
Replace by a more user friendly error.

Fixes #10068, opw 659913
2015-12-16 14:16:49 +01:00
Jairo Llopis 90968dec1c [FIX] mass_mailing: filter on recipient
When selecting the contacts to recieve a massmailing, restrict to the ones
available for mass-mailing to be consistent with the menu 'Mailing List
Subscribers'

Fix #8463
2015-10-01 16:53:39 +02:00
Jairo Llopis 68eaeb684d [ADD] crm: test user notification
Test if the user gets notified for incoming contact requests.
2015-09-29 15:27:46 +02:00
Jairo Llopis ffa28488be [FIX] mail: subscribe to threads before sending first message
Users subscribed to creation of records (new leads in a sales team, new
tasks in a project, etc.) are never notified. The reason is that users
were subscribed after the record creation notification.

Introduced in 43915a8721
Closes #8723
2015-09-29 15:27:46 +02:00