Commit Graph
127612 Commits
Author SHA1 Message Date
Jairo Llopis a78d743251 [FIX] website: Never find pages from other websites
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.

closes odoo/odoo#34913

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-17 07:54:45 +00:00
Nicolas Vannieuwerburgh 81c2d343b5 [FIX] mrp: mrp_production.delivery_count more robust
when no group_id on mrp_production, set the delivery_count to 0

closes odoo/odoo#35372

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-01 09:48:10 +00:00
Fanny He 9022f2154c [FIX] partner_autocomplete: UserError instead of traceback when no credits
When creating a res_partner company, with "Auto-populate company data",
if there is 'Insufficient Credit', AccessError, ConnectionError are caught,
but not UserError.
The user can therefore gets a vague js error
"Uncaught TypeError: Cannot read property 'type' of undefined"
We thus add exceptions.UserError among the caught exceptions.

opw 2040646

closes odoo/odoo#35366

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-01 05:54:54 +00:00
Lucas Perais (lpe) c077ef0557 [FIX] base: correct branding for replaced node
Have an inherited view replacing a node in its parent
namely:

```
<view name="1">
<world/>
<world/>
<world/>
</view>
```

Inherited by
```
<view name="2" inherit_id="1">
<xpath expr="//world[1]" position="replace">
<world/>
</xpath>
</view>
```

Before this commit, the resulting xpath branding of the nodes
(useful for web_editor, to know where it is supposed to anchor new elements)
was incorrect. Note that there is the branding attr data-oe-view_id which specifies in which view they are

