Commit Graph
124140 Commits
Author SHA1 Message Date
Nicolas Martinelli fea84b5757 [FIX] sale_timesheet: multiple lines create new project
- Create 2 products A & B set as:
Service Invoicing Policy: Milestones (manually set quantities on order)
Service Tracking: Create a new project but no task
- Create a SO with A & B, validate
- Set a delivered quantity for both products
- Go to the project overview

Only the delivered quantity of a single SO line is retrieved in the 'To
invoice'.

It occurs because only a single SO line is linked to the project, while
both are expected to be linked to it.

opw-2003097

closes odoo/odoo#33815

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-04 06:02:24 +00:00
Romain Derie 0e403f8d8a [FIX] website_sale_delivery: restore monetary widget
In Odoo 11.0, fb5015d5fc fixed some flows related to prices. By doing that,
the `t-options` dict was set on a variable to avoid code duplication.

But starting from Odoo 12.0, setting a variable on `t-options` attribute seems
to do nothing and is ignored.

This commit fix it by setting the price rather than the options on a variable.

Fixes #33451

closes odoo/odoo#33900

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-05 10:10:37 +00:00
Jorge Pinna Puissant 3cbdfe8807 [FIX] crm: change team with the default one
- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.

Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.

opw-2005924

closes odoo/odoo#33898

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-05 09:24:58 +00:00
Goffin Simon 46d0b461cd [FIX] point_of_sale: Initial balance of a new statement in the POS
Steps to reproduce the bug:
- Create a new Bank Account A available in the POS
- Set A as a payment method in the pos.config
- Create a new session and sell a product P for 100€
- Make the payment with A
- Close the session and validate the entries
- Check that a new statement in A has been created with a starting
balance = 0€ and an ending balance = 100€
- Create a new session and close the session

Bug:

A new statement for A had been created with a starting balance = 0€
instead of 100€ (the ending balance of the previous session)

opw:1981984

closes odoo/odoo#33868

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-04 11:10:51 +00:00
Bohdan Lisnenko bd3a788479 [FIX] http_routing: slugify_lib - max_length param should be int
closes odoo/odoo#33858

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 10:53:17 +00:00
Nans Lefebvre 77da958be6 [FIX] account_invoice_report: fix group by product
Group by invoice, products: the untaxed total is correct,
while the (taxed) total is the sum of the lines divided by the number of lines.

On account.invoice.line, there is a price_subtotal_signed, which is the
price_subtotal (untaxed) in the company currency.
Unfortunately price_total_signed does not exist for price_total (untaxed).

As a result, we need to use the price_total on the invoice line,
and divide by the currency rate.
Unfortunately we cannot do it in the subquery because of the scope of the rate.

opw 2003185

closes odoo/odoo#33802

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-04 06:00:08 +00:00
Nicolas Martinelli 16f9375dab [FIX] website: website-specific child views
On a eCommerce page were there was no SEO optimization change:
- Customize > Activate "eCommerce categories"
- Customize > Activate "Colapsible category list"
- Promote > Optimize SEO > Change description > Save

Nothing happens.

Actually, an SQL error is raised because of the `ondelete='restrict'`
set at:

https://github.com/odoo/odoo/blob/897feb553e6ef75af9434cb77436b26abde3a761/odoo/addons/base/models/ir_ui_view.py#L212

In this case, we have the following structure:

```
View 1
|
---> View 2 (Website-specific)
|
---> View 3 (Website-specific)
```

For example:

```
Products
|
---> eCommerce Categories (Website-specific)
|
---> Collapsible Category List (Website-specific)
```

Since the inherited view (View 2) is website-specific, we duplicate it
and try to unlink it. However, this view has children, which raises the
error.

To solve the issue, we re-attach the children of the inherited view to
its copy. In a realistic situation, the children of a website-specific
view should also be website-specific, so there is no need to apply the
'copy or re-attach' logic recursively.

We end up with:

```
View 1 (Website-specific, duplicated)
|
---> View 2 (Website-specific, duplicated)
|
---> View 3 (Website-specific)
```

