Commit Graph
119137 Commits
Author SHA1 Message Date
Christophe Simonis efe7ca16b7 [MERGE] forward port branch 11.0 up to bb6f6c57f9 2018-11-28 17:44:46 +01:00
Christophe Simonis bb6f6c57f9 [MERGE] forward port branch saas-15 up to 925210714f 2018-11-28 16:13:24 +01:00
Christophe Simonis 925210714f [MERGE] forward port branch saas-14 up to 8ee67f2a19 2018-11-28 15:43:17 +01:00
Robot Odoo 34b26bc7d6 [IMP] hr_attendance: faster loading of employees kanban view
**Description of the issue/feature this PR addresses:**

Addon hr_attendance adds a check_in/check_out status icon in every card of the employee kanban view. The status is figured out using computed field ``attendance_state``, itself relying on a computed Many2one field, ``last_attendance_id``.

The current way to compute the latter field seems to fetch all attendances before getting the most recent one. For each employee. Which causes the employee kanban view to load very slowly (~30 sec in 90-employee Camptocamp's instance).

This PR suggests to load only the last attendance entry.
Co-authored with @guewen

**Current behavior before PR:**

Employee kanban view loads very slowly.

**Desired behavior after PR is merged:**

Employee kanban view loads reasonably fast.

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

closes odoo/odoo#28953
2018-11-28 14:49:44 +01:00
Christophe Simonis 8ee67f2a19 [MERGE] forward port branch 10.0 up to 42c42832b3 2018-11-28 14:41:28 +01:00
len-odoo d1490e2777 [FIX] mail: do not have _get_message_needaction crash on empty task list
Suppose that a Task is added on a task via a studio customisation.
Then the _get_message_needaction method gets called on the onchange of the
toplevel task, which triggers another call to _get_message_needaction.
During that update, we get a self with a model.newID; its ids field is empty,
so the list of tasks res itself is empty.
As a result the method crashes on a malformed query.
This can in turn prevent the completion of some higher-level operation,
e.g. a state change on the task.

opw 1909043

closes odoo/odoo#29084
2018-11-28 09:11:28 +00:00
Lucas Perais (lpe) 2e109db01b [FIX] web: context orderedBy not propagated to x2m
Have:
- Model A with a x2m to model B
- Object A with multiple objects B in x2m (that will be sorted)
- On the list view of model A, click on a column to sort by a field
- this field shall not exist in B
- open a record A (towards form view)

Before this commit, the sorting of the x2m crashed, because the key orderedBy was propagated
Due to commit e713ed2a69

After this commit, it doesn't crash

OPW 1913133

closes odoo/odoo#29094
2018-11-28 09:35:39 +00:00
Prakash Prajapati 679cf0d83f [FIX] purchase_requisition: Request Approval on exclusive requisition
Usecase to reproduce:
- Enable 'Managers must approve orders'
- Set agreement type as 'exclusive'
- Connect as purchase user
- Create a requisition and an RFQ linked to it
- Confirm the RFQ

It raises a usererror that ask to close other PO linked
to requisition.

It happens because the purchase requisition code do not take
care of double validation on PO. It will try to close the requisition
once button_confirm is called. However it will only write 'to approve'
on PO state and thus trigger the requistion error will be raise since
all linked PO are not 'done' or 'cancel'.

In order to fix it, the action_done on requisition should be call
on button_approve instead of button_confirm. (button_approve is
automatically called when double validation is not enable).

Task: #1884410
Closes #28068

closes odoo/odoo#29049
2018-11-28 04:51:02 +00:00
Christophe Simonis 476866ddab [MERGE] forward port branch saas-14 up to f5dc49da89 2018-11-27 17:09:04 +01:00
Christophe Simonis f5dc49da89 [MERGE] forward port branch 10.0 up to 6639630de1 2018-11-27 17:08:00 +01:00
Raphael Collet 42c42832b3 [FIX] base: translations lost after synchronization
Modifying a source term in an XML/HTML translated field can lose translations
if the same term is translated in several languages.

closes odoo/odoo#29078
2018-11-27 16:07:46 +00:00
Denis Roussel 6639630de1 [FIX] base: make check_credentials more consistent with alternatives
The other methods do test password length before verifying it, so even
if check_credentials() is not meant to be called directly, it's better
to keep it consistent with the alternatives.

Closes #29023
2018-11-27 10:14:43 +01:00
Olivier Dony 3b85900faf [DOC] install: update info about wkhtmltopdf
We now support version 0.12.5(.1), which is available for all recent Debian and Ubuntu versions,
and contains quite a few bug fixes. An up-to-date version of Odoo 10 or later is required, for
pixel-perfect compatibility with the result of 0.12.1.3.
See also the wiki for more info: https://github.com/odoo/odoo/wiki/Wkhtmltopdf
2018-11-26 13:40:15 +01:00
Christophe Simonis b09f624f20 [MERGE] forward port branch 11.0 up to 263b388c50 2018-11-22 17:52:57 +01:00
Christophe Simonis 263b388c50 [MERGE] forward port branch saas-15 up to e44c35f407 2018-11-22 17:06:31 +01:00
Christophe Simonis e44c35f407 [MERGE] forward port branch saas-14 up to a9752d3ad3 2018-11-22 15:03:01 +01:00
Christophe Simonis a9752d3ad3 [MERGE] forward port branch 10.0 up to af476c6949 2018-11-22 14:39:08 +01:00
Alexandre Saunier 1d2a4d8459 [IMP] hr_attendance: faster loading of employees kanban view 2018-11-22 12:22:36 +00:00
Alexandre Saunier e946f00801 [CLA] Add asaunier to Camptocamp CLA 2018-11-22 12:22:17 +00:00
Toufik Benjaa 23a7b15276 [FIX] http: avoid crash on jsonp POST+GET
- This commit fixes a crash that happens when the server receive a
  JSON-P call done in two requests (a POST followed by a GET).

  The issue is due to the fact that when the first request is done (POST
  one) the member `params` is never initialized.

  This parameter is then used in the module `auth_signup` on an override
  of the method `dispatch` thus crashing the code.

  To avoid the crash, we now initialize `params`.

closes odoo/odoo#27369
2018-11-21 10:09:10 +00:00
Lucas Perais (lpe) dc23365048 [FIX] calendar: detaching event makes recurring attributes irrelevant
Have a recurring meeting, repeated until some date

Edit one of the instances and detach it (click on "update only this instance")

Edit the detached event and change some value

Save

Before this commit, a JS error was thrown saying that the field final_date was invalid
This was because the required attribute on this field was set to True, but the python
put the value of the final_date to False

After this commit, there is no error as we set this value to false, since the field
doesn't make sense for a non-recurring event anyway

OPW 1892426

closes odoo/odoo#28850
2018-11-22 10:06:06 +00:00
Robot Odoo ba8bac8f98 [FIX] web: search input date in another timezone
Put the browser in timezone Sao Paulo (Or like West of UTC)

Trigger the autocomplete (and the subsequent search) on a date field
by writing a date (in the locale format) in the search view

Before this commit, the domain sent to the server contained the date as the day
**before** the one asked for in the input

This is because, the string input is parsed and gives:
input = 12/02/2018
When creating the moment object:
> since there is no explicit time, moment will interpret it as 12am (midnight)
> We force moment to consider the string as being UTC (function: moment.utc())
> the moment contains, as output the time ** 2018-02-12T00:00:00 UTC **

When getting the facet value for making the domain
> we call toDate on the moment object, which, according to the browser is UTC and will
be converted to the locale timezone before formatting
> And the domain will use the date 2018-02-11T22:00:00 Brazil/SaoPaulo
which gives the day before the one we asked for

After this commit, this issue doesn't arise, because we use the string representation of
the moment object in search_inputs (i.e 2018-02-12T00:00:00 UTC), to create a new one
*BUT* we create it with a date format that excludes the time from being interpreted.
Also, the resulting moment object in this case is not flagged as UTC anymore

OPW 1903224

closes odoo/odoo#28542
2018-11-22 13:02:21 +01:00
Дмитро Катюха f68c5261f9 [FIX] resource: Fix work/leaves hours count methods
Purpose
=======

Buggy example:
I have a 35h working schedule. I work every week day:
- From 8h to 12h
- From 12h to 16h

Let's say that I want to retrieve the working hours from Wednesday 14h03
to Thursday 11h03.

The working hours are:
- From 14h03 to 16h --> 1h57
- From 8h to 11h03  --> 3h03
----------------------------
TOTAL                   5h

Currently the result will be 1.95, i.e. 1h57 because the second day
is not taken into account as start time > end time, and thus rrule
doesn't manage this correctly and returns only the datetime corresponding
to the first day.

Specification
=============

Force the until parameter of rrule to be set at the end of the day, do
avoid skipping the second day. Do this in the methods that compute the
work hours and the leave hours.

Add a test to ensure the robustness of the fix.

Closes #21297

closes odoo/odoo#28920
2018-11-21 15:42:48 +00:00
Denis Ledoux af476c6949 [FIX] report: support for wkhtmltopdf 0.12.5
This revision brings the compatibility for our reports
using wkhtmltopdf 0.12.5.

Up to now,
the supported wkhtmltopdf version was 0.12.1.

The goal of this revision is to add the compatibility
to wkhtmltopdf 0.12.5,
while keeping the same exact rendering than in 0.12.1.

There is a behavior change with the `--dpi` parameter,
which no longer has a "zoom" level effect as it did with 0.12.1.

To deal with it, we pass the `--zoom` parameter when
the detected version installed of wkhtmltopdf is after 0.12.2,
with a ratio 96:dpi. 96 being the default dpi of wkhtmltopdf.

This trick allows to render the reports with the exact same
zoom level, whatever the dpi value configured in the reports paperformat.
(at least with dpi values up to 149, after 150, included,
the dpi parameter with wkhtmltopdf 0.12.1 as a weird behavior,
it no longer zoom out)

opw-1907346

closes odoo/odoo#28864
2018-11-21 09:30:02 +00:00
Nicolas Lempereur 1f8788deef [FIX] purchase: es_AR translation typo
Fixing it directly by commit since there is no es_AR on transifex.

The issue of the ticket has been solved by transifex, this is for
another similar issue that has been found.

opw-1907924
closes #28923
2018-11-21 17:37:35 +01:00
Denis Roussel e81809b89d [FIX] mrp: Allow mrp user to delete stock_move_lot links
With an mrp user, add lots lines to mrp production order moves. Then,
try to delete one line, the dustbin icon does not appear.

opw-1908930
2018-11-21 14:08:47 +01:00
Denis Roussel 8a6162d00d [FIX] mrp: User with no products write access cannot create production order
As the product_tmpl_id field is related one but not readonly, the creation
of production order triggers a write on product.product model
2018-11-21 13:16:45 +01:00
Lucas Perais (lpe) 07d4505759 [FIX] base: res_partner: clarify string of commercial_partner_country_id
To avoid confusion in the filters and elsewhere

OPW 1910654

closes odoo/odoo#28848
2018-11-20 14:39:14 +00:00
Goffin Simon 7b8c415fc5 purchase_mrp: qty_received not updated on a PO
Steps to reproduce the bug:

- Let's consider a product P with a BOM in kit
- Create a PO with P and confirm it
- Cancel the shipment and the PO
- Reset to draft the PO and confirm it
- Valide the new shipment and receive P

Bug:

The qty_received was not updated

opw:1904678
2018-11-19 15:23:00 +01:00
len-odoo 0081321136 [FIX] website_sale_digital: display download links on free digital orders
Create a coupon/promotion that gives a 100% discount on some digital product.
If the total of the order is 0, then the client won't have the possibility
to download the product(s), since the download links appear on invoiced lines;
and no invoice has been created.

We display the download link on the products if the order total is 0,
as the other cases are already covered by the existing code.

opw 1905682

closes odoo/odoo#28799
2018-11-19 13:46:02 +00:00
Denis Ledoux 8ea10d42ba [FIX] website_sale: performance imp to search abandoned carts
By removing the `.id` from the `partner_id.id` domain leaf,
the ORM avoids to do a useless `SELECT` to read
the id of all partners different from the public partner,
as it already got the information from the `sale_order` table

e.g
Here is the SQL request before the revision:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```
Here it is after:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" != %s))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```

closes odoo/odoo#28927
2018-11-21 17:05:13 +00:00
Raphael Collet 4894419b61 [FIX] cache: ormcache logger
The adaptation to Python 3 was done with two mistakes: the iteration on the lru
cache does not return keys, and functions are not sortable.

closes odoo/odoo#28870
2018-11-21 10:16:06 +00:00
Florent de Labarre baf48ee1f9 [FIX] project: remove unused and slow field
closes odoo/odoo#28887
2018-11-21 12:17:22 +00:00
Nicolas Martinelli 89927b7725 [FIX] point_of_sale: fine tune test
Remove false-positive errors based on the order of the data.

opw-1910248

closes odoo/odoo#28880
2018-11-21 11:18:26 +00:00
Katherine Zaoral d1b85c8d9a [FIX] mail: Future Activities filter in the mail activity search view.
closes odoo/odoo#28768
2018-11-16 16:39:15 +00:00
Adrian Torres 407f6e3532 [FIX] stock: do not prefetch stock.move fields
For a SO of 300 lines, when confirmed, it takes 195s to process stock
moves for the SO, which is an insane amount of time for any kind of
process in Odoo.

This happens because stock.move is a heavy model with lots of fields,
prefetching all these fields at once can hinder performance when
processing a lot of stock.moves.

To reduce the processing time, the prefetching is disabled in the
specific scenario of processing stock moves and pickings on SO
confirmation.

This patch increases the performance of SO validation (with stock
installed) by ~30%.

Pre-patch: 195s (300 SOL)
Post-patch: 135s (300 SOL)

closes odoo/odoo#28835
2018-11-20 10:51:07 +00:00
Katherine Zaoral edfcee0190 [FIX] base: fix name for country state of Buenos Aires
Change "Buenos Aires City" to "Ciudad Autónoma de Buenos Aires" accordingly to
http://www.afip.gob.ar/fe/documentos/TABLA%20PROVINCIAS%20V.0%20%2025082010.xls

closes odoo/odoo#28584
2018-11-20 18:11:20 +00:00
Julien (juc) Castiaux 124b5b8fee [FIX] product: disable "create & edit" shotcut for product variants
With the purchase module, when you create a new vendor, you can
select what variant of the product the vendor sells. The droplist
has the "Create & Edit" button to quickly create/edit variants.
This is not the wanted behavior. This PR removes the "Create & Edit"
suggestion.

opw-1909009

closes odoo/odoo#28845
2018-11-20 14:05:52 +00:00
Lucas Perais (lpe) e713ed2a69 [FIX] web: implement filter orderedBy
related to: #28446

On a pure list view, click on a column to sort the records by that field.

Save the filter as favorite

Reload, now apply the filter

Before this commit, there were two issues:
1. The order of the list was never propagated to search view, which couldn't save
the filter with its attribute "sort"

2. There was no mechanism to load the attribute sort from a loading Filter

After this commit, those two issues are corrected
Unfortunately, complex search view flows are not testable in v11.0

OPW 1906968

closes odoo/odoo#28766
2018-11-20 13:53:52 +00:00
Denis Ledoux 48dafd5b20 [FIX] point_of_sale: default pricelist test
The POS js tests expect the "Public Pricelist" when
selecting a lambda customer in the pos interface.

Nevertheless, when installing a localization
with a specific currency,
other than the currency of the public pricelist,
it creates a new pricelist called
"Default %(currency)s pricelist for %(company)s"
and sets it by default for the customers sale pricelist.
See
https://github.com/odoo/odoo/commit/787e1037cdca48fe361ae65d790056a3d57e6b67#diff-840bfc6fc7a986fbf0e248c83d2ac1d5R57

Therefore, in the POS js tests, the pricelist selected
when selecting a lambda user was no longer
'public pricelist' but the one mentioned above,
and the tests therefore failed.

The issue is solved by creating a dedicated "Public Pricelist"
for the purpose of these tests, and sets it by default
for the customer sale pricelist,
as well as for the pos config default pricelist.

The test case was to install `l10n_pe` with `point_of_sale`
while activating the test.
e.g. `-i l10n_pe,point_of_sale --test-enable`

opw-1890928
opw-1910249

closes odoo/odoo#28839
2018-11-20 11:59:45 +00:00
Nicolas Martinelli 8bff607f07 [FIX] point_of_sale: order currency
- Configure the company in USD
- Set-up the POS in EUR:
  Pricelist in EUR
  Payment journal in EUR
  Sales journal in EUR
- In the POS, sell a product (in EUR)
- Validate the session and post entries

The entry amounts are the EUR amounts, but they are posted in USD.

Long story short: nothing was foreseen to convert the amounts in the
appropriate currency.

Fixes #27175

opw-1904146
opw-1910248

closes odoo/odoo#28785
2018-11-20 09:44:37 +00:00
Raphael Collet b6d32de31e [FIX] base: optimize property fields
Implement the getter method in plain SQL.  This makes reading company-dependent
fields 33% faster (on 20000 partners, reading 'property_product_pricelist'
takes 3700ms instead of 5500ms.)

closes odoo/odoo#28769
2018-11-19 15:38:17 +00:00
Nicolas Martinelli 7e840a39a6 [FIX] web: External Link
In the case of a One2many list view in a `<group>` tag, the 'External
Link' button of a Many2one field (which allows opening the form view) is
not visible.

The `flex: 1 0 auto;` should not be applied in the list view.

Corresponding PR in v12: #28741
opw-1903158

closes odoo/odoo#28812
2018-11-19 19:21:38 +00:00
Nicolas Lempereur cac9173122 [FIX] web: m2o+o2m in o2m onchange no lose data
Steps:

- open a modal form view from tree view first line and make a change
- open a modal from the second line and make a change
- open the second line back: the change were lost

In a given number of conditions (a many2one inside the form view, there
is a one2many in the form view not inside the tree view, ....) this
happened because:

- when we save the first line, we get onchange data for the second one
- this onchange data can't be applied before second line is loaded, but
  it is saved so it can be applied if second line is ever opened
- when the second line is opened the saved change is applied => OK
- when the second line is opened a second time the saved change is
  applied again, possibly overwriting posterious change => BAD

With this changeset, when the record with unapplied onchange is loaded
for the first time, the unapplied onchange is applied only once.

Added test without the change failed with:

- only 1 turtle for second partner (result: 0 not 1)
- second partner turtle is Michelangelo (result: "" not "Michelangelo")

opw-1846820
closes #28644
2018-11-19 12:57:52 +00:00
Joseph Caburnay 108b43c60a [FIX] stock_account: corrected_value not considered as zero
The value of corrected_value can be very small, e.g. 1e-16, thus,
proper is_zero check should be used.

OPW: 1906519

closes odoo/odoo#28751
2018-11-16 10:28:58 +00:00
Odoo Translation Bot 1da3ff5a0a [I18N] Update translation terms from Transifex 2018-11-18 03:15:42 +01:00
Christophe Simonis 45d33f5357 [FIX] mail: correctly handle unset mimetype on safari
See 5e3b471f4a for more info
2018-11-16 17:25:55 +01:00
Raphael Collet f29df0f7a8 [FIX] stock: add index on stock.move.line.move_id
This field is a dependency of some computed fields, and has to be searched on
for triggering recomputations.  Without the index, the creation of stock moves
becomes slower as the table grows.

closes odoo/odoo#28757
2018-11-16 12:44:04 +00:00
Christophe Simonis bab2a191d2 [FIX] web: correct forward-ported test 2018-11-16 10:21:32 +01:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00