Commit Graph
127612 Commits
Author SHA1 Message Date
Christophe Simonis 52057da36f [FIX] test_main_flows: more explicit trigger 2019-01-04 14:54:15 +01:00
Christophe Simonis ec9400821e [MERGE] forward port branch saas-11.3 up to 27a084eb81 2019-01-04 14:54:08 +01:00
Nans Lefebvre 2cdc1cc9ce [FIX] sale: hide the sales menu from users without any rights
If a user has no rights on sale, he should not see the sales menuitem
on the dashboard.

opw 1921335

closes odoo/odoo#29934
2019-01-04 10:39:18 +00:00
Toufik Ben Jaa 99c319e03a [FIX] account: deadlock on install
- When installing an accounting l10n module, the method `try_loading_for_current_company`
  is called and could cause a deadlock.
  The deadlock is caused by the fact that if the installation is started
  via a web request the code tries to retrieve the current user's
  company by doing `request.env.user.company_id`.

  This causes issues since the installation code has its own postgresql
  cursor while calling `request.env.user.company_id` will create its own
  cursor.

  So two cursors exists for the same Odoo worker.
  The installation cursor asks for a lock on `res_users` while the
  second cursor (the request one) will try to read on `res_users` and
  wait the first lock to be dropped.

  The lock is never dropped since the python code isn't running anymore
  waiting for the `request.env.user.company_id` to be completed.
  Causing the deadlock.

  To fix the issue, we avoid the creation/usage of a cursor created by
  `requesŧ`.
  So to retrieve the current user's company, we read the user id on the
  request's session, then browse the `res.user` record with the
  installation cusror.

  Fix issue introduced by commit d40956c790

closes odoo/odoo#29927
2019-01-04 10:55:31 +00:00
Julien (juc) Castiaux 033608eb11 [FIX] sale: non-consistent tests
The tests of the sale module are not constistent. Success depends on version
in use (com vs ent) and the modules installed (sale, stock, event_sale).

**Fix 1**

The "Description" field is updated by a onchange while saving the record.

**Fix 2**