opw-1997946

closes odoo/odoo#33787

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-04 08:30:08 +00:00
Nicolas Lempereur 7ff8eb0c15 [FIX] website_event: page edit intent more clear
The bottom of event is shared between all event page and all events.

This is especially misleading when "website menu" with
website_event_track is activated on the event, then we will have several
pages such as "Introduction" / "Location" and depending on if we drop a
widget some pixel too high or two low, it will be only on the current
page or on all events.

With this changeset, when editing there is an information block saying
what part is on all page.

opw-2002163
closes #33857

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-04 07:43:14 +00:00
Pierre Rousseau 743434cb2e [FIX] snailmail: send the contact_address
Before this commit, the param contact_address was not sent to the service. However, the service need it to correctly send the letter if the format is wrong.

OPW-1981168

closes odoo/odoo#33855

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-06-04 07:03:36 +00:00
Lucas Perais (lpe) 7be17b739b [FIX] sale: color_field for analytic account should be in list
Have the group analytic tags ON
Have the order.line o2m list non editable
Make a SO, make a line with a tag
Confirm the SO

Click on the line
in the modal, click on the analytic tag

Before this commit, there was a traceback because the color was never fetched
This was because the o2m list view did not fetch the color_field

After this commit, there is no traceback, and displaying
as well as changing the color works as expected

OPW 2002456

closes odoo/odoo#33846

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-06-03 14:21:35 +00:00
Goffin Simon 74706e9e03 [FIX]payment_paypal: wrong fees computation
Steps to reproduce the bug:
- Create a product P with price=100€
- Configure payment aquier Paypal with fees_int_fixed = 1€ and fees_int_var = 1%
- Set Paypal to be available in the website
- Go to the web shop and add P in the cart
- Choose to pay with Paypal

Bug:

The amout to pay was 102.02€ instead of 102.01€

Before the fix, the fees was computed as followed:

fees = (percentage / 100.0 * amount + fixed) / (1 - percentage / 100.0)
Where fees_dom_fixed = fixed and fees_int_var = percentage

With this computation, the percentage was applied twice.
If for example, we had fixed = 0 then

fees = (percentage / 100.0 * amount) / (1 - percentage / 100.0)

In this case, it's easy to see that the percentage is applied twice.

opw:1981784

closes odoo/odoo#33830

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-04 07:24:34 +00:00
Nicolas Martinelli 4cdcab43ee [FIX] mrp: no qty consumed
- Create a MO for '[FURN_8855] Drawer'
- Consume 1 unit of '[FURN_2100] Drawer Black', but DO NOT consume
anything for '[FURN_5623] Drawer Case Black'.
- Complete the MO, then Unlock it
- Edit the '[FURN_5623] Drawer Case Black' line

It is not possible to add a line.

This is expected from 9e77ce2edc, but we still want to be able
to consume some quantity.

Instead of canceling the move lines without any quantity consumed, we
set it to done.

opw-1986919

closes odoo/odoo#33820

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-03 11:45:00 +00:00
Nans Lefebvre 9b26052c54 [FIX] sales_team: fix team pipeline kanban overflows
In the kanban views, cards have a fixed size (here it is overriden as 450px).
All internal elements use col-x Bootstrap classes, with have flex 0 0 x/12.
Note that 0 0 correspond to flex-grow and flex-shrink, so the sizes are fixed.
It follows that any long translation or number will overflow badly.
Hover this overflow is, in terms of usability, less worse hiding the overflow
or even  scrollbars.

So nothing is flexy, but too avoid this issue as much as possible,
we give more space to the right side, since the left side only shows a button.

opw 2001951

closes odoo/odoo#33818

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-03 08:43:22 +00:00
Nicolas Martinelli b8115cc4c6 [FIX] purchase: incorrect attribute
When the `purchase.order` is added as an embedded tree view on a model
without a `state` field, a crash occurs.

