Commit Graph
127434 Commits
Author SHA1 Message Date
Laurent Smet b6bf77ead7 [FIX] account: Fix taxes computation
1) Suppose a tax of 21% intracomm +100%, -100% applied on 100.0.
The computed price_excluded was 121.0 instead of 100.0 because the
assumption was made the sum of repartition lines factor was always 100.0%.

After this fix, the amounts are always multiplied by the sum of repartition lines factor
in order to reflect correctly the impact of each repartition lines.

2) The rounding is now working for any kind of repartition lines and the consistency
of tax amount regarding the repartition lines is always ensured.
See use cases described by the tests for more details.

closes odoo/odoo#36082

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-08-27 14:36:10 +00:00
Lucas Perais (lpe) d310cd4478 [FIX] web: selection: required, option present but disabled
Before this commit, a field selection which was required
did not have an empty option
ref: 4dfabb8f7a

This is fine, but overlooked the fact that modules can modify
the required attribute, or even views can do it
So, we may end up in a situation where the field is required but set to false
This configuration is problematic, at least for the timezone selection field
(see OPW)

After this commit, the empty option is just not visible
note that `disabled = True` would not work because val is not accessible

Because of commits:
- 4dfabb8f7a for the selection feature
- d77ce4c2a9 overriding the required attribute of tz in res.user form

OPW 2057913

closes odoo/odoo#35989

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-23 14:29:05 +00:00
Martin Trigaux f01c325e9a [FIX] gamification: always show the list of users
It is an important information as it is different that the domain.
The users computed with the domain are added to the list, never removed.

closes odoo/odoo#36033

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 10:03:54 +00:00
Martin Trigaux 6ca81cd868 [FIX] gamification: tolerate invalid definitions
If a goal definition with a target goal of 0 and "higher the better",
instead of dividing by 0, set a progress of 0% (it is not possible to
compute the progress)

Task id: 2057898
2019-08-26 10:03:54 +00:00
Martin Trigaux 712808581d [FIX] gamification: make kanban clickable
It should be possible to open the view form of a goal from the
"Related Goals" action. This is an easy way to set progress for manual
goals.

Task id: 2057898
2019-08-26 10:03:54 +00:00
Martin Trigaux 64fef75eef [FIX] gamification: initialize goals at 0
If a manual goal has a target of 10, it should not start at 9 but 0
If it has a target of 0, it should start at -1

Task id: 2057898
2019-08-26 09:41:36 +00:00
Martin Trigaux 15084109ef [FIX] gamification: allow to remove users
The users are always happened when matching a domain, never removed
(which is a feature, so you can manually add people).
If you made a mistake in your domain (e.g. start large and refine),
there was no way to remove them afterwards.

Task id: 2057898
2019-08-26 09:41:36 +00:00
Lucas Perais (lpe) 466b97c594 [FIX] lunch: lunch search panel right domain on start
Open the Lunch kanban view

Before this commit, the counts for each product were the counts
across all location
This was before the location domain from the lunch widget was not sent

After this commit, the counts displayed on startup are the ones
of the right user location

OPW 2053044

closes odoo/odoo#35976

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-23 14:42:44 +00:00
Aaron Bohy 6602e1cf2d [FIX] web: grouped list with <groupby> node and onchange
Let's assume an editable grouped list view with a <groupby>
node containing subfields, and an onchange. Edit a row to trigger
the onchange. Before this rev., it crashed because the onchange
specs was incorrect: it followed the relation of the many2one
and thus included its subfields (whereas it should only follow the
relation for x2many fields).

For example, go to Accounting > Accounting > Sales and edit the
label of a move line.

Task 2044187

closes odoo/odoo#36001

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-23 11:08:27 +00:00
Aaron Bohy edc710f758 [FIX] web: MockServer: correctly remove childNodes
Removing elements from a list while iterating over it isn't a good
idea. As a consequence, the MockServer didn't support list archs
with a <groupby> node containing several <field> nodes, or a
<field> node precedeed by a text node.
2019-08-23 11:08:27 +00:00
Pierre Masereel 9ae33dd50c [FIX] point_of_sale: offline with invoice
When you are offline, and you validate an order with an invoice, the
rejection of the Promise is not well handled and propagated which lead
to enter in a resolve even if it has failed.

