Commit Graph
110026 Commits
Author SHA1 Message Date
Aaron Bohy e9de309511 [FIX] web: editable list: setRowMode returns a deferred
This function should return a deferred, as indicated in the
docstring. However, in some cases, it doesn't. It then crashed
as the FieldX2Many tries to call done() on undefined.

This happens for instance on the customer invoice form view:
create a new record, select a partner, add a line, select a
product, directly click on the invoice date field (this will
trigger an onchange which will totally override the value of the
one2many). The FielX2Many calls setRowMode to switch the edited
row back to readonly, but this row doesn't exist anymore as the
one2many value has been overriden by the onchange, so setRowMode
wrongly returns nothing, and it crashes.
2017-06-07 08:08:49 +02:00
Aaron Bohy 98142f731d [FIX] web: BasicModel: default_get: fetch x2manys of x2manys
Suppose that a default_get returns the value [[6, 0, [1]] for an
x2many field (i.e. put id 1 in the relation). A read is performed
to fetch record of the comodel whose id is 1. Suppose that there
is another x2many field of the comodel. This x2many has to be
fetched (if not empty), and processed by the BasicModel (i.e. a
dataPoint must be created for it) as well.

Before this rev., the second x2many wasn't fetched nor processed,
and it produced a traceback for example in Expenses app, when
clicking on 'Submit to manager' from an expense form view.
2017-06-07 08:08:49 +02:00
Christophe Simonis 6f3eada2c3 [MERGE] forward port branch saas-15 up to f687a27b79 2017-06-06 19:23:03 +02:00
Christophe Simonis f687a27b79 [MERGE] forward port branch saas-14 up to c0e7f9b0b1 2017-06-06 18:57:56 +02:00
Christophe Simonis c0e7f9b0b1 [MERGE] forward port branch 10.0 up to a85790be5c 2017-06-06 18:49:36 +02:00
Richard Mathot a85790be5c [FIX] stock_landed_cost: disable test with an invalid CoA
For now, these tests do not work with another CoA than the generic one.
Depending on your testing infrastructure, they may or may not pass.
We skip then invalid CoA's and plan to make them work in master.
2017-06-06 18:28:45 +02:00
Jérome Maes 7095cb5af5 [FIX] sale_timesheet: avoid currency rate based on demo data
On the 6 June, the rate from EUR to USD change
in demo data. This cause problem in test, when
comparing amount.

We choose to not used currency rate defined in
demo data and that are time-dependent.
2017-06-06 17:47:40 +02:00
Christophe Simonis 460cb3ba9e [MERGE] forward port branch saas-11 up to 7d7a45a921 2017-06-06 17:28:59 +02:00
Christophe Simonis 78d4202503 [FIX] tools.config: do not interpolate the config. 2017-06-06 16:55:13 +02:00
Olivier Dony e2e23142e9 [FIX] base_import_module: make low-level method private
The import_module() method does not need to be public,
so let's mark it private. It's not called by anyone
except import_zipfile().

After 76cd8d2558 it would
fail anyway because addons_path would not be prepared by
import_zipfile().
2017-06-06 16:32:37 +02:00
Christophe Matthieu 1b07daf2ed [FIX] calendar: can create an event with start_date as readonly
Before this fix, if the start field is readonly, the user could not create
an event. With this commit, it is also ensured that the context sends the
right default values to the view
2017-06-06 16:17:30 +02:00
Martin Trigaux ebc23b594a [FIX] web: display full error message
In case of a MemoryError, there is no error message, the user gets a
"Database restore error: "

without any details.

Instead fallback to the repr.

This way, a wrong password is
"Database restore error: Access denied"
and a memoryerror

"Database restore error: MemoryError()"

Closes #17393
2017-06-06 15:42:37 +02:00
Christophe Simonis 7d7a45a921 [MERGE] forward port branch 9.0 up to fffcfcc519 2017-06-06 15:18:52 +02:00
Christophe Simonis fffcfcc519 [MERGE] forward port branch saas-6 up to 8958bfe557 2017-06-06 13:40:34 +02:00
Denis Ledoux b43151c11c [FIX] product: pricelist item deterministic order
On a pricelist, if multiple rules were set with the same
set of rules condition, the choice of which rule/item
is used was random, according to the postgres database
state.

Adding the `id` in the order force to always use the same
rule/item (the first that was created).

opw-744865
2017-06-06 12:55:29 +02:00
Raphael Collet 1095744e7f [FIX] base_vat: invoke method on record as expected
OPW 744859
2017-06-06 12:22:01 +02:00
pka-odoo ab0bd7be25 [FIX] (hr_)gamification,sales_team: one2many with many2many widget
with the new views, we removed the many2many_kanban widget on many2manys, since it is the default behaviour anyway, but we also removed it for a few one2manys.  And this is a mistake, some one2manys have to behave like many2manys.

(PR #17190)
2017-06-06 11:33:31 +02:00
Nicolas Martinelli 75c803bbbd [FIX] account: create taxes at reconciliation
- Create an excluded tax of 20 %
- Create a customer invoice of 1000
- Create a payment of 900
- Make the matching between the invoice and the payment:
  Write-off of 83.33, with the 20 % tax

Error: 'Cannot create unbalanced journal entry'

After commit 89cbef8540, the tax are by default not created
automatically anymore. We should make sure to pass the context key
`apply_taxes`.

opw-744266
2017-06-06 10:49:28 +02:00
Denis Ledoux 175a5d7808 [FIX] sale: sales order email template without portal_sale
When disabling the customer portal
in the general settings
(or uninstalling the `portal_sale` module directly),
the model `sale.order` no longer has a method
`get_signup_url`, and it therefore leads
to the fail of the email template rendering which is
still referencing this method.

Besides, the `access_url` is actually used only if
`is_online` is True,
(see the `% if is_online:` few lines later)
and in this case `get_signup_url`
was not used at all.

Therefore, we can assume `None` is a good alternative,
as the resul of `get_signup_url` was actually no longer
used.

opw-710481
2017-06-06 10:30:18 +02:00
Denis Ledoux fef6694442 [FIX] product_margin: division by zero in case sum of quantities is 0
If you have two invoices with a same product,
 - one having 1 unit of a product,
 - the other -1 unit of a product,

The sum of these quantities will be 0, and it will lead
to a division by zero in the former sql request.

The nullif should be applied on the sum, not on the line quantity.

opw-745073
2017-06-06 10:18:33 +02:00
Damien Bouvy 18910e926f [FIX] website_portal_sale: let errors bubble when confirming a quote
This try except block was added in another era, where the piece of code
in the block was far less ambitious (and not for good reason since
adding a try except block because of a malformed mail template seems
overkill).

Even worse, this block actually prevented errors from bubbling, which
could have adverse effects.

Example: a long transaction confirmation (several seconds since it
implies S2S communication, invoice creating/validation, etc.) is
rollbacked because a mail message is recorded on the quote during
the processing time. The quote confirmation then crashes because of a
concurrent update error in postgres. This try except block does not
re-raise the error, which means that instead of retrying the operation
like the ORM would normally do, we have an incomplete traceback in the
system (since the error message crashes itself) and the transaction is
not validated (as far fetched as it may seem, this is in fact how this
bug was discovered).

This try-except block offers no gain in error logging (on the contrary,
since we have lost the initial error-causing statement) and prevent the
orm from correctly managing errors.

This commit removes it and let the orm handle the errors like a grown up
man; either crash for real (because it should crash to know if there's a
problem) or retry the transaction if it's a serialization issue.

opw-744629
2017-06-06 10:03:34 +02:00
Odoo Translation Bot 9ca236685d [I18N] Update translation terms from Transifex 2017-06-04 07:07:18 +02:00
Odoo Translation Bot 40f8a92d88 [I18N] Update translation terms from Transifex 2017-06-04 04:27:19 +02:00
Odoo Translation Bot c3e282852d [I18N] Update translation terms from Transifex 2017-06-04 00:28:17 +02:00
Olivier Dony 45336d7486 [FIX] tools: verify path before opening 2017-06-03 01:30:57 +02:00
Olivier Dony de38d0262b [MERGE] Forward-port 10.0 up to 76cd8d2558 2017-06-03 01:24:21 +02:00
Olivier Dony 711530e036 [MERGE] Forward-port 9.0 up to 98f5f1b888 2017-06-03 01:16:50 +02:00
Olivier Dony 8958bfe557 [MERGE] Forward-port 8.0 up to d18d606a55 2017-06-03 01:08:20 +02:00
Olivier Dony d18d606a55 [FIX] tools: verify path before opening 2017-06-02 22:29:47 +02:00
Olivier Dony 98f5f1b888 [FIX] tools: verify path before opening 2017-06-02 22:28:39 +02:00
Olivier Dony 76cd8d2558 [FIX] tools: verify path before opening 2017-06-02 22:13:36 +02:00
Дмитро Катюха 380f59bd16 [FIX] website_sale: filter products by attributes
The attribute filters based on all products matching current domain was limited
to the first page of result only.
If all the products of the current page had no variant, no filter was displayed.

Closes #17361
2017-06-02 16:59:36 +02:00
David Monjoie 2d26ed05a7 [FIX] web: fix handle widget functionality
Also added tests for handle in list view and inside an x2many.
2017-06-02 15:12:55 +02:00
David Monjoie 31f5819724 [FIX] web: fix mock server dropping x2many on update
Previously, when an update operation was performed, the list of
ids in the x2many field was emptied beforehand.

It kinda worked in lots of cases where one would expect it to
fail because in thoses cases the widgets send link_to commands
along with the update one, thus re-adding the removed line.

Now the behavior is more consistent accross the board. We start
with the current list of ids and apply the requested changes.
2017-06-02 15:12:43 +02:00
Nicolas Martinelli 3a826bb772 [FIX] point_of_sale: fix zoom
When the user zooms with the browser, the bottom left pads are
misaligned for some zoom levels.

By slightly reducing the width of the action pad, this can be solved for
all acceptable zoom levels.

opw-745074
2017-06-02 13:30:25 +02:00
Nicolas Martinelli 46c85b4a82 [FIX] product_extended: time cycle
Use the field `time_cycle` for cost computation, which takes into
account the routing configuration (fixed time of computed based on
previous operations).
2017-06-02 12:20:08 +02:00
Nicolas Martinelli 7cc8420ea0 [FIX] product_extended: workcenter cost
- Create a work center with a capacity of 1, an efficiency factor of
  100% and a cost per hour of 40$
- Create a routing with two operations: one with a fixed duration of
  30:00 minutes (OP1) and another with a duration computed on real time
  but with a default of 30:00 minutes (OP2)
- Create a component with UOM "m" and a cost of 10$
- Create a finished product with an associated BoM
- The BoM has a first line with 0.8m of component in the OP1 and a
  second line with 0.4m of component in the OP2
- Activate the Compute from BoM option on the finished product
- The proposed cost is 32$

Expected cost: 52$
(30 minutes @40$/hour + 30 minutes @40$/hour + 1,2m @10$/m)

We divide the WC cost by the number of operations, which does not make
sense.

opw-741032
2017-06-02 12:20:08 +02:00
Nicolas Martinelli 844d609cc9 [FIX] web_tour: hide tooltips on printing
opw-745872
2017-06-02 12:17:13 +02:00
Nicolas Lempereur b5aeaa910d [FIX] website_forum: archived forum -> no ask
An archived forum could still be posted in, something better should be
done in the next version (eg. website published present on a lot of
record type) but as of 10.0 just this improvement is done.

opw-745510
closes #17365
2017-06-02 11:07:19 +02:00
David Monjoie 6d75ccdb59 [FIX] web: mock server should not catch errors
Otherwise some changes can create rpc errors that are silently caught
and never seen as long as, out of (un)luck, the end result is the same.

Tests which need to create a server error can just simulate it using
the mockRPC mechanism.
2017-06-02 11:06:44 +02:00
Aaron Bohy 719e040dee [FIX] web: Many2One: search with input's value
When the user writes something in a Many2One input, after a short
delay, a name_search RPC is done with the value written in the
input, and results are displayed in a dropdown. Then, if the user
clicks on the input, the dropdown closes. If he clicks again, it
should do again a name_search RPC with the value of the input.
Before this rev., it was doing it with the empty string.
2017-06-01 20:45:06 +02:00
Aaron Bohy 1749ac2cd1 [FIX] web: allow to unset and reset same many2one value
Suppose that we have a many2one which is set (has a value) in
a form view. Before this rev., if the user unset the value (by
erasing the input content in edit mode), and then reset the same
value, the input remained empty, and the old value wasn't actually
reset.
2017-06-01 20:45:06 +02:00
Aaron Bohy 9966e4b333 [FIX] web: don't scroll when navigating in editable list
Problem occured with checkboxes in editable lists: when pressing
up, down, right or left with the focus on a checkbox, in addition
to navigating in the requested direction in the list, the page
scrolled (if there was a scrollbar of course). This was because the
event wasn't 'preventDefaulted'.
2017-06-01 20:45:06 +02:00
Dharmraj Jhala 22745668cf [FIX] website: properly update parralax image
Fixed some issues with parralax image updates:

- Background updated without clicking
- Default wallpaper not coming back
- Background disappearring sometimes
2017-06-01 17:09:54 +02:00
Kishan Gajjar 79477b8d96 [FIX] web_editor: hide customize menu when there are no options 2017-06-01 17:08:49 +02:00
Dharmraj Jhala dbdbfa7432 [FIX] website: properly rebind background events
In carousel snippet, the target element for background snippet option is
being changed manually. So for the new target, we have to rebind the
associated events that were bound in `start` function of the snippet
option. For that, some code is extracted from the `start` function and
is used to rebind necessary events for new targets.

In particular, this was preventing the carousel slides' backgrounds to
be automatically removed when a background-color was selected.
2017-06-01 17:08:49 +02:00
Goffin Simon 6dc6b148ef [FIX] service: No context in function tr
The context is not in the kwargs when the integrity error is raised from
a rpc request. So the user lang was lost and the sql error message was not
translated.

The part treating the callable message in sql error is depracated.

opw:743259
2017-06-01 17:02:16 +02:00
Christophe Matthieu a3874fce47 [FIX] account: reconciliation send all time propositions as partial
It is necessary to distinguish between the selected lines and the lines
with partial reconciliation.
2017-06-01 15:26:48 +02:00
Martin Geubelle 1561c5f660 [FIX] web: add o_input class on calendar dialog input
Since the rev 250e716
the class `o_input` needs to be set on an input to be correctly styled.
2017-06-01 13:57:53 +02:00
Thibault Delavallée 8184bb3dff [FIX] website_portal_sale: fix access rights issues when viewing quotes
Portal users do not have access on invoices or invoice lines. However when
viewing an online quotation in website_portal_sale some computation is
performed based on invoices and invoice lines. We therefore iterate on
invoice and invoice lines as superuser as we do not want to grant any
additional access on those models for portal users.
2017-06-01 13:46:40 +02:00