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
closesodoo/odoo#151870
X-original-commit: 4543f45e0066814d5722acfcac3c8bc8d09b8cb1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
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
closesodoo/odoo#115733
X-original-commit: d350b084317057d62a018a86f57a0a26b454100f
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
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
closesodoo/odoo#109583
X-original-commit: 6360bbdbdcc6f2c150ceaa9f7fb5b0760e0f8940
Signed-off-by: Julien Castiaux <juc@odoo.com>
Co-authored-by: Julien Castiaux <Julien.castiaux@gmail.com>
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
closesodoo/odoo#90946
Signed-off-by: William André (wan) <wan@odoo.com>
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
closesodoo/odoo#89717
X-original-commit: e0d7dffe167b642f14fdc207ebd80fafb1d82e3d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#42258
X-original-commit: ec1be332c984bfcd0db3517db718fa85dbce7414
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/odoo#38074
X-original-commit: 329accde2ed6d4dbfdde6d3d99d71e21d15396b7
Signed-off-by: Christophe Simonis <chs@odoo.com>
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.
closesodoo/odoo#35715
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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.
closesodoo/odoo#37843
X-original-commit: 12d4040b7196ae8f7a27d0081638413b52340019
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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.
closesodoo/odoo#37834
X-original-commit: eb46c13704bf3aa515fe3a92cc588b762c5e5164
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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>
Adding `tabindex="-1"` is the only way a button could be set to not
have a hotkey when user presses <kbd>Alt</kbd>
closesodoo/odoo#37835
X-original-commit: 9e5b8db72e789064f99f58c4f64867307846acc9
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
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.
closesodoo/odoo#37783
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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.
closesodoo/odoo#37781
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
[`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.htmlclosesodoo/odoo#37561
Signed-off-by: Christophe Simonis <chs@odoo.com>
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.
closesodoo/odoo#36729
X-forward: 4717ccfa
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/odoo#36553
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
For contacts without company, it was not possible to modify the type
and set a private address
opw-1944234
Closesodoo/odoo#31491closesodoo/odoo#36701
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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
closesodoo/odoo#36690
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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"`.
closesodoo/odoo#30832
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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.
Fixesodoo/odoo#35941
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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.
closesodoo/odoo#35130
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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.
closesodoo/odoo#35011
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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.
closesodoo/odoo#34913
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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.
closesodoo/odoo#34690
Signed-off-by: Christophe Simonis <chs@odoo.com>
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.
closesodoo/odoo#34648
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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.
closesodoo/odoo#32791
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#32718
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Without this patch, you have to redefine the field to be able to override this field.
closesodoo/odoo#33049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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.
closesodoo/odoo#31699
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
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.
closesodoo/odoo#28612
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.
closesodoo/odoo#29243
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.
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.
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 .
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
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
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
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
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.
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
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 closesodoo/odoo#17970
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 closesodoo/odoo#17635
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 closesodoo/odoo#18462
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 #2114Closes#17998
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.
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
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/1468388closes#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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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.
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
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
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 43915a8721Closes#8723