We are now correctly propagting the rejection of the call to the server.

closes odoo/odoo#35974

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-22 13:14:30 +00:00
Julien Castiaux 1e914bc11e [FIX] l10n_it_edi: fetchmail.server.type renamed
Fine tuning of 529c1a2e

closes odoo/odoo#35962

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-22 11:37:28 +00:00
Christophe Simonis 9ee8d846b8 Revert "[FIX] l10n_es: fix base tags for groups of taxes"
This commit shouldn't have been forward-ported.

This reverts commit 2078fefdb1.

closes odoo/odoo#35928

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-21 15:47:08 +00:00
Simon Lejeune ea92e0b333 [REM] mrp_subcontracting
There was a first version of mrp_subcontracting at rev [1] and now
there's a second verion at rev [2]. As the second version sensibly
changed the flows and models AND we don't have the time to backport the
changes AND saas-12.3 will be released on the saas, we chose to remove
the module in saas-12.3 to not have to support both version once v13 is
released.

[1] d91db5bde6
[2] 9b6a5398df

closes odoo/odoo#35898

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-21 08:49:41 +00:00
Lucas Perais (lpe) 42820c35db [FIX] website_slides: adapt youtube api widget to promise
Before this commit, the adaptation of Deferred to Promise was not well done
Hence, the change in video playing status was not handled correclty
i.e. When a video arrives to its end, the next slide or the questions should be displayed

After this commit, when a video is finished, the next slides is displayed

OPW 2052971

closes odoo/odoo#35863

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-20 13:55:48 +00:00
Pierre Masereel 4a6d666246 [FIX] delivery: set carrier on order when carrier line added
When you are adding a line on your sale order that is a delivery line,
the carrier is not always set on the sale order which means that when
the carrier is not explicitly set on the sale order, the carrier won't
be set on picking created from the sale order.

When you are using the wizard on sale order, it works, but when the
carrier is selected on the e-commerce, it is not set on the sale order.

To avoid such difference in behavior, we are writing the carrier_id of
sale order in the function 'set_delivery_line' insread of the wizard and
e-commerce.

closes odoo/odoo#35855

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-20 12:52:05 +00:00
Romain Derie 4323008540 [FIX] website_sale_delivery: fix wrong selector + add test
Since commit e8916a817c, it was not possible anymore to go through the
ecommerce checkout when `website_sale_delivery` module was installed.

Indeed, it would raise a traceback on the confirmation step if more than one
delivery carrier would be available (different qweb if more than one carrier).

Thus, it would not be possible to click on pay now and buy the product.

This commit fixes it and improves the current test to ensure such flows are
working.

closes odoo/odoo#35577

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-20 12:33:15 +00:00
wan 9f22d7a445 [FIX] base: same vat with empty string vat
If partner.vat is an empty string, python evaluates it as falsy and doesn't check the remaining of the line. This makes the framework to send ["", ""] as values for the many2one to the browser instead of false.
By forcing to have True or False, this is not a problem anymore as bool() will be False, and False will result in the correct value in the read.

closes odoo/odoo#35807

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-19 11:35:40 +00:00
Christophe Simonis 6f55fd65da [FIX] mail: correct test adaptation to async version
Oversight of previous forward-port.
2019-08-20 10:42:44 +02:00
Alex Tuyls 60c438dfb7 [FIX] sale_coupon: performance issue with promotion programs
In case of large cart and promotion program with a discount reward
of percentage type, we are rewriting the reward order lines
multiple times while we can do all in one update.

opw-2038791

closes odoo/enterprise#5086

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>