The `sale_stock` module  adds a new step to click "ok" on the warning modal
shown when saling a product without enough of that product on hand. The added
step was added to test_01 (that doesn't show the modal) instead of test_02.

**Fix 3**

There is a difference between the price of the SO between community and
enterprise.

**Fix 4**

The event_sale module changes the form view thus need to perform more steps
to create a record.

opw-1912266

closes odoo/odoo#29679
2019-01-04 10:10:43 +00:00
Nicolas Martinelli 6da2e23e65 [FIX] hr_attendance: kiosk keep alive
When running in kiosk mode, it is necessary to refresh the interface
once a week since the session is garbage collected.

The garbage collection method `session_gc` relies on the last
modification time of the session file. However, the session file is only
saved when the field key `should_save` of the session request is `True`.
This happens when the session is `modified`, i.e. an item on the cookie
is set.

In practice, the session is saved at each reload of the page. Regular
RPC calls, such as the one used in commit 6e1b660f9c, do not
trigger a modification of the session file. Therefore, we create a new
route which explicitly sets the session as `modified`, which ultimately
triggers a `save` in `get_response`.

opw-1917254

closes odoo/odoo#29919
2019-01-04 09:56:55 +00:00
Julien (juc) Castiaux 79b80d9c37 [FIX] tools: value_label attribute translatables
A newly intoduced xml attribute by @svs-odoo was not translatable.

Related PR on enterprise: odoo/enterprise#3252

opw-1908220

closes odoo/odoo#29386
2018-12-31 09:08:54 +00:00
Swapnesh Shah 6ead395271 [FIX] resource: Prevent zero division error
closes odoo/odoo#29656
2018-12-19 17:30:41 +00:00
Sébastien Theys d8eb0f2555 [FIX] web: fix image placeholder size
Following commit c4e0e5461c

Before the current commit the placeholder was used at the end of the logic, so
it ignored the parameters such as width, height, crop, ...

Now the image is correctly replaced by the placeholder before we try to apply
the rest of the logic.

One example of such problem was in website_sale_comparison, on the comparison
page, if we tried to compare a product which had no image, the placeholder image
was bigger than expected.

task-1929646

closes odoo/odoo#30525
2019-01-24 16:29:51 +00:00
Rishabh Jadia 3d52704296 [FIX] product: product label/barcode report style
The purpose is to set the style of the product label and product barcode
reports that was lost in bootstrap v3 to bootstrap v4 conversion.

opw-1920478

closes odoo/odoo#30407
2019-01-24 17:42:54 +00:00
Nicolas Lempereur ce6e66cef9 [FIX] web: bar chart no crazy with 2 group by
In 3d2ca8104e some change were introduced to the graph view.

But part of it had no sense when displaying data over 2 group by.

eg. if the first level has 2 groups (2018, 2019) and each second level 2
    groups (Done,Cancelled), we could have:
     2018/Done: 0
     2018/Cancelled: 5
     2019/Done: 8
     2019/Cancelled: 9
    this gives us two main groups [2018: 5] / [2019: 17], the code
    remove the 2018 because [2018/Done] is 0 so we have something odd
    with columns not in order, and in stacked bar chart some part of
    a bar at the wrong offset

opw-1932517
closes #30529
2019-01-24 16:18:19 +00:00
Christophe Simonis b42cd64ace [FIX] mail: do not try to send email to partners without email
As `formataddr` only accept strings as arguments, an exception was
raised when trying to notify a mailing list channel with followers
without email.

closes odoo/odoo#30492
2019-01-23 19:22:00 +00:00
Nicolas Seinlet 9254216843 [IMP] efficient total amount computation
Based on the stored computed amounts on lines,
it seems better to use read_group on lines instead
of recomputing the whole bunch of taxes and amounts.

closes odoo/odoo#30398
2019-01-23 09:10:16 +00:00
qsm-odoo d7acfdae2b [FIX] portal: restore BS3 clearing system for main frontend containers
BS3 used to add ::before and ::after elements on all containers so that
margins and floats are cleared inside containers. As lots of current
odoo layouts may rely on this for some alignments, this is restored (at
least for a while) here only for main containers of the frontend.

In master, we should use proper layouts to avoid the need of this.

task-1889238

closes odoo/odoo#30510
2019-01-24 11:30:30 +00:00
Nicolas Lempereur 1388b7f0d8 [FIX] base: remove copied views before uninstall
In dff64b6f7ca some copied views with no link to a module would be
removed after module uninstall.

But this has some side effects when the website module is being removed.

For example:

- website_theme_install, website are installed
- website is uninstalled (which will uninstall website_theme_install)
- website.theme_customize view can't be removed because it is used by
  copied view website_theme_install.customize_modal
- after uninstall _remove_copied_views will remove the view
  website.theme_customize but when trying to remove associated
  website.page will throw an error because website_page table does not
  exist

This issue does not happen if we uninstall first website_theme_install
then website (since like this the reference is not an issue).

The issue also happen with overriding views in theme_bootstrap and
possibly elsewhere.

With this changeset, copied views are removed before uninstalling module
data.

opw-1924714
closes #30191
2019-01-24 12:26:31 +00:00
Pierre Paridans 9ee099458b [FIX] mail: focus chatter composer on mobile
Sending a message on the chatter is painful as you need to scroll to see
the buttons and click to open the composer. Then again click to set the
focus in the composer (making the keyboard appear) and scroll again to be
able to write your message.

On a view form when clicking on the "New Message" or "Log Note" buttons the focus
should be put in the text field, then opening the mobile device keyboard
and scroll the view to make the text field visible.

NB: in some case on Android (both WebView and Google Chrome) the scrolling is
not operated correctly resulting into the text field being hidden behind
the keyboard. This issue looks related to some timing between the actual
focus() call and the keyboardi appearance triggered by the operating system.
Sadly we don't have any control on that part.

Related to task 1891955

closes odoo/odoo#29239
2019-01-23 13:55:49 +00:00
Laurent Smet 2bba89c4ad [FIX] account: Fix forward-port of ec25b9d01b
Since this commit has been wrongly forward-ported, the fix is still not deployed on 12.0.

closes odoo/odoo#30505
2019-01-24 10:08:44 +00:00
Yannick Vaucher 37cb987177 [FIX] tools: fix typo in help message
for --db_maxconn option

closes odoo/odoo#30433
2019-01-23 08:31:47 +00:00
Nicolas Martinelli 2cfbb8594b [FIX] website_sale_stock: product availability
- Install eCommerce, Inventory,
- Go to website setting and set availability of products as a "Show
  inventory on website and prevent sales if not enough stock"
- Create new service type product, and publish it
- Go to shop

The button Add to cart is disabled.

Apply this option to stockable products only.

opw-1931638

closes odoo/odoo#30444
2019-01-22 15:41:13 +00:00
Nicolas Martinelli 3eeb77414b [FIX] delivery: package UOM
Since it is now possible to select the default UOM, do not hardcode `kg`
in the view.

opw-1920809

closes odoo/odoo#30427
2019-01-22 11:19:41 +00:00
Jeremy Kersten 8f2267b512 [FIX] web_editor: hack o_switch input style
On Chrome, there are a rounding pixel that make the button ugly since several month.
Meanwhile to have a clean way to fix it, bypass the rounding pixel.

https://odoocdn.com/web/image/10933003/Selection_181.png

closes odoo/odoo#30452
2019-01-22 16:38:48 +00:00
Jeremy Kersten 9cfd1eefd8 [FIX] website: don't copy is_published
Before this commit, if you duplicate a published record on the website,
the copy was already published, while in most of case you need to update
it to adapt to the new content. There doesn't make senses to duplicate the
same content on a website and let the duplicate content.

Task-1930058
2019-01-22 16:38:48 +00:00
Nans Lefebvre d794cd616b [FIX] web: make the fields display without overlap in settings
The display of many fields in the setting overlaps other elements,
e.g. OnSIP WebSocket, Domain and VoIP Environment in General Settings.

We override the flex: 0 0 66,6% set by Bootstrap by flex: 0 0 auto
so that everything automatically looks nice.

closes odoo/odoo#30359
2019-01-21 08:03:04 +00:00
Babatope Ajepe 201f44380c [CLA] signature for ajepe
closes odoo/odoo#29545
2019-01-22 12:31:53 +00:00
Xavier Morel a313f342d3 [IMP] core: add force_save support to server-side form
Cf 3b3f6f04af for basic feature
description.

Task 1931580

closes odoo/odoo#30428
2019-01-22 11:12:39 +00:00
mreficent 23e0d2cc17 [FIX] base_gengo, pad, pos_cache: add missing _description on some models
closes odoo/odoo#30412
2019-01-22 11:16:33 +00:00
len-odoo e5486c12bc [FIX] osv: fix combination of unit domain
Combining a list of elements containing only the monoid's unit should return the
unit.

Since the unit is skipped, it would return an empty domain instead of the unit,
meaning that (0, '=', 1) could not be used in a group rule.

To test this, create a record rule on a model M with domain (0, '=', 1)
that applies to group G.
Log in with a user in group G and access model M; you can read everything
(provided no other record rule applies) whereas you should see nothing.

Because of expression.AND(global_domains + [expression.OR(group_domains)])
we want the empty domain to still be left untouched, even if it violates
the OR's unit rules (i.e. OR(empty, OR(R)) = OR(R) <=> OR(empty) = unit).
Meaning that no group rule would reduce to having a (0, '=' 1) group rule.
So in the end we don't really care about all that algebraic nonsense.

closes odoo/odoo#28765
2018-12-20 10:41:43 +00:00
Yenthe666 03291bdcc8 [FIX] website_forum: order forum votes from newer votes to older votes
closes odoo/odoo#30396
2019-01-21 10:08:15 +00:00
Martin Trigaux caaabadc66 [FIX] mail: do not download attachment content to list it
When creating the list of attachments, no fields information was given, making
the search_read read the content of each field, including the infamous datas
Already fixed at 73d9b9588f but the domain was not backported

Fixes odoo/odoo#30394

closes odoo/odoo#30415
2019-01-22 07:46:02 +00:00
Daniel Yang 50060a7d07 [CLA] signs the CLA for zyyang
closes odoo/odoo#30378
2019-01-22 07:05:16 +00:00
Alexandre Kühn 0d87b1ccea [FIX] mail: do not open document chat window without access rights
Before this commit, a user could unintentionally discard a
notification from a document that he does not have access
rights at the moment.

Steps to reproduce:

1. Setup:
- Odoo with multi-company
- Two companies: "MyCompany" and "SuperCompany"
- Two users "Admin" and "Demo", both have access to being in
  both companies
- "Demo" has Notification management in Odoo in the user preferences.
- "Admin" is logged in "MyCompany"
- "Demo" is logged in "SuperCompany"

2. Scenario:
- "Admin" mentions "Demo" in a log of a document from "MyCompany"
- "Demo" receives the notification and click on the notification
  from messaging menu.
> Dialog prompts that Demo does not have access to the document (OK)
> Empty chat window is open (not OK)
- "Demo" closes the chat window
> Notification is marked as read (not OK)

This commit fixes the issue by aborting the opening of a
chat window if the user does not have the access rights
at the moment. It should prevent marking the notification
as read by mistake by closing the chat window.

Task-ID 1931313

closes odoo/odoo#30414
2019-01-21 15:35:23 +00:00
Denis Ledoux 6355126ff1 [FIX] web: oversight during forward-port f854e01a98
pyeval is no longer there in 12.0.

it's pyutils for christ sake @kangol
2019-01-21 18:18:02 +01:00
Odoo Translation Bot 127fdea764 [I18N] Update translation terms from Transifex 2019-01-21 17:38:09 +01:00
Nans Lefebvre 0d6a796b57 [FIX] sale, crm: put the sales overview behind salesteam.manager group
If a user has no rights on sale, he should not see the sales menuitem
on the dashboard.
This is because the report_sales_team, which was set on a menu restricted
to managers, has been moved to a menu without groups.
We therefore set the group salesteam.manager directly on report_sales_team
to have the same rights as before.

Similarly, this same report is visible in the CRM app without manager rights,
so we put them explicitly on sales_team_menu_team_pipeline.

Also reverts commit 2cdc1cc9ce that put the groups
on the sales root menu.
It is unnecessary to do so, since when all submenus are hidden to a user,
then the app icon is automatically hidden to the user.
This practice allows customisations to put views accessible without any rights
on that specific app.
Since the sales.team manager has been put back on the correct dashboard,
this previous commit is now useless.

opw 1914373

closes odoo/odoo#30390
2019-01-21 08:11:42 +00:00
Nans Lefebvre 3bf2faca5d [FIX] web: make the module names not overlap in settings
The display of long module names, e.g. 'EMail Marketing' or 'General Settings',
overflows on the following line, resulting on the superposition of text.
We fix that.

closes odoo/odoo#30355
2019-01-18 12:36:01 +00:00
Graeme Gellatly 194fc8a136 [REF] stock_account: _run_fifo_vacuum: get moves to vacuum
Do not perform useless calls to `search`.

Closes #29962

closes odoo/odoo#30392
2019-01-21 08:51:30 +00:00
Sébastien Theys 1c5b28fbdd [FIX] sale_coupon(_delivery): fix coupon test with product configurator
The copy() is unnecessary, and it is introducing an issue because
product.template.attribute.value are not created correctly for copied templates.

The test can be done on the original data, the transaction is going to be
reverted either way.

closes odoo/enterprise#3301
2018-12-18 16:15:34 +00:00
Sébastien Theys 19d8d3a626 [FIX] sale_coupon(_delivery): fix coupon test with product configurator
The copy() is unnecessary, and it is introducing an issue because
product.template.attribute.value are not created correctly for copied templates.

The test can be done on the original data, the transaction is going to be
reverted either way.

closes odoo/enterprise#3301
2018-12-18 16:15:34 +00:00
wan 9ef7802520 [ADD] l10n_nl: tax codes for 9%
closes issue #29352
The Dutch taxes will change the low tax 6% to 9% on 01/01/2019. Please add these tax code in the system and also change the affected fiscal positions. Both 6% and 9% needs to exist during the transition period.

closes odoo/odoo#29374
2018-12-18 09:48:41 +00:00
Odoo Translation Bot 076c835544 [I18N] Update translation terms from Transifex 2019-01-01 02:42:55 +01:00
Thibault Delavallée cc217569b7 [FIX] base: fix name_search on res_partner when searching on linked users
Currently name_search on res_partner holds code to be done by a customized SQL
query allowing to speedup the search [1]. However when dealing with given args
there may be a crash if there is a domain based on user_ids fields.

Indeed this field is defined as auto_join [2]. It means the result of get_sql
returns where parameters based on joined tables. Those tables are not available
in the from clause in the original query.

This commit fixes that issue by correctly taking the from_clause from get_sql.
That way joined tables are available. Small update of the query is necessary
as fields are now res_partner.{id/email/vat/reference} as there may be several
tables linked in the query.

A test has been added to avoid regression.

[1] See https://github.com/odoo/odoo/commit/05ec12692f99b69924765fd0ce384632547f03f9 for a recent modification
    and implementation of this query, even if it exists since a looooong time
[2] See https://github.com/odoo/odoo/commit/db8203c27a21acdbcad2cf1c394b6fea3cf13688 for the auto_join addition

closes odoo/odoo#29827
2018-12-21 15:40:32 +00:00
David Tran 6bf8b25b70 [IMP] base: Vietnam Dong should have 1.00 as rounding.
No decimal part in Vietnam Dong (đ - Việt Nam Đồng)

closes odoo/odoo#29650
2018-12-19 14:24:43 +00:00
Denis Ledoux 5856dab380 [IMP] product: name_get, use mapped to gain some memory
This revision is related to
12df3c6a98

The above revision serve its purpose as well,
but by avoiding to store the result in a variable,
and using the records cache instead,
we gain some memory, which is noticeable
when there are hundred of thousands products.

The sudo() is important, as it must be the
same environment then the above call to read
to use the same cache.
Otherwise the values won't be in the cache
of self (without sudo),
and it will go get it and prefetch other fields
in the database.
2018-12-19 18:49:14 +01:00
Denis Ledoux 12df3c6a98 [FIX] product: name_get, products can share the same template
Oversight in revision
a91ffcf1a7

Multiple products can have the same template.

Passing multiple times the same template id
to the search domain to get the sellers
works, but better avoid the repetition
for the performances.
2018-12-19 18:28:23 +01:00
wan 06ad641b0a [ADD] l10n_nl: tax codes for 9%
closes issue #29352
The Dutch taxes will change the low tax 6% to 9% on 01/01/2019. Please add these tax code in the system and also change the affected fiscal positions. Both 6% and 9% needs to exist during the transition period.

closes odoo/odoo#29375
2018-12-18 09:42:42 +00:00
Lucas Perais (lpe) d3e84f80f4 [FIX] purchase: prevent div by zero in purchase.report
Spinoff of 6cd12694d8

OPW 1916964

closes odoo/odoo#29828
2018-12-31 08:47:16 +00:00
Wolfgang Taferner 138550fd2e [FIX] stock_picking_batch: do not lock batch model on transient model
closes odoo/odoo#29722
2018-12-23 07:57:27 +00:00
Odoo Translation Bot 912f88b980 [I18N] Update translation terms from Transifex 2018-12-30 03:12:33 +01:00
Nans Lefebvre 738e60c6eb [FIX] service: fix integrity error display
During the installation of a module, an IntegrityError can be raised,
e.g. if some module data already exists in the database
(as in the case of a module which uninstallation did not remove its data).

In Python2 it was possible to use such a psycopg2.IntegrityError with i[0]
to get its error message, while this raises an exception in Python3,
i.args[0] is needed.

As a result the log would contain an exception within an exception instead of
displaying an error to the user.

opw 1916374

closes odoo/odoo#29787
2018-12-28 14:27:11 +00:00
Andrea fe381f95b7 [FIX] stock: xrange->range in template report_location_barcode
closes odoo/odoo#29652
2018-12-19 15:10:13 +00:00