The group_by query expects the context to have group_by_no_leaf = true,
so we can not just blindly forward the context to the groupby query.
This is a defensive way to fix the problem, to avoid other possible
crashes. But the context shouldn't have group_by_no_leaf anyway,
it does not make sense to explicitely do that in the action
The method recompute_voucher_lines() is used by several onchange methods of
account.voucher. It used to unlink() the voucher lines before recomputing new
voucher lines. As a side effect, if you edit a voucher and discard your
changes, your voucher has lost its lines, although you did not save your
changes! Moreover, the call to unlink() is invalidating the record cache,
which screws up completely the onchange() method.
So, instead of unlinking the existing lines, the onchange generates commands
[(2, id), ...] to remove the existing lines only when saving the changes.
Add line id to while calling _cart_update() from sale_get_order()
The missing line_id parametre was making the _cart_find_product_line() call to fail as it was linked to an option while searching for lines without options (making the method recreate new lines).
Fixes#2573
This quick fix avoids a buggy behaviour in version 8.0 that could
confuse users.
A future version should implement properly selection fields in t-field.
(closes#2490)
(cherry picked from commit fe3cac30e4c5c132da1de02576d4aa325979ccd9)
Replace the query "SELECT min(id) FROM xxx" by "SELECT 1 FROM xxx LIMIT 1".
Both requests are as efficient, and the second one does not crash if column
'id' is missing.
Fixes problem when we try to sell 12 units of a product and change it to 1 dozen,
the algorithm was then trying to recompute the original amount and was getting
12,0000048 as a result which was then passed to the ceiling method, getting 13.0!
See also previous commit and issue #1125, PR #1126
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.
Also added correspding tests for rounding_method=UP
Fixes issue #1125, and replaces PR #1126.
Even if this should never be used in normal portal environment, if a user with enough access rights tries to create an invoice, this would crash. We don't need context here (opw 612591).
Previously, attachment and attachment_use were only functionnal when used
simultaneously. The code did not consider the fact that the user may want
an historic of all the printed reports. This commit allow the use of
attachment without attachment_use.
It also tell explicitely qweb to generate the branding (used to separate
reports from a unique html when printing multiple reports). Before, it was
functional only when website was installed, because we forced 'editable' that
only has meaning in website.
When setlast_tracking is called on a large number of moves in a picking
(e.g. when splitting moves in a picking), the time to complete grows
exponentially. The reason is that it loops over all the moves of
a picking, even if it keeps only the last tracking.
The method now uses a search() with a limit so it doesn't need to browse
all the moves.
Added test to check the behaviour of setlast_tracking
Fixes#2448
When opening a lead/opportunity from the phonecalls view, we did not open the correct view (always the lead).
This will use the type of the crm.lead to determine which view should be used, opw 608493.
The stock_partial_move wizard removes the required attribute for the field picking_id on a stock.partial.move. This means that we could get moves without picking_id and the previous line was failing ('NoneType' object has no attribute 'currency_id'). opw 614531
The cleditor width does not include the margins. Setting 100% will make the editable area too large (104%) on Firefox (opw 611700).
This issue was already fixed in newer releases, from commit 9247c37de7
Nevertheless, it introduced a new issue: while editing the form, the content of widgets html which were located in hidden notebook pages weren't displayed when displaying the page content.
opw-614448