X-port/Cherry-pick of odoo/enterprise@243e66663a
2019-08-19 19:28:48 +02:00
Christophe Simonis 20e69b3299 [FIX] stock: correctly forward-port 5b83f7214f
Oversight of previous forward-port.
2019-08-19 19:27:53 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Christophe Simonis 32039b2ab4 [FIX] test_access_rights: add _description to new test model
Oversight of previous forward-port.
2019-08-19 17:08:08 +02:00
Christophe Simonis aac8e0c960 [MERGE] forward port branch saas-11.3 up to 121034f79a 2019-08-19 16:38:30 +02:00
Christophe Simonis 121034f79a [MERGE] forward port branch 11.0 up to 1e4de19cd4 2019-08-19 14:43:31 +02:00
Christophe Simonis 1e4de19cd4 [MERGE] forward port branch saas-15 up to c43de33643 2019-08-19 13:54:40 +02:00
Christophe Simonis c43de33643 [MERGE] forward port branch saas-14 up to fa26279014 2019-08-19 12:51:26 +02:00
Christophe Simonis fa26279014 [MERGE] forward port branch 10.0 up to 59c59cd8a0 2019-08-19 12:47:56 +02:00
Julien CastiauxandHugo Adan 855447fc77 [FIX] ir_rule: invalid user context propagation
Create two models, `object` and `category`. The object have a Many2One
to the category. Override the `search` on the category so it returns a
subset of the records if a context key is present. Create an IR Rule on
object with the following pseudo-domain: `categ_id in category.search([])`.
Search on object with the context key present. Even if the context
should only be applied to category, it is applied to object too thus
there are some object missing.

When evaluating the domain of IR Rules, the current user is propagated
with the current environment context. API calls triggered by the domain
are called with the given context, possibly populating the cache with
different records than it would normally does without the context (i.e.
at `addons/point_of_sale/models/account_journal.py#L19-L23`). Following
requests do use that invalid cache thus return invalid results.

Forcing an empty context on the user used during the evaluation of the
context ensures the IR Rules are working as they should and is
future-proof (cf `load_company` v13 context key)

opw-2041667

closes #35123
closes #35125

closes odoo/odoo#35667

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>


Co-authored-by: Hugo Adan <hugo@vauxoo.com>
2019-08-19 09:04:09 +00:00
Christophe Simonis b6deb72747 [MERGE] forward port branch 10.0 up to 2fc46a064d 2019-08-19 10:24:42 +02:00
Fanny He f9f288cd47 [FIX] sale_timesheet: correct the context when viewing a contact's SO's tasks
When accessing a SO's tasks from Contacts (the partner_id's page), and
calling action_view_task, the active_id first corresponds to the contact's id.
Therefore, if a project.project exists with the contact's id, one can access
the SO's tasks, but otherwise, we get the error

Record does not exist or has been deleted.

(Records: [partner_id], User: ...)

Thus, if there is one corresponding project, we first update the context:
active_ids is set to project_id,
allowing access to the SO's corresponding project's tasks.
Note that the same thing is done lower:

eval_context.update({'active_id': task_projects.id})

which is too late to avoid trying to access the wrong record.

In the case where there are more than 1 corresponding projects (or if
there are no corresponding tasks), we don't have the issue.

OPW 2052559

closes odoo/odoo#35792

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-19 06:20:00 +00:00
Holger Brunn 024d7ebaa0 [FIX] tests: wait for chrome's cookie to be set
In some cases, the first request of a test is made before the
proper setting of the cookie. In that case, Odoo picks a new session,
leaving the request unauthenticated.

closes odoo/odoo#35780

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-08-19 07:29:44 +00:00
Odoo Translation Bot 0458337bc3 [I18N] Update translation terms from Transifex 2019-08-18 03:08:13 +02:00
Nicolas Martinelli 57fef7c11c [FIX] survey: certificate of failure
- Take a quizz survey, and fail it
- Go to Answers
- Print the Certification

Even if the quizz was failed, the certification can be printed.

There is no option to prevent printing a PDF, therefore we need to print
a different template.

opw-2049481