The existing condition doesn't make sense on a PO (while it would make
sense on a PO line), so we simply remove it. Since the condition implied
that the field `invoice_status` was always hidden, we keep it that way.

opw-2005768

closes odoo/odoo#33827

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-03 11:06:21 +00:00
Artur Neumann 7c546f10b4 [CLA] Signature in behalf of JankariTech Pvt. Ltd.
closes odoo/odoo#33513

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-29 11:25:41 +00:00
Saugat Pachhai 9308180089 [ADD] website_sale_delivery: Add test for delivery 'free over'
This commit adds a tour for the condition where the delivery charges,
even though that was not added to the total charges, it was shown in the
delivery charges aside (even if the payment was over the amount where free
delivery was available). This adds a test that it should be "0.0" instead.

This was tested before the fix and after the fix.
2019-05-29 11:25:22 +00:00
Nicolas Martinelli 691dc424a1 [FIX] hr_expense, hr_holidays: default activity user
- Activate multi-company
- Create a company B
- Switch to company B
- Create an allocation request

An access error is raised.

Commit 7f775f0677 added a `sudo` call in order to prevent an access
error. However, it implies that the fallback value `self.env.user`
refers to the SUPERUSER, not the current user anymore. If the current
user is not in the same company than the SUPERUSER, the multi-company
record rules will be triggered.

The fallback is changed to an empty recordset, and selecting the current
user is done out of the method called with `sudo`.

opw-2003137

closes odoo/odoo#33804

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 15:06:08 +00:00
Nicolas Martinelli 9e77ce2edc [FIX] mrp: add line on canceled move
- Create a MO for '[FURN_8855] Drawer'
- Consume 1 unit of '[FURN_2100] Drawer Black', but DO NOT consume
anything for '[FURN_5623] Drawer Case Black'.
- Complete the MO, then Unlock it
- Edit the '[FURN_5623] Drawer Case Black' line to add one unit
consumed, save

The new stock move line is created as canceled.

It is created canceled since the corresponding stock move is canceled.

We should not be able to add a stock move line on a canceled stock move.

opw-1986919

closes odoo/odoo#33794

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 10:11:06 +00:00
Jorge Pinna Puissant d488432af6 [FIX] account: warning when sending invoice by email
Before this commit, when sending multiples invoices by email in batch,
if one of these invoices was for a customer without an email address,
these wasn't sent and the user didn't have any feedback about this.

Now, before the user send the emails a warning is shown with the list of
invoices that can't be sent by email.

opw-2002350

closes odoo/odoo#33753

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-29 12:34:02 +00:00
Odoo Translation Bot 28382b76d8 [I18N] Update translation terms from Transifex 2019-06-02 01:18:32 +02:00
Nicolas Lempereur 9e6f3abead [FIX] web_editor: image modal nochange close on save
When you open the image modal of the website editor the selected image
is the current image.

But if the image is not an attachment with an `url` field set (eg. it
has been uploaded and is not a file in a /static/ folder) the match
between image modal and current did not work and to close it we need to:

- actively select the current image then click "Save"
- use the X button to close the modal without saving

With this changeset, the match of current image with image list is done
on the attachment `url` and if unavailable with /web/image/ID/name.jpg
path which cover both possibilities.

opw-2004073
closes #33799

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-31 13:26:50 +00:00
Nicolas Martinelli 8f21148e1a [FIX] hr_contract: contract type name
Make the contract type name translatable.

opw-2003957

closes odoo/odoo#33781

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 05:41:25 +00:00
Toufik Ben Jaa 29762514ae [FIX] sale: singleton error when validating payments
- When validating a payment an "expected singleton" exception is
raised due to the fact that we are using a recordset with multiple
record instead of a recordset with a single record.

OPW-1981632

closes odoo/odoo#33767

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-29 16:16:18 +00:00
Nicolas Martinelli d92acc602c [FIX] event_sale: no currency
If the company is not set on the SO, the creation of a SO line crashes
because `currency` is empty.

opw-2005143

