Commit Graph
121380 Commits
Author SHA1 Message Date
Humberto Arocha f472ea705a [FIX] l10n_mx: Base Tax Received Account
Added account to cash basis and assign. On taxes with Tax Due Based on
Payment has been added as now is compulsory.

Closes #27739

closes odoo/odoo#27823
2018-10-16 06:02:50 +00:00
Julien (juc) Castiaux 71f188082f [FIX] mail: unicode character in email cannot be parsed
Sending email to addresses containing unicode characters
cannot be parsed by python and result in a UnicodeEncodeError.

This PR catch that specific exception and output a meaningful
error message.

Decision has been taken to not trigger any error message
client-side has it would have needed modifications on some
sensitive low-level backend code.

To reproduce:
- Configure odoo so it uses an email server
- Send an invoice to a partner whoose email address contains
some unicode characters (exemple: æøåÇÀ@example.com)

opw-1892409

closes odoo/odoo#27804
2018-10-15 13:42:58 +00:00
Alexandre Kühn 661483c026 [FIX] web: no duplication function for change_menu_section
Revision on https://github.com/odoo/odoo/commit/b7cf456560dc4fd7c1217ba90f0b5609466ede50

The commit above assumed the function `change_menu_section` was
mistakenly removed. However, it was turned into a handler function
and renamed according to our JS guidelines `_onChangeMenuSection`.

This commit removes the duplicated logic by removing the
function `_onChangeMenuSection` and using `change_menu_section`
as the handler for the bus event `change_menu_section`.

closes odoo/odoo#27809
2018-10-15 14:37:21 +00:00
Lucas Perais (lpe) f2ff47403f [FIX] website: multiwebsite supports optional 'subviews'
on the webiste sale, have a category with a subcategory
Then in the customize menu, enable "ecommerce categories"

Before this commit, the option to have collapsible categories wasn't there
This was because, due to multi_website, the children views of the "categories"
that were inactive weren't written upon when copying their parent

After this commit, the functionality is back

OPW 1893169

closes odoo/odoo#27796
2018-10-15 12:46:16 +00:00
Nicolas Martinelli 42c6db5e01 [FIX] pos_sale, sale: wrong currency stored
- Set the compay currency in USD
- Set the rate of USD to 1.0, the rate of EUR to 2.0
- Create a SO for a product costing 100, validate
- Go to Sales > Reporting > Sales

The product is evaluated at 400.

This is because the currency rate sotred is incorrect. The rate stored
is 0.5 instead of 2.0.

opw-1890778

closes odoo/odoo#27769
2018-10-15 08:16:45 +00:00
Nicolas Seinlet 38f6983df7 [FIX] mass_mailing: don't forward context
Don't forward context from mass mailing to partners view.
When grouping mass mailing by state, passing context makes
Odoo trying to group partners by state, and then get a traceback.

closes odoo/odoo#27775
2018-10-15 08:54:52 +00:00
Romain Derie 2018d0be35 [FIX] website_sale: wrong form selector on shipping change
Class `.hide` was replaced by `.d-none` with BS4 7f10b55a50
But the JS selector was still trying to retrieve the `.hide` form which lead to
an unexisting element, thus sending empty form.

Fixes #27714, closes #27774
2018-10-15 09:03:10 +00:00
Denis Ledoux dcb56412d6 [IMP] server.py: implements limits (real) for multi-threading
The multi-threaded server graceful stop policy is now as follows:
 - shutdown the server so it does not accept new requests (the socket remains open),
 - wait for remaining requests to finish up to a certain time (e.g. 1 second)

Previously, the multi-threaded server waited indefinitely for requests to finish.

The reload policy when a thread reaches a limit is as following:
 - wait there is no other running requests, up to 1 minute
 - then stop the server (with the above graceful stop policy applied),
 - then reload the server, therefore accepting new requests again.
- The socket is not closed during this operation.
  This allows the inverse proxy to queue the requests arriving during
  the time the server is shutted down and therefore not accepting new requests.
  This allows a transparent restart for the users, as their
  requests done during the shutting down of the server are not rejected but queued.
