Commit Graph
124579 Commits
Author SHA1 Message Date
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
Cas Vissers 467ac9843d [FIX] hr_holidays: fix leaves count domain
In active leave types should not be considered.

closes odoo/odoo#34475

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-01 09:04:37 +00:00
Nicolas Lempereur 53ef25284f [FIX] web_editor: enter at A edge no dup link
In the editor, when you write a letter at the end or beginning of a link
it is written outside the link. But if you press "Enter", we get on a
newline with an empty link duplicated on the new line.

This is caused by the custom code handling "Enter" keypress.

With this changeset, in this situation we place the range just before
the beginning or after the end of a link.

opw-1724606
opw-2042097
closes #35188

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-26 08:33:27 +00:00
Moisés López 30a9120346 [FIX] l10n_mx: Set 'reconcile=True' for stock_account
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:

```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```

closes odoo/odoo#34463

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-07-01 00:58:51 +00:00
Nans Lefebvre f97b766013 [FIX] mrp: update MO quantity when there are more than one move per line
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].

opw 2042099

closes odoo/odoo#35206

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-26 08:28:17 +00:00
Baskhuu Lodoikhuu c9a061b9c0 [FIX] l10n_mn: update author
As the Mongolia localisation was written by BumanIT

closes odoo/odoo#34671

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-25 14:26:16 +00:00
Jorge Pinna Puissant 44e8fd3b18 [FIX] sale: price_unit in portal decimal precision
Before this commit, the unit price in the so's portal, had the same
decimal precision as the currency and not the one specified for the unit
prices.

Now, the portal shows the unit prices with their specific decimal
precision.

related to : a1e6a0f0c5

opw-2042089

closes odoo/odoo#35171

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-25 09:19:14 +00:00
Nans Lefebvre c7beb9994f [FIX] stock: raise a warning if the user deactivates 'lot & serial numbers' settings while products use it
The "lots & serial numbers" feature can be deactivated at any point.
If there are active products that are tracked, either by lot or serial number,
it can be confusing since deactivating it will hide the relevant fields.
Therefore we raise a warning at onchange if there are tracked active products.

opw 2036173

closes odoo/odoo#35108

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-25 14:29:45 +00:00
Christophe Simonis b82df99d7a [MERGE] forward port branch saas-11.3 up to 5f419d4ad3 2019-07-25 18:38:32 +02:00
Christophe Simonis 7702d07d39 [FIX] base: force user's group view update when deleting a module category
On the users' view, groups are shown grouped by application (module category).
Deleting a module category should, therefore, regenerate the view.

closes odoo/odoo#35181

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-25 14:21:53 +00:00
Christophe Simonis 5f419d4ad3 [MERGE] forward port branch 11.0 up to f2f24381f2 2019-07-25 16:12:08 +02:00
Christophe Simonis f2f24381f2 [MERGE] forward port branch saas-15 up to d649cab7b9 2019-07-25 11:43:19 +02:00
Christophe Simonis d649cab7b9 [MERGE] forward port branch saas-14 up to 39de3797f8 2019-07-25 11:42:01 +02:00
Christophe Simonis 39de3797f8 [MERGE] forward port branch 10.0 up to cb3bf5509f 2019-07-25 11:41:33 +02:00
Nans Lefebvre 7b22be4814 [FIX] account: restore standard composer behaviour when sending unique mails
Fine-tuning of commit 5621ae3d6b.
While it focused on fixing the 'mass_mail' mode,
it forgot to keep the correct behaviour for the case where only one mail is sent.
In the latter case, it is typical to overwrite the template values, especially
for the body, before sending the mail.
In that case, applying the onchange on the templates overwrites the user input.

Note that in the case where the template is undefined it would set the composer
values to empty ones; while standard use would not allow in mass mail to both
send content and have no template, it could be done via a customisation.

opw 2041631