The 2nd and 3rd world in view #1 were numbered respectively world[1] and world[2]
which is incorrect since we *know* those should be world[2] and world[3]
(in their own view, i.e. in view #1)
This was because when replacing the node, the code lost track of what it replaced
and that it attributed the inheriting branding to the replacing nodes

After this commit, the 2nd and 3rd world nodes are numbered
world[2] and world[3] respectively

OPW 2007312

closes odoo/odoo#35134

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-01 11:25:27 +00:00
Goffin Simon 7b1a894573 [FIX] hr: Multi company issue with hr.employee
Steps to reproduce the bug:
- Set your user in multi company
- Create two companies C1 and C2 where C2 is a child of C1
- Create a job position JP in company C2
- Create an employee E in company C2
- Log in company C1
- Try to archive E

Bug:

An access error was raised due to ir.rule "Job multi company rule" saying that
you can only see the job position in your company or in your company's childs.

The same logic must be applied for the hr.employee to avoid access rights error
in multi company.

opw:2044018

closes odoo/odoo#35370

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-08-01 09:23:36 +00:00
Jorge Pinna Puissant df58958631 [FIX] account: tax journal item's label in reconciliation
-- Create a new bank statement;
-- Add a transaction;
-- Reconcile;
-- Create a write-off with tax.

Before this commit, the tax journal item's label only contains the name
of the tax.

Now, the tax journal item's label contains the write-off label and the
tax's name. This is the same behaviour as it was in version 11
(https://github.com/odoo/odoo/blob/11.0/addons/account/models/account_move.py#L1259).

opw-2025480

closes odoo/odoo#35348

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-08-01 06:11:02 +00:00
karol1985 433d01972d [FIX] mail: use correct translation method
_() is in python
_t() is for javascript

closes odoo/odoo#35329

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-01 06:25:26 +00:00
Thibault Delavallée 1d6a8b7e84 [REF] account, mail: Revert "[FIX] mail,account: use reply_to header from tmplt"
This reverts commit 7273719b88.

Reply to header of templates should be used only for mass mailing purpose.
It is a known limitation and should not be changed in table without more
in-depth testing.

closes odoo/odoo#35354

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-31 15:20:25 +00:00
Nicolas Lempereur 32976c7f49 [FIX] account: simplify report implem. for studio
If in web_studio we:

- duplicate "Invoices" report
- delete "Invoices" report

The duplication will not work anymore, since the report class
report.account.report_invoice_with_payments is shared but requires
account.report_invoice_with_payments (original report).

With this changeset, we forgo checking model type of report since it
should always be account.invoice anyway.

opw-2045435
closes #35349

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-31 14:05:55 +00:00
karol1985 4f90ce5f23 [CLA] signature for karol1985
closes odoo/odoo#35316

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-31 08:18:16 +00:00
Naglis Jonaitis b5dce1692d [FIX] website_crm_partner_assign: typo in HTML attribute name
closes odoo/odoo#35238

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-27 23:50:09 +00:00
Nans Lefebvre b4e9b680ec [FIX] purchase_stock: default to the correct company in new PO
When the scheduler needs to create a new PO to resupply a product,
it tries to use the 'supplier currency' on the vendor if set,
and defaulted to the currency of the current user's company.
However the scheduler is run in sudo, so the user is OdooBot,
which means that the currency is incorrect if OdooBot is in another company.
The company that should be used is the one that is used everywhere else.

opw 2041798

closes odoo/odoo#35285

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-30 08:34:48 +00:00
Naglis Jonaitis bec8bf35d3 [FIX] digest: typo in HTML element name
closes odoo/odoo#35237

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-27 16:06:25 +00:00
Jorge Pinna Puissant f45564ae94 [FIX] hr_holidays: compute duration in leave's import
Before this commit, the duration (days/hours of the leave) wasn't
compute when importing leaves.

opw-1916913

closes odoo/odoo#35167

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-25 07:42:30 +00:00
Jorge Pinna Puissant fd7ce4c983 [FIX] hr_holidays: Disable emails when importing from file
When using the "test import" feature to import leaves request
allocations, odoo fails with a 500 error and no error message.

The only difference with an actual import is that the test dry-runs by
roll-backing. The issue here are that mails are sent *after* a commit
is done hence crashes because they do not exist any more.

Fine-tuning of c7b6fcb9f2 for
hr.leave.allocation

opw-2041872

closes odoo/odoo#35166

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-25 07:33:12 +00:00
Lucas Perais (lpe) 1a7d4ec378 [FIX] account: invoice default tax separate purch/sale
Unset the default sale tax on the company
Make a customer invoice
Add a line

Before this commit, the tax on the line was the purchase tax
because of a funky "if"

After this commit, no tax is set on the line

It is worth noting that archiving taxes shouldn't affect this flow
as it is the user's reponsibility to di his set up correctly

OPW 2043477

closes odoo/odoo#35271

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-29 15:20:48 +00:00
Goffin Simon 1aaf1da72c [FIX] mrp: Impossible to close MO
In some cases, when changing in the inventory setting from tracking lots and
serial numbers to not tracking, an issue could occur when trying to close the
MO with processed work orders and lots.

opw:2040752

closes odoo/odoo#35250

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-29 09:04:11 +00:00
Romain Derie a93e64e4a3 [FIX] website_sale: add tests for previous fix in lower version
In saas-14, 36fdb2ff49 was recently added to fix the flow where an empty
pricelist code being submitted in the cart input should reset the pricelist.

But we waited 12.0 to add an easy test, as we have `MockRequest` to easily
mock and simulate frontend context to test controller in python tests, see
6ebcb1db80.

Following #34711

closes odoo/odoo#35253

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-29 10:04:18 +00:00
Lucas Perais (lpe) 701fd43f6d [FIX] point_of_sale: order total round globally
Before this commit, the amount total of an order in round_globally
was simply the sum of all taxes amounts, then rounded
This is plain wrong, as the accepted semantics of round globally is that:
- each tax for each line is computed without rounding
- then each taxes is summed across all order lines
- then that amount is rounded
- then all those rounded tax amount are summed together

After this commit, this semantics is implemented

closes odoo/odoo#35211

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-26 11:44:31 +00:00
jem-odoo 4412389732 [FIX] project: useless field fetched
Since f98470e6cf, the 'user_email' field on project.task is
'related_sudo=False', checking access rights when fetching the field. For performance issue,
we need to keep this fix (as badly explain in commit above).
But, this causes multi company problem. Here are the steps to reproduce:
1/ User 1 (in company A) creates a task in a project (all in company A)
2/ user 1 switches to company B
3/ user 2 (in company A) tries to access the task and get an error, as it tries to access
a field 'email' of 'res.users' as himself (not 'sudo'), but the user is in a company that
user B can not access, hence the error.
The fix is quite simple here, as the problematic field is not used in the kanban view. It
does not solve the source problem, but the user is not blocked anymore.

opw-2041982

closes odoo/odoo#35243

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-26 14:11:47 +00:00
Odoo Translation Bot 4909e87cd4 [I18N] Update translation terms from Transifex 2019-07-28 01:20:11 +02:00
Romain Derie bdc76207ca [FIX] website: fix primary inherit view validation when tree is COW'd
Before this commit, it was not possible to install website_forum if the 'Main
Frontent Layout' had been COW'd.

When loading Forum Layout view which is a primary child view, it would crash
during view validation, not finding the element to xpath.

Triggering COW instead of copying fix the issue.

opw-2036119

closes odoo/odoo#35138

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-26 14:20:27 +00:00
Julien Castiaux df7dfbfdf3 [FIX] mail: scrollbar for emoji
Open discuss on mobile phone, click on the smiley icon, not all smileys
are visible on screen.

opw-2030315

closes odoo/odoo#35146

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-24 13:43:03 +00:00
Julien Castiaux ebb61753bf [FIX] website: Flip arrows on carousel in RTL
Enable the rtlcss library, translate the website into arabic, add a
carousel. The previous left appears right on the screen and the next
right arrow on the left.

This fix is to invert the two value (left arrow/right arrow) when the
screen in RTL-ed.

rtlcss documentation is available at:
https://rtlcss.com/learn/usage-guide/value-directives/#tip

opw-2041898

closes odoo/odoo#35220

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-26 12:48:27 +00:00
Jorge Pinna Puissant a53c1be0f3 [FIX] base, crm: placeholder for website
Before this commit, the placeholder for the website was incorrect, it
missed the protocol. This could lead to a confusion to the user who
could add a website without protocol. A website without protocol will be
open in the browser as a page of the same website and not as an
independent website.

Now, the placeholders have the correct protocol.

opw-2042816

closes odoo/odoo#35217

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-26 11:54:21 +00:00
Fanny He d01f3865b5 [FIX] mail: allow to notify a user currently in another company
In particular, the problem forbids a user to lower quantities on a SO
if the responsible is currently in another company.

- Install sale_stock and sale
- Activate Multi-companies
- Create Company A and Company B
- Admin in A and B
- Other user U (e.g. duplicate of Admin) in B only
- U creates a SO with a product, confirms it
- Admin connects to Company A
- U decreases product_uom_qty in a line
- U gets an AccessError

When decreasing the quantity, in sale_stock,
_log_decrease_ordered_quantity is called and calls stock's _log_activity,
that needs access to the responsible or the superuser's partner.
If that user is in another company, this raises an AccessError.

Because it is when accessing the partner that the AccessError is raised,
we cannot cleanly use a check_access_rule to determine when to use sudo.

OPW 2036879

closes odoo/odoo#35132

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-24 15:18:26 +00:00
Pratima GuptaandSébastien Theys cc32b7d1b3 [IMP] portal: allow user with token to see attachments
Spec
====

Before this commit if a user has access to a document thanks to an access_token,
he would already be able to see the chatter for the document, but he would not
be able to download the attachments that are shown to him on that same chatter.

The goal of this commit it to let the user download those attachments. This
makes sense especially since messages publicly posted in the chatter might
generate emails to the user, and the attachments will already be attached to
those emails, so this PR is not actually granting access to more information to
the user in a typical flow.

The only difference is when said user was added as a follower after the
attachments have been posted in which case he will be able to read them even
though he didn't get the original emails, but this is consistent with how he
will also be able to read the existing messages even though he didn't get them
by email.

Technical
=========

To solve this issue we could have used the access_token of the main document,
but this would allow any user with the token to access all attachments of the
document, including those he should potentially not be able to see such as those
from internal notes.

Instead we ensure a different access_token is properly set on each of the
attachments that are going to be shown and we update their links accordingly.

This allows for a more granular access control, and it also takes advantage of
the existing /web/content route without having to adapt it.

opw-2040455
Also discussed in task-37264

closes #34384

closes odoo/odoo#35121

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>


Co-authored-by: Pratima Gupta <pgu@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-07-24 08:40:37 +00:00
Simon Lejeune 7f54a246b7 [ADD] stock_account: test avco and inventory loss with company
opw-2027859

closes odoo/odoo#34912

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-16 11:52:30 +00:00
Jorge Pinna Puissant 07b8eff60f [FIX] mrp: recursive bom with different quantities
Backport from 12 to saas-11.3 (original commit : 97b44806f5)

Having 4 products and 3 BoMs:
BoM 1:
product = Finished
quantity = 100 units
- Semi-Finished 10 units

BoM 2:
product = Semi-Finished
quantity = 10 units
- Assembly 10 units

BoM 3:
product = Assembly
quantity = 10 units
- Raw Material 10 units (product.product 5$/unit)

Before this commit, the price for 100 units of Finished product was
500$, which is wrong. The price was calculated using 100 units of
Semi-Finished product and not 10 units as it should be.

Now, the price is 50$

opw-1973347

closes odoo/odoo#33115

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>

closes odoo/odoo#34900

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-16 11:51:57 +00:00
Simon Lejeune 0f57f0705a [FIX] stock: qty_available at date company owned
should take into account inventory/production location with companies

used in avco/standard at date

followup of rev 67ea26460f

opw-2027859
2019-07-16 11:48:12 +00:00
Simon Lejeune a2c60263fc [FIX] stock_account: production location with a company
Complete rev 67ea26460f

opw-2027859
2019-07-16 09:27:35 +00:00
Lucas Perais (lpe) b426b2f023 [FIX] account: invoice context from payment smart button is correct
Register a payment on a vendor bill.
From the menu Account > Purchase > Payment, clik to see that payment
click on the smart button to see the invoices
Create a new Bill

Before this commit, the default type and journal of the new bill were actually the ones of a customer invoice

After this commit, those defaults are the ones of a vendor bill

OPW 2038786

closes odoo/odoo#34967

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-18 07:59:46 +00:00
Dhawal Limbuwala 1ae356146c [IMP] doc: add some documentation of the attributes operation
closes odoo/odoo#20818

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-07-18 06:59:42 +00:00
Lucas Perais (lpe) e342f1ae84 [FIX] account_payment: portal payment invoice right partner
Activate option to pay invoice on the portal
Activate an acquirer with the mode: handle payments in Odoo

Make an invoice for a partner
Access that invoice through the route with the access_token
You should not be logged in !

Try to pay, with stripe for example

Before this commit, there was a cryptic error syaing that the credit card ID was invalid
This was because the transaction token was created on the public user
While we tried to access it as the invoice's partner

After this commit, there is no error as the transaction token is on the invoice's partner

OPW 2034691

closes odoo/odoo#34919

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-16 14:48:50 +00:00
Damien Bouvy f7b6d3b0b8 [FIX] payment_authorize: md5 to sha512 compat
This commit extends the changes introduced by 88de93114 to adapt
Odoo payment flows to the switch in transaction signature done
by Authorize.net.

The initial fix was not sufficient for flows that mixed redirection
payment flows and server-to-server flows (e.g. paying a quote with a
card that gets saved then using the token to pay for a subscription).

The problem comes from the fact that the server-to-server API uses
the API Transaction Key and API Login ID as credentials to authenticate
requests; there is no need for a signature since this data is never
publicly exposed on the website and a MITM is mitigated by the fact
that it would need to be done between the Odoo server and the
Authorize.net servers (both of which use https in a normal deployment)
which is admitedly more complex than doing a MITM on a Starbucks wifi.

On the other hand, the 'redirection' flow will include all transaction
parameters as inputs in an html form, therefore the signature is
required to ensure that the values have not been modified by a website
user or a mitm.

Since both flows can coexist on the same configuration, we cannot use
the same field depending on the payment flow configuration - we need
both fields to be stored for the provider.

This commit therefore has to introduce new fields on payment.acquirer
record that can store the signature key for authorize in addition to the
usual authorize fields. Instead of adding a new module, this commit uses
non-stored computed fields that will generate System Parameters entries
for any acquirer of the 'authorize' kind when set through the interface.

closes odoo/odoo#34670

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 05:25:09 +00:00
Lucas Perais (lpe) 565cb99ec0 [FIX] l10n_be_intrastat: weight must be > 0.01
Fine tuning of 06d149a3b1
It appears that according to
https://www.nbb.be/doc/dq/f_pdf_ex/nieuwsbriefintrastat_n28_2018_fr.pdf
minimum weight  is 0.01, and that anything below should be rounded to 0.01

OPW 2031682

closes odoo/odoo#34951

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-17 14:03:40 +00:00
Nicolas Lempereur 1a62c2ed47 [FIX] fleet: recurring cost => required expiration
If "Recurring Cost Amount" is set on a frequency and the date field
"Contract Expiration Date" is not set, the configuration makes no sense
since we would have an infinite cost, and infinite fleet.vehicle.cost
records and so on which is not possible.

With this changeset, the expiration will be required if there is a
recurring cost set.

opw-2036071
closes #34883

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-15 14:49:38 +00:00
Julien Castiaux 30b9a590fc [FIX] website_sale: reuse category on attr change
Enable "eCommerce Categories" in the website shop customize menu, select
a category, sort by catalog price, filter on an attribute, the category
is lost.

When you sort the records, the url changes from `shop/category/x` to
`shop?category=x`. As the attribute form is a plain get action, the
elements from the query string are lost.

We include the category in an hidden input so it is used by the get.

opw-2032477

closes #34603

closes odoo/odoo#34877

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-15 14:08:09 +00:00
Martin Trigaux d8072d54ac [MERGE] Forward port of 11.0 to saas-11.3 up to d5dd136ba0
closes odoo/odoo#34872

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 13:32:07 +00:00
Martin Trigaux d5dd136ba0 [MERGE] Forward port of saas-15 to 11.0 up to 1d9f64c91e
closes odoo/odoo#34868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 11:56:22 +00:00
Martin Trigaux 1d9f64c91e [MERGE] Forward port of saas-14 to saas-15 up to 5d4c30cb59 2019-07-15 13:15:12 +02:00
Martin Trigaux 5d4c30cb59 [MERGE] Forward port of 10.0 to saas-14 up to bb712ad701 2019-07-15 13:10:00 +02:00
Olivier Colson cfe2ee9341 [FIX] l10n_do: use the right sign on every tax tags
Some signs had been inverted when converting from 12.2 to 12.3 model.

closes odoo/odoo#34817

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-07-12 09:10:30 +00:00
Olivier Colson 9a09388618 [FIX] l10n_et: fix tags of some taxes (for consistency with 12.2 reports)
closes odoo/odoo#34829

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-07-12 11:24:14 +00:00
Mathieu Duckerts-Antoine 3184059071 [FIX] web: no forced date matching in pie charts
In a graph view in mode 'pie', a matching of dates was
attempted each time a comparison and a grouping of data
using the same date/datetime field was done.
Unfortunately, since the read groups results are ordered using
the order of groupbys, the matching was not sensible in case
the date/datetime field was not the first groupby.
We thus restrict the matching to the sole case where it is
sensible. More work should be done to have sensible matchings
in all situations.

closes odoo/odoo#34379

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-16 07:55:04 +00:00
Mathieu Duckerts-Antoine 6ef6881a12 [FIX] web: style chart elements in graph views only locally
The elements style was set globally and thus used to modify
the style of any chart in Odoo after the first loading of a
graph view. For instance, the charts drawn in
sale_subscription_dashboard are not the same before and after
the first loading of a graph view. This is fixed by this
commit.
2019-07-16 07:55:04 +00:00
Mathieu Duckerts-Antoine a87cbcadbc [FIX] web: appropriate symbol in mobile embedded graph view groupby menu 2019-07-16 07:55:04 +00:00
Thomas Werland 150bd2b948 [FIX] web: fix Groupby menu style in embedded graph views 2019-07-16 07:55:04 +00:00
Vincent Schippefilt ba1f4dc381 [FIX] web: fix error when image field can't load image
when image field cannot load an image, it will default to the placeholder image.
If this placeholder image also cannot be loaded it was creating an infinite loop errors

After this commit, we only show one error if the original image cannot be downloaded
and if the placeholder cannot be downloaded, we don't show anything else.

closes odoo/odoo#35226

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-29 09:24:18 +00:00
Odoo Translation Bot 56f74a63be [I18N] Update translation terms from Transifex 2019-07-28 06:08:27 +02:00