- When a thread reaches a limit, we reload the whole threaded server instead of
  just killing this thread. Killing a thread is not a good practice as it could
  lead to dead locks in case these threads acquire locks.
  Killing a thread that acquired a lock would lead for this lock to never be
  released.

Regarding the override of `_handle_request_noblock`:
  In `socketserver`,
  when `shutdown` is called
  `__shutdown_request` is set to True,
  https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L241-L249
  This tells the server to no longer accept requests. Callstack below:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L231-L234
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L308
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L487

  Unfortunately, this is very possible the HTTP server is already polling for a request when this flag is set
  to `True` by the main thread:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L232
  As the poll_interval is set to 0.5s:
  - https://github.com/python/cpython/blob/6a7b3a77b4b2be0badd24ee5f0fdbaa2e0e79c3d/Lib/socketserver.py#L215
  if a request arrives within 500ms after the server is shut down,
  the request is accepted, while the server is shutdown.

  We want to prevent this: Once the server is marked as shut down, we want it to no longer accept requests:
  so the inverse proxy knows it has to queue the request.

closes odoo/odoo#24982
2018-10-15 07:46:52 +00:00
qsm-odoo 4691c6be18 [FIX] website_blog: missing padding on s_latest_posts descriptions
closes odoo/odoo#27693
2018-10-11 16:41:08 +00:00
Odoo Translation Bot e774b2cb1c [I18N] Update translation terms from Transifex 2018-10-14 01:23:43 +02:00
Romain Derie 53f72dcab1 [FIX] website_sale: /shop 500 error if category is not model converter
The /shop route can take a `category` argument (a model converter).
  `/shop/category/<model("product.public.category"[..]):category>`

But if that `category` argument is passed through URL query string
(?category=9), it will raise an error when doing
  `category.can_access_from_current_website()`
as it is an integer since it did not went through the model converter

Note: Among probably others, that type of route is used when changing product
      order on shop

Closes #27490, closes #27724
2018-10-12 12:57:03 +00:00
Martin Trigaux 9649920987 [FIX] doc: add mention about rtlcss
Since 12.0, odoo support RTL interfaces but requires the package rtlcss

closes odoo/odoo#27729
2018-10-12 13:45:52 +00:00
Sébastien Theys c73efc27b7 [FIX] web: stabilize sequence for new records on last page
Before this commit, the compute sequence was relying on the fact the ID was used
as a secondary order key to get the right result.

This is necessary when adding items between pages because we don't resequence
the following elements.

However this was not necessary when adding new elements on the last page since
there are no following elements to resesquence in that case.

PR: #27639
2018-10-12 14:29:51 +00:00
Laurent Smet 847ad7a44d [IMP] account: rename write-off to counterpart in reconciliation model
'Write-off' is a wrongly used term in the reconciliation model.

A write-off occurs when a client owes money to you but is unable to pay.

closes odoo/odoo#27518
2018-10-08 09:20:56 +00:00
Julien (juc) Castiaux fbd4eba87d [FIX] mail: groupby was using a wrong create_id field
Grouping mail activities by "Created by" was grouping on the
"create_uid" field which is always the admin user. New groupby
groups using the "create_user_id" field which is the real id
of the creator.

opw-1886369

closes odoo/odoo#27718
2018-10-12 10:58:54 +00:00
Aurélien Warnon f25ead03c6 [FIX] (website_)sale: fix product_attribute_custom_value access right
Targets commit d3530eb07e

Purpose
=======
Users within the "sales_team.group_sale_salesman" group should be able to
access/add/edit/delete custom attribute values.

closes odoo/odoo#27654

closes odoo/odoo#27679
2018-10-11 11:19:51 +00:00
Rémi Rahir cf9d962dc9 [IMP] iap: split charge to ease developer's work
Imp/refactoring of the charge function to make tools available for asynchronous services.

closes odoo/odoo#27686
2018-10-11 14:43:15 +00:00
Christophe Monniez 4f28121065 [FIX] web: increase clickEveryWhere test timeout again
Two minutes increase was obviously not enough.