closes odoo/odoo#33783

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-31 06:36:55 +00:00
Nicolas Martinelli 5fccb75fde [FIX] account_analytic_default: default based on user
- Create an Analytic Distribution for:
Product A
Current user (e.g. Mitchell Admin)
- Sell the product in the POS, request an invoice

The analytic account defined is not used.

This is due to the invoice created as SUPERUSER.

We should first take into account the user on the invoice, then the
current user.

opw-2003935

closes odoo/odoo#33758

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 12:49:24 +00:00
Florent de Labarre 897feb553e [IMP] doc: add information about index attribute
closes odoo/odoo#32606

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-27 16:29:50 +00:00
Nathan de Pryck d71f2116d9 [FIX] account_voucher: unnecessary copy of payment memo
Before this commit, the payment memo was copied during the duplication
of a voucher. The issue is that the payment memo is not always shown in
the view, and it's mostly unique by voucher.

Now, the payment memo it's not copied anymore.

opw-1986544

closes odoo/odoo#33708

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-29 12:45:27 +00:00
Christophe Simonis 8d7ee39213 [MERGE] forward port branch saas-11.3 up to 8a0e819d0b 2019-05-29 14:06:12 +02:00
Christophe Simonis 8a0e819d0b [MERGE] forward port branch 11.0 up to 3e12f2ff56 2019-05-29 11:10:34 +02:00
Nans Lefebvre 3e12f2ff56 [FIX] mail: fix mail template onchange
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.

We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.

opw 2003197

closes odoo/odoo#33706

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-28 18:44:09 +00:00
Navarro Presas Moisés Alejandro 7ca0fe3c9f [CLA] Signature for AfroMonkey
closes odoo/odoo#32396

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-28 15:58:33 +00:00
Navarro Presas Moisés Alejandro f1d8691985 [FIX] sale_order: Set qty_delivered to 0 if not moves.
In `_compute_qty_delivered` function
Python `all` function returns `True` if list is empty; thast why check
if `moves` is not empty to set `qty_delivered` to `product_uom_qty`.
2019-05-28 15:58:33 +00:00
mreficent fa294d2059 [FIX] mail: correctly detect if model is a mail thread
closes odoo/odoo#31799

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 08:03:24 +00:00
Richard Mathot 76131748f9 [FIX] iap: avoid a crash when multiple accounts are found
Before the fix, if you had multiple accounts for a specific service, the
settings page was crashing.
(eg: for a service, you have one account specific to a company and
another account with no company set).

We now prefer accounts specific to the current company and tie-break on
the most recently created one

opw-2003744

closes odoo/odoo#33736

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-05-29 06:57:43 +00:00
Richard Mathot edf90bb1da [FIX] iap: allow admins to remove IAP accounts
opw-2003744
2019-05-29 06:49:55 +00:00
Nans Lefebvre c52b9dfc37 [FIX] mail: fix mail template onchange
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.

We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.

opw 2003197

closes odoo/odoo#33707

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-28 18:19:26 +00:00
Martin Trigaux 44d11fe777 [FIX] fields: inherit context_dependent from parent fields
If a field is inherited from another model, the attribute context_dependent
was not propagated correctly.

Example of bug:
>>> product = self.env['product.product'].search([], limit=1)
>>> product.name
'Whiteboard Pen'
>>> product.with_context(lang='fr_FR').name
'Whiteboard Pen'  # cache used
>>> template = product.product_tmpl_id
>>> template.name
'Whiteboard Pen'
>>> template.with_context(lang='fr_FR').name
'Marqueur pour Tableau Blanc'
>>> product._fields['name'].context_dependent
False
>>> template._fields['name'].context_dependent
True