closes odoo/odoo#35769

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 14:04:03 +00:00
Swapnesh Shah d5072c2ec6 [FIX] calendar: Add force_save to send values to server
- Create Event (Where All Day is Set to False)
- Edit Event > Check 'All Day', make it 'Recurrent'

An error occurs because a mandatory field is not set (`stop_date`).

It is possible to work around the issue by doing:
- Check 'All Day'
- Save
- Make it 'Recurrent'

However, the result should not depend on the order we perform the
action. To solve this we send data to server with `force_save`.

Fixes #27269
Closes #33068

closes odoo/odoo#35758

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 10:35:18 +00:00
Odoo Translation Bot ab38242cbd [I18N] Update translation terms from Transifex 2019-08-18 01:18:20 +02:00
Andrea Grazioso (agr-odoo) 9a362dda4f [FIX] maintenance: Wrong alias set up on category creation
From the Maintenance app go to "Settings">"Equipment Categories".
Create a new category, insert a name and save. An alias get
automatically created with the same name as the new category.

The new alias point to "Maintenance Equipment" model, so when
an email is matched with the alias a new equipment under the new category
is created. This is indeed the default behavior but the help message
is deceiving the user. Changing it.

opw-2049830

closes odoo/odoo#35728

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 11:58:33 +00:00
Aaron Bohy a32aa05a6b [FIX] web: list: break words in text fields
closes odoo/odoo#35713

Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
2019-08-16 06:37:07 +00:00
Aaron Bohy cf318ad90c [FIX] web: list: tweak columns weight 2019-08-16 06:37:07 +00:00
Nans Lefebvre 6a1e272ccd [FIX] stock: do not raise if writing the same value
Rewrite the product associated to a serial number.
There is a check to forbid this if some move lines already exist.
This check does not actually care what value is written,
so it can raise uselessly (and forbid a legitimate write).

opw 2049717

closes odoo/odoo#35736

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-14 15:24:06 +00:00
Alexandre Kühn 9ea5aecee8 [FIX] mail: receive message then delayed needaction notifications
Before this commit, when a user received a needaction notification
on a message already stored locally, it crashed with this error:

`TypeError: Cannot read property 'getThreadIDs' of undefined`

This is caused by `addMessage` returning a Promise not resolved with
the message when the message is not new. The returned promise should
always be resolved with the message, in order to be consistent.

closes odoo/odoo#35724

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-14 12:56:27 +00:00
Sébastien Theys c2271c8740 [IMP] doc: add t-name t-extend to QWeb JS
task-2040835

closes odoo/odoo#35116

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-14 12:49:56 +00:00
Alexandre Kühn 52ad807817 [FIX] mail: no crash on opening chat window twice
Revision on https://github.com/odoo/odoo/commit/e8f7770a13d6ddc1cb8ec1bcebcb22e21962ba52

Commit above fixes an issue with chat windows being open twice.
It fixed the issue by aborting opening a chat window in case a
chat window is already being open.

Opening chat window may be a slow process, due to requiring fetching
some messages beforehand. This operation is necessary in order to
check whether the user has access to messages or not, and prompt an
error message without opening the chat window in the latter case.

The fix did not respect the specs of the method `openThread`: it
pre-emptively returned nothing, instead of returning a resolved
promise. Because of this, it crashed on `undefined.then()`.

Task-ID 2053095

closes odoo/odoo#35722

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-08-14 12:03:46 +00:00
Kaushalya Mandaliya 2ba725df61 [FIX] mail: hide activity menu dropdown on activity icon click
Before this commit, The dropdown menu remained open after clicking on
activity icon.

After this commit, The dropdown menu is closed whenever the activity
icon is clicked.

Task-Id: 2047408

closes: #35568

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-14 12:16:28 +00:00
asa-odoo dad863d305 [FIX] mail: send message button not working in channel
Before, If direct chat or channel has no any message in chat history, then
send button is not clickable in discuss.

Now, fix in scss file will allow to click send button for channel and chat.

Task : 2037292