closes odoo/odoo#27709
2018-10-12 08:34:37 +00:00
Romain Derie 47406d6e5d [FIX] website_hr(_recruitment): make website specific
As commit 066cfc9598 did for other website_module, this commit make theses
2 modules multi-website compatible.

Mostly by:
  - Adding website_id in form/list views
  - Preventing routes from being accessed by wrong website (only needed for
    admin as portal users will get a 403)
  - Adapt search([]) with multi website domain
  - Add domain in model converter in routes for URL autocomplete (eg menu URL)
    Note that it is not needed for sitemap.xml

closes odoo/odoo#27528
2018-10-11 17:08:20 +00:00
Aaron Bohy 76cc621c1d [FIX] web: grouped list view: group header layout
This rev. ensures that the group name is vertically centered inside
the group header row. Padding rules have been moved from enterprise
to community.

Task 1878254

closes odoo/odoo#27603
2018-10-11 19:03:57 +00:00
Jeremy Kersten c4e0e5461c [FIX] web: guess resize placeholder
Before this commit, if you ask for a small image, you was waiting a picture of
64x64 but in case this image was not found, a placeholder with an other size
was returned.

Now, we try to guess the asked size, and return a resized placeholder.

This bug appear since we change the default placeholder picture with a big one

This will fix several issue and avoid to hard code size everywhere in the code

Eg: commit 92f837c and commit https://github.com/odoo/odoo/commit/154fc7d9dd550d35b7266af024e54c20e18938fc#diff-9af1af2039d16d6b544d481b4ee1ed7cR144

closes odoo/odoo#27695
2018-10-11 17:21:53 +00:00
qsm-odoo c7f72248a9 [FIX] web: clear all BS4 alerts
Commit https://github.com/odoo/odoo/commit/8caf84f70ada259f041b424d37686845604d182a
was not handling the case where there was an invisible DOM element
between the button box and the alert component. Let us clear all alerts.

This commit also introduces a way to properly fix/extend bootstrap in
future fixes/updates (some of our rules may already be moved in that
file once it is forward-ported to master).

closes odoo/odoo#27662
2018-10-11 16:31:24 +00:00
Manuel Vázquez Acosta c77f7fc5cd [FIX] models: Allow rich comparison with third party objects.
Instead of returning False directly when comparing a non-model, return
NotImplemented that will trigger the __eq__ test from the other side.

This allows third party objects (for instance a serialization/deserialization
scheme) that cannot be a Model to be considered equal is some scenarios.

closes odoo/odoo#19977
2018-10-11 16:59:49 +00:00
Antoine Prieels (ANP) a5b3246dcd [FIX] Convert the estimated price for snailmail server-side
Currency rates were not updated client-side so we moved to make the convertion happen server-side, where rates are updated daily

closes odoo/odoo#27688
2018-10-11 14:48:25 +00:00
XavierDo 356a421660 [FIX] mail: avoid sending mail when creating record from data
Before this fix the creation of task assigned to admin was leading
to the creation of mails.

This is a generic fix to avoid to notifiy a user when he is add as a
follower when creating data from odoo data files.

closes odoo/odoo#27682
2018-10-11 15:30:33 +00:00
Martin Trigaux 57884ccdc8 [I18N] all: convert remaining model: translation entries
It should be model_terms:

Fixes odoo/docker#219

closes odoo/odoo#27664
2018-10-11 09:49:01 +00:00
Romain Derie 11c950ef23 [FIX] web_editor: bs4 '.is-invalid' not applied in technical modal
Adding bs4 `.is-invalid` class is supposed to add red borders on the
`form-control` element.

But the mixin `o-w-preserve-forms` prevents that style to be applied as it adds
`border: 1px solid $o-we-color-text-light;` on `.form-control`.
As the mixin selector has more strength (specificity), the bs4 is simply not
applied.

This is the case for `form-control` inside `o_technical_modal`.

closes odoo/odoo#27691
2018-10-11 14:25:34 +00:00
Nicolas Martinelli ee67457ad1 [FIX] point_of_sale: throw error if incorrect configuration
- Install a new DB without demo data, with only the `point_of_sale`
  module
- Do not configure the accounting
- Open the POS, sell a product