closes odoo/odoo#35164

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-25 06:13:59 +00:00
Romain Derie 6a59224055 [FIX] web_editor, website: avoid returning children of inactive view
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `get_related_views()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.

Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived

closes odoo/odoo#35154

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 15:38:42 +00:00
Arnold Moyaux c8754185d1 [FIX] stock: MTO overprocessed move
Error due to other module (e.g. purchase_stock, mrp) that will
define their own rules in order to merge or not moves together.
Usecase:
- Install purchase_stock
- Create a product MTO + buy with a vendor
- Create a SO of 1 unit
- On the PO receive 2 units
- On the delivery deliver 2 units

It will create an empty delivery and put the entire move in
a back order.

First issue the extra move is created as a MTO if it's copied from an
MTO move. So il will trigger all the pull rule. We won't it because it's
an extra quantity and the rules should be only trigger by the original
document (SO/MO).
Also an extra move in a picking do the hypothesis that the original move and
the extra move will always be merged together. But in the previous
usecase, the module purchase add the condition that 'created_purchase_line_id'
and 'purchase_line_id' should be the same in order to merge move.
'created_purchase_line_id' is also copy=False, so the move and the
extra move will not be merged. create_extra_move only returns the extra
move and _action_done only process the moves returned by _create_extra_move.
It result by an original move not merged and not processed by _action_done,
it will be automaticaly set in a back order and the extra move is
processed.

In order to fix it, check if the move and the original move will be
merged. If not, returns both moves.

opw-2008113
Close #34005

closes odoo/odoo#34411

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-25 07:41:58 +00:00
David Dufresne 5b80695fc6 [CLA] signature for ddufresne
closes odoo/odoo#35079

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-25 07:32:06 +00:00
Romain Derie cb3bf5509f [FIX] web_editor, website: avoid returning children of inactive view
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `customize_template_get()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.

Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived

Test writen in 12.0 with #35154

closes odoo/odoo#35155

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 15:19:26 +00:00
Christophe Simonis e4a4b5a8f0 [MERGE] forward port branch 11.0 up to 0375c0174d 2019-07-24 16:04:59 +02:00
Christophe Simonis 0375c0174d [MERGE] forward port branch saas-15 up to fc80a9dae3 2019-07-24 15:06:16 +02:00
Goffin Simon ffe58a56bf [FIX] purchase: Saving PO with a foreign currency
Steps to reproduce the bug:
- Create a company C with currency = USD
- Create a vendor V with a supplier currency = EUR
- Create a PO for V with one line, the default currency is EUR
- Save

Bug:

The currency of the PO was USD when saving because the field currency is
in readonly when the state is draft.

opw:2035640

closes odoo/odoo#35144

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-24 12:48:06 +00:00
Christophe Simonis fc80a9dae3 [MERGE] forward port branch saas-14 up to 36fdb2ff49 2019-07-24 14:01:48 +02:00
Jairo Llopis 21ede5365a [FIX] website: Delete redirections if website is deleted
Before this patch, if a website is deleted, its redirections will stay, affecting other websites.

Now, website-specific redirections will disappear along with their corresponding website.

closes odoo/odoo#35130

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-24 10:16:43 +00:00
Romain Derie 36fdb2ff49 [FIX] website_sale: restore possibility to remove promo code pricelist
Since 5c9cea4ee7, it was not possible to remove an applied promo code
pricelist by adding an empty promo code on checkout (eg removing the one shown
in the promo code input).

Indeed, when sending an empty promo code, the `search()` done in the controller
would not find any pricelist as promo would be en empty string. For the rest,
check code on mentionned commit.

See `sale_get_order()` method docstring about `code` param: "If empty, it's a
special case to reset the pricelist with the first available else the default.".

Fixes #34633
2019-07-24 11:31:57 +02:00
Julien Castiaux ceeb5b51d5 [FIX] mail: form activity widget: do not close activity popover on click
Create an activity in a chatter, mark it as done, click inside the
textarea, the popover is automatically closed.

The `click` trigger both opens and closes the popover on click.

opw-2028399

closes odoo/odoo#34982

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-22 15:08:15 +00:00