Fixes odoo/odoo#33641
Closes odoo/odoo#33722

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-28 14:26:29 +00:00
Christophe Simonis 5adbaf827e [FIX] hr_expense: use defined variables
Oversight of previous forward-port.
2019-05-28 16:24:15 +02:00
Christophe Simonis cffd147cfd [MERGE] forward port branch 11.0 up to a20a31486c 2019-05-28 15:52:00 +02:00
Christophe Simonis a20a31486c [MERGE] forward port branch saas-15 up to cad0be27e7 2019-05-28 15:04:40 +02:00
Christophe Simonis cad0be27e7 [MERGE] forward port branch saas-14 up to 6b6d2c8455 2019-05-28 14:36:59 +02:00
Christophe Simonis 6b6d2c8455 [MERGE] forward port branch 10.0 up to 01020e18e9 2019-05-28 14:07:09 +02:00
Romain Derie e9350993ca [FIX] web: restore /apps/<app> controller
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.

closes odoo/odoo#33679

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-27 11:44:08 +00:00
Benoit Aimont 01020e18e9 [FIX] hr_expense: prepare method for move values
There was no way to inherit properly action_move_create method.

opw:1974069

closes odoo/odoo#33488

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 07:04:27 +00:00
Benoit Aimont c8b87f66f8 [CLA] Add Benoit Aimont in Acsone CCLA 2019-05-27 07:02:58 +00:00
Luis 0379c51be3 [FIX] web: refresh calendar if error
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.

We simply reload in all cases.

opw-2002186

closes odoo/odoo#33028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-24 10:45:48 +00:00
Julien Castiaux 042966ccae [IMP] web: better logging of errors
When an error is raised server-side, the complete traceback is displayed
in the JS console. This traceback can be very useful since it might
contain information not recorded anywhere else by default. For example,
access errors due to record rules or SQL constrains do not have their
traceback displayed in the UI or recorded in the log [1], but it is
logged in the JS console.

However, the information is logged in the JS console as a stringified
version of the `result.error` object. The final result is a long and
non-formatted string which is unreadable.

We replace by a new format more convenient for technical teams. The
error is now formatted as:

Error code
Error message
Error data message
Error data debug

This will hopefully give a better starting point for debugging purposes.

[1] SQL constrains tracebacks are only recorded in the log in debug
mode:

https://github.com/odoo/odoo/blob/ec792da72b92b22349b6f325e53fd37d953c7db3/odoo/service/model.py#L122

closes odoo/odoo#33650

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 06:41:56 +00:00
Nicolas Martinelli c868da4de6 [FIX] tools: export UTF-8 characters
- Install Babel 2.3.4 as specified in the `requirements.txt`
- In a Python file, do not add the line `# -*- coding: utf-8 -*-`
- Create a translatable string with a non-ASCII character, e.g.
`Amount in €`
- Export the translation

The exported term is incorrect: `Amount in â¬`.

Since the default encoding for Python 3 is UTF-8, it is logical for the
Babel extraction to use it as a default encoding.

The issue was solved in Babel 2.4.0 with commit:

https://github.com/python-babel/babel/commit/33a8fc40d417b401162e2d20021fcbebcc4ab7db

opw-1984480

closes odoo/odoo#33671

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 09:11:25 +00:00
Cas Vissers ccdaf9a085 [FIX] fleet: avoid singleton error
When doing a write on multiple records, message_post expects a single record
if self.ids:
self.ensure_one()

closes odoo/odoo#33645

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-27 09:00:41 +00:00
Raphael Collet f14ae73a98 [FIX] models: do less snapshots in onchange()
As snapshots are costly to compute, we now create exactly two snapshots:
one initial snapshot and one final snapshot.  All intermediate checks
are done with respect to the initial snapshot.

Note also that checks are costly for x2many fields.  Therefore, once a
field has changed, it will never be checked again.  This optimization is
correct since, by contract, the onchanges of a field are processed at
most once.  This guarantees the absence of cycles in onchange.

For instance, assume that field A modifies fields B and C, and that
field C modifies fields D, E and F:
- before: 7 snapshots (snapshot, process A, snapshot, process B,
snapshot, process C, snapshot, process D, snapshot, process E,
snapshot, process F, snapshot)
- after: 2 snapshots (snapshot, process A, process B, process C,
process D, process E, process F, snapshot)

closes odoo/odoo#31872

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-27 08:20:07 +00:00