At payment, an error is thrown at `this.cashregister.journal_id[1]`
because `this.cashregister` is `undefined`.

We throw a proper error instead.

opw-1891901

closes odoo/odoo#27683
2018-10-11 13:04:32 +00:00
Nicolas Lempereur 92bfbfd4f7 [FIX] web: improve style header background layout
As per fpodoo specification:

- decrease max width of logo (from max 33% of header width, to max 22%)
- decrease font-size of tagline by 30%

So logo is smaller, and company address has less probability to get
pushed lower (since sum of contents are larger than width).

Sizing the header works as follow:

If the header is equal to wkhtmltopdf page width or bigger, it is zoomed
out until it fits. So with current configuration:

- 100% of width is 900px,
- company tagline is at maximum 33% (300/900),
- company logo is at maximum 20% (200/900),
- remaining (company address) is remaining space of 44% (400/900)

closes #27641
2018-10-11 14:18:13 +00:00
Yenthe V.GandDaniel Yang, zyyang 9ffe661d1a [FIX] mrp: use id for warehouse creation
Expected type is an id, not a record

Fixes odoo/odoo#27556
Closes odoo/odoo#27596

Co-authored-by: Daniel Yang, zyyang
2018-10-11 14:58:51 +00:00
Goffin Simon 9a6f245540 [FIX] sale: All sales orders from a customer
Steps to reproduce the bug:

- Create separate contacts and sales orders.
- Go to contact
- Click the smart button for sales.

Bug:

All the sales orders in the system were displayed instead of displaying
only the sale orders of the contact.

opw:1891796

closes odoo/odoo#27675
2018-10-11 11:21:39 +00:00
qdp-odoo 91b7c8a6aa [FIX] account_bank_statement_import: fix crash when there's no import format available
When you run the setup wizard to add a bank from the setup bar, it will write 'file_import' on the field 'bank_statements_source'. But in the module 'account_bank_statement_import', the possible values of the field 'bank_statements_source' was updated with 'file_import' ONLY if additionnal account_bank_statement_import_xxx modules are installed.

So, prior this fix, if you only had the module 'account_bank_statement_import' and no additionnal bank statement import modules, you were getting a traceback.

Fixes #27423

closes odoo/odoo#27672
2018-10-11 10:26:23 +00:00
Nicolas Martinelli ea091e4c40 [FIX] account_facturx: incorrect Python statement
`str('a', 'b')` just doesn't work and returns:
`TypeError: decoding str is not supported`

opw-1891767

closes odoo/odoo#27669
2018-10-11 09:50:41 +00:00
Rémi Rahir cb8bd299fc [FIX] snailmail: avoid next activity spamming
closes odoo/odoo#27665
2018-10-11 11:11:42 +00:00
Carlos Fonseca 8c5d98d9a9 [CLA] signature for cpintofonseca
closes odoo/odoo#27660
2018-10-11 12:27:50 +00:00
Julien (juc) Castiaux e451a3e955 [FIX] web_tour: adjust ACLs to allow tour disabling
Run odoo-bin using "--without-demo=all"
Install any module (I used CRM)
On the main page, a droplet should appear under the newly installed module
As admin, using the debug mode, click on the "Disable tour" button
The action is restricted due to the missing ACL

opw-1890350

closes odoo/odoo#27655
2018-10-11 12:12:18 +00:00
Robot Odoo 42334f5b31 [FIX] web, web_settings_dashboard: several fixes
### [FIX] web_settings_dashboard: load a translation

Before this commit, there was an issue when trying to load
a translation from the 'Settings' application.

        - Go to 'Settings'
        - Click on 'Load a translation'
        > It redirects to 1st app (community) or (enterprise)

This is not a big issue in enterprise, because the modal is
that let the user load a translation is still prompted.
This is however not the case in the community version.

This issue is caused by 'Load a translation' being a `<a>` with
`href='#'`. The purpose of the `href='#'` is to have the pointer
cursor on mouse hover. However, when clicking a `<a>` with `href`,
the browser changes the URL in the address bar with the content of
the `href`, which for the value `'#'` is linked to the top of the
main page. In community, this redirects to the 1st installed app
(usually 'Apps' or 'Discuss'), whereas in enterprise it redirects
to the home menu.