Closes #35570

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-14 11:00:19 +00:00
Alex Tuyls c28a466069 [FIX] hr_expense: Allow Expense Responsible to validate expenses
In case a User is defined as Expense Responsible for another
user, and if he has Officer Expenses Rights, he cannot validate
an expense while it should be the case.

opw-2043985

closes odoo/odoo#35711

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-14 08:43:56 +00:00
Andrea Grazioso (agr-odoo) 364f01b447 [FIX] stock_picking_batch: blurry barcode in report
From the Inventory (stock) application go to Operations>"Batch Pickings"
Create or open an existing Batch Picking and click on "Print".

A report will be generated containing the barcode associated with the
operations. The barcode cannot be read from a barcode scanner because
it's too blurry (probably because of the low quality it contains
an unnatural greyscale).

When this report is generated from the template, a request to generate
the barcode is sent to the controller, which invoke the procedure to
create the png image on the fly with a set of parameters embedded into
the request.
If the width and height parameters are too low the result is a low
quality image, so the solution is to pass higher parameters and then
resize the image via "style" attributes.

Note that the same solution is applied in multiple templates.

opw-2045949

closes odoo/odoo#35752

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 09:23:00 +00:00
Nicolas Martinelli 6b6d290a5b [FIX] account: no candidate in reconciliation model
Make sure we don't execute the method with an empty list of candidates
to avoid a zero division.

opw-2049881

closes odoo/odoo#35723

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-14 12:10:31 +00:00
Goffin Simon 9e6f342e06 [FIX] {purchase,sale}_stock: Not possible to see a SN on an other company
Steps to reproduce the bug:
- Let's consider two company C1 and C2 and a user U allowed for this two companies
- Create a storable product P tracked by serial number
- Create a PO in C1 with P and deliver it with a serial number SN
- Go to Inventory>Master data>Lots/Serial Numbers
- Change your current company to C2
- Click on SN

Bug:

An access rights error was raised because the system tried to compute SO and PO linked to SN
with the moves of all the companies. So the record rule "stock_move multi-company" was
raised.

opw-2049093
closes #35694

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-08-14 11:49:15 +00:00
Andrea Grazioso (agr-odoo) f8978fc235 [FIX] odoo: zlib error in PyPDF2
Pdf files created with third party tools could trigger an exception in
several modules that attempt to manipulate them (see example below).

```
File "/usr/lib/python3/dist-packages/PyPDF2/pdf.py", line 2239, in mergePage
self._mergePage(page2)
File "/usr/lib/python3/dist-packages/PyPDF2/pdf.py", line 2277, in _mergePage
originalContent, self.pdf))
File "/usr/lib/python3/dist-packages/PyPDF2/pdf.py", line 2199, in _pushPopGS
stream = ContentStream(contents, pdf)
File "/usr/lib/python3/dist-packages/PyPDF2/pdf.py", line 2673, in __init__
stream = BytesIO(b_(stream.getData()))
File "/usr/lib/python3/dist-packages/PyPDF2/generic.py", line 845, in getData
decoded._data = filters.decodeStreamData(self)
File "/usr/lib/python3/dist-packages/PyPDF2/filters.py", line 346, in decodeStreamData
data = FlateDecode.decode(data, stream.get("/DecodeParms"))
File "/usr/lib/python3/dist-packages/PyPDF2/filters.py", line 111, in decode
data = decompress(data)
File "/usr/lib/python3/dist-packages/PyPDF2/filters.py", line 49, in decompress
return zlib.decompress(data)
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
```

This is caused by the decompression function used by default in PyPDF2
which uses a limited buffer, unable to store all the data.

The solution, as per
[zlib documentation](https://docs.python.org/3/library/zlib.html#zlib.decompressobj),
is to use an intermediate ```decompressobj``` object to handle
the decompression.
However we do not directly control the library, which is also used
multiple times in the codebase so we decided to apply a fix directly into
the core module instead of patching every call.

opw-2048029

closes odoo/odoo#35646

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-14 11:55:53 +00:00