This commit fixes this issue by preventing the default browser
behaviour when clicking on "Load a translation", so that it does
not change the URL in the address bar.

### [FIX] web_settings_dashboard: set up your company

Before this commit, it was not possible to set up a company.
This is caused by the clickable DOM element being a `<a>` with
`href='#'`. This redirects to the 1st app in community (usually
the 'Discuss' app), which prevents opening the form view to
set up information about your company.

This commit fixes the issue by preventing the browser to change
the URL in the address bar when clicking on 'Set up'.

### [FIX] web_settings_dashboard: browse apps

Before this commit, it was not possible to access
apps from 'Browse apps' in the Settings menu when
at least one app was installed.

This is caused by the clickable DOM element being a `<a>`
with `href='#'`. This redirects to the 1st app, usually
the 'Discuss' app, which prevents opening the kanban view
with apps.

This commit fixes the issue by preventing the browser to
change the URL in the address bar when clicking on
'Browse apps' from the 'Settings' application.

### [FIX] web: `self.menu.change_menu_section` is not a function

Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

The commit above changed the menu in community, so that it
looks like enterprise. To do so, it copies the menu management
from the enterprise repository to the community repository.

Some code about the home menu has been removed, since it is replaced
with the app menu in community. However, some functions have been
removed by accident, such as `change_menu_section`.

Closes #27436

closes odoo/odoo#27442
2018-10-11 15:12:48 +02:00
Alexandre Kühn b7cf456560 [FIX] web: self.menu.change_menu_section is not a function
Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

The commit above changed the menu in community, so that it
looks like enterprise. To do so, it copies the menu management
from the enterprise repository to the community repository.

Some code about the home menu has been removed, since it is replaced
with the app menu in community. However, some functions have been
removed by accident, such as `change_menu_section`.

Closes #27436
2018-10-10 15:39:25 +00:00
Alexandre Kühn 4f3e051891 [FIX] web_settings_dashboard: browse apps
Before this commit, it was not possible to access
apps from 'Browse apps' in the Settings menu when
at least one app was installed.

This is caused by the clickable DOM element being a `<a>`
with `href='#'`. This redirects to the 1st app, usually
the 'Discuss' app, which prevents opening the kanban view
with apps.

This commit fixes the issue by preventing the browser to
change the URL in the address bar when clicking on
'Browse apps' from the 'Settings' application.

Closes #27434
Closes #27442
2018-10-10 15:39:25 +00:00
Alexandre Kühn 1f7e98dd9b [FIX] web_settings_dashboard: set up your company
Before this commit, it was not possible to set up a company.
This is caused by the clickable DOM element being a `<a>` with
`href='#'`. This redirects to the 1st app in community (usually
the 'Discuss' app), which prevents opening the form view to
set up information about your company.

This commit fixes the issue by preventing the browser to change
the URL in the address bar when clicking on 'Set up'.

Closes #27434
Closes #27442
2018-10-10 15:29:31 +00:00
Alexandre Kühn a943d8a712 [FIX] web_settings_dashboard: load a translation
Before this commit, there was an issue when trying to load
a translation from the 'Settings' application.

	- Go to 'Settings'
	- Click on 'Load a translation'
	> It redirects to 1st app (community) or home menu (enterprise)

This is not a big issue in enterprise, because the modal is
that let the user load a translation is still prompted.
This is however not the case in the community version.

This issue is caused by 'Load a translation' being a `<a>` with
`href='#'`. The purpose of the `href='#'` is to have the pointer
cursor on mouse hover. However, when clicking a `<a>` with `href`,
the browser changes the URL in the address bar with the content of
the `href`, which for the value `'#'` is linked to the top of the
main page. In community, this redirects to the 1st installed app
(usually 'Apps' or 'Discuss'), whereas in enterprise it redirects
to the home menu.

This commit fixes this issue by preventing the default browser
behaviour when clicking on "Load a translation", so that it does
not change the URL in the address bar.

Closes #27434
Closes #27442
2018-10-10 15:29:31 +00:00
Yenthe V.G 5822d3cbdb [FIX] account: set enterprise widget on setting
Both modules account_budget and account_asset are in enterprise since 2870af948

closes odoo/odoo#27606
2018-10-10 14:32:40 +00:00
Martin Trigaux e098bcacfb [FIX] google_calendar: correct use of datetime object
Remove useless .split calls now that we have datetime objects
Avoid manipulating strings

Fixes odoo/odoo#27453

closes odoo/odoo#27521
2018-10-08 09:44:18 +00:00
qsm-odoo 1f9bf60260 [FIX] web_editor, website: review grays
What was designed as a new feature appeared as a regression: users were
not able to choose a bootstrap gray as a background color anymore but
instead got the possibiility to choose a hardcoded gray. This commit
restores the use of the custom gray palette that themes can customize
and which automatically uses the correct text color when used as a
background. This also allows to remove ugly inline style from snippet
definitions and allows to solve bugs like the described below one:

---------------------------------------
Also add bg-* classes on snippet cards:
---------------------------------------

Snippet cards are often put (or may be put by the user) in an element
which have a bg-* class on it. This means that the card will still have
a white background (as chosen by BS4 by default) but the text color will
be adapted to that ancestor bg-* classed element.

This commit forces the card background color (as suggested by BS4) with
bg-* classes.

closes odoo/odoo#27637
2018-10-10 15:09:24 +00:00
ThanhDodeurOdoo 1dbb555aab [FIX] document: JS feature disabled
Reason: This feature currently has unfixed bugs, does an unnecessary RPC and
was functionally replaced by a button inside the chatter in commit
7f97c9f and the menu inside the debug manager in commit d12b88315.

This commit disables the JS part of the document module to prepare
for the complete removal of the whole module and the MOV of
the indexation to base.

Closes #27613
2018-10-10 18:28:13 +00:00
Martin Trigaux 51d9589e02 [FIX] base: print report without template
In case a report has no template defined, the fallback is on the first
body_parent that matched the xpath '//main'
xpath method returns a list

Fixes #27406

closes odoo/odoo#27630
2018-10-10 13:59:02 +00:00
Martin Trigaux 0aa0cec97a [FIX] web: do not warn on empty field
If no value is specified on the datefield, do not set a warnfuture message

Remove code comment that was referring the condition present at b51b0d66c2
but no longer present.

Add tests

Fixes #27551

closes odoo/odoo#27593
2018-10-10 13:59:36 +00:00
Nicolas Lempereur 5c6edfc8d3 [FIX] base: res_config_settings allow deferred field
If a deferred field, for example with auth_user_policy installed:

  <field name="f" password="True" widget="password_meter"/>

is inside the res_config_settings view, the rendering will be deferred
which is not taken into account when initializing the content
(_initModules) or attaching to DOM (after start).

Thus we would would get an error and have no access to settings.

The issue that happened in 12.0 was solved with 23bec7fb7 and refactored
in between in 5bbbd25ed, but the heart of the issue was not solved in
the case of a customization.

With this commit, we do not lose the deferred when it is necessary to
keep them in the case of deferred while rendering.

Without fix, the added test fails with a traceback and message:

 TypeError: Cannot read property 'settingView' of undefined

opw-1890343
closes #27589
2018-10-10 15:02:10 +00:00
Aurélien Warnon c9041e8dcf [FIX] (website_)sale: hide single attribute value in p. configurator
Targets commit d3530eb07e
References task id 1892022

Purpose
=======
- When there is only one attribute value for an attribute configured in a product's variants,
  it should be hidden in the product configurator.
  e.g: The only value selected for the "Material" attribute is the "Wood" value for the "Customizable Desk".
  The radio selection is hidden and "Material: Wood" is displayed in the product's description.

- Fixed a class name typo

closes odoo/odoo#27604
2018-10-10 06:24:25 +00:00
Jeremy Kersten 36cadc374b [FIX] website_sale: add scss to make checkout responsive
removed by error by product configurator

closes odoo/odoo#27635
2018-10-10 14:33:18 +00:00