The SQL view implementing the "Invoice Analysis" report
JOINs the res.currency.rate table in order to obtain the
correct currency rate to convert each invoice line amount
in the same currency.
The matching of the rate needs to be done on the date
of that rate (`name` column) - the last rate preceding
the invoice date is presumed to be the right one.
However there is no simple way to make a direct JOIN between
account.invoice.line and res.currency.rate with a single
match, without using an ORDER BY clause and LIMIT 1.
This requires a costly SUBSELECT query for each invoice
line, quickly becoming prohibitive.
Through the use of PostgreSQL's Common Table Expressions
(CTE) it is possible to construct a temporary table
with the rates' start and end date of application.
This temporary table can then be used in a direct
JOIN with account.invoice.line, delivering much better
performance (no SUBSELECT needed for each invoice line)
On a database with 50k invoice lines this makes invoice
analysis return results in less than 800 ms instead of
10+ seconds.
Revert c06a96 "[FIX] stock: force recomputing transfer information on picking"
and unlink packoperations only when move lines are changed (fix opw 620636).
c06a96 introduced a regression as it prevents to plan moves (e.g. assigning lots
through the barcode interface) before the reception.
when closing a modal, the class 'modal-open' was removed from the
'body' tag and all the existing modals became not scrollable.
The class 'modal-open' must be kept in the 'body' tag if there is
still a visible modal in the dom.
Inspired from commit: dee000be14
opw:633801
Adding an image from the frontend use ir.attachment or pre-existing url
and set the url in the blog.post's background_image field. This is
not the same as a binary field which sets the data in the field.
Since it's possible to do it in the frontend, there is no use of the
field in the backend. This fix removes this field.
closes#6497
issue #1305
opw-633725
The onchange partner on the sale.order set the 'note' field as the terms of the
company in the partner's language.
When the SO is created from an opportunity, the terms are not translated.
Call get_salenote method that handles patner's language.
Commit 8a6e859 wrongly introduced this new field when adding the new
`payment_authorize` module.
As 8.0 is a [stable version](http://git.io/vfACM), no data model change
is allowed.
We convert this field to a `fields.dummy` in case someone installed (or
update) this module with this fields to ensure the view still applied
and is not broken.
The function _unite_compute and _unit_compute_inv did not give the same display result.
Regardless the way the tax is computed, the display must be the same. The display must
only shows the name of the tax.
opw:633828
-Test the function _bom_find to check that it searches the bom corresponding
to the properties passed or takes the bom with the smallest sequence.
For this commit: d357667df4279070b51af58cad55ef314688d69f
- Test the function _bom_explode to check that it only takes the lines with the
right properties.
For this commit: 6b6e71a3e0c86aa8a9b8c4f20eaa61b17c64ce7b
Now it's possible to put a property on a bom line.
For example, the bom for an apple pie and for an apricot pie can be made
in a single bom.
Three lines are necessary in the bom of the product "pie":
- First line with product " dough" without property
- Second line, with product "apple" with property "apple" if you want an apple pie
- Third line, with product "apricot" with property "apricot" if you want an apricot pie
The type of this bom pie must be "set" to allow the customer to assemblate
his favorite pie by himself.
Now to sell an apple pie, you must create a SO with the product "pie" and
the property "apple".
In that way, the delivery order consists of two lines:
- dough
- apple
The bom related to the product in a sale line order must be
filtered by the function _bom_find. If two boms can be applied
on a product, the bom with the smallest sequence is applied.
opw:632558
This fix gives the domain to the "See selection" view opened from a
FieldCharDomain.
In Odoo 8.0, this widget is available at two places:
- mass_mailing: Marketing > Mass Mailing | Mass Mailing > (any
newsletter) > "See selection".
- gamification: Settings > Gamification Tools > Challenge > (any
challenge) > "See selection".
With this fix the "Selected records" view display selected records.
closes#6463
opw-633201
The product margin computed on each line of a sale order must be
rounded according to the currency of the order pricelist.
Inspired from the field 'price_subtotal' in addons/sale/sale.py
Previously, we could unpublish an employee from the website, but there
was no simple way to publish it again after we leave the page.
This fix show the unpublished employees on the about us page for the
users who can modify these employees records.
closes#6416
opw-633462
The `tax_amount` of move lines is by default set to `0.0`.
Nevertheless, this default value is set by Odoo,
not by postgresql.
This is therefore likely that the `tax_amount` is set as
null instead of 0.0, in database.
Therefore, when getting this value directly with a SQL
request, this is possible that `null` will be returned.
Therefore, in this specific case, `res.get(record.id, 0.0`
could return `False`, if the sum of `tax_amount` is `null`,
and try to multiply a boolean with an integer is not possible:
`_rec_get(rec) * rec.sign`
opw-633903
The CSS on the linei with the "New" button of an bank statement
reconciliation wizard was only applied when there was only a multiple of
two "block" before.
Hence it worked when there was a multiple of 2 cases before, but if not
(for example when account_analytic_plans is installed) on:
- google chrome: the button is on the right (instead of on a line by its
own).
- firefox: idem, but also a difference in float display positioning
caused the parent container to not take floating elements into account
to calculate it's height.
This fix apply the CSS independently if the last block is even or odd.
Before this fix in firefox:
https://cloud.githubusercontent.com/assets/9977887/7315195/70ca5eca-ea6b-11e4-8892-1272f7ee0cb4.png
After this fix in firefox:
https://cloud.githubusercontent.com/assets/9977887/7315194/6e2b05ca-ea6b-11e4-9400-69c9cd587756.pngcloses#6459
opw-633703
Sales Order lines have a cancelled state, but this state is not
always considered when looping over lines. This check is
done in some places already and this patch's aim is to do it in the
remaining places.
- Cancel the procurement of a sale line in sale.order.line
instead of sale.order, so a line canceled individually with
sale_order_line.button_cancel will properly cancel it
procurement.
- Sale report: uses the state of lines instead of Sales order,
so canceled lines of not-canceled orders are correctly represented
in the analysis.
- test: do not create invoices lines for canceled sale lines
- test: creation of moves with canceled lines
- test: check if lines are still canceled when sale order is done
Closes#6036
When selectiong a dropshipped product in a sale.order, the user should not be
warned that the product is not available in stock (as it never goes to the stock
anyway but directly from the supplier to the customer).
Factorise verification in _check_routing method.
This issue is related to the wkhtmltopdf issue
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2083
It seems there is a race condition in the Javascript file
loading in wkhtmltopdf 0.12.x.
The subst.js file put in the header/footer of reports
was not always loaded when the page was being rendered,
leading to the crash of the onload="subst()" attr in
the body node, leading to the non-rendering
of the header/footer.
Replacing the script file by its content solves
the issue.
Increasing the --javascript-delay of the wkhtmltopdf
executable (e.g. 1000 ms instead of 200 ms,
the default value) seems to solve the problem
as well, but will lead to obvious performance issues.
We therefore choose to put the javascript code inline,
as a workaround,
the time the issue is solved in wkhtmltopdf, at least.
closes #3047,#5548,#6207
opw-633161
The ir.ui.view.graph_get() method depended on the natural
semi-random order of Python dict keys in the _columns dict.
When the number and/or names of the _columns happened to
yield the o2m field of the "incoming transitions" *before*
the "outgoing transitions" of the "Node model"
(e.g. workflow activity), it would swap the incoming and
outgoing transitions fields around, causing a crash later
in the `tools.graph.process` method (currently an infinite
loop in the `tree_order()` method of tools.graph.py).
Closes#3614
Fixes https://bugs.launchpad.net/openobject-server/+bug/1316948
opw-633765
The company logo can't be customized because it's a t-field from the db.
This fix don't have to be forward ported because the problem is
already fixed in saas-6.
opw:632702
In the search input, the result of filtered search with an arrow was
placed under the currently selected arrow.
Hence if we get to another arrow filter before the result is received,
the result is added under the wrong arrow.
This fix adds the result under the right arrow.
closes#6442
opw-632519
Make sure the purchase order is marked as invoiced only when fully invoiced.
If the invoices are generated on delivery order (invoice_method picking), make
sure all products are delivered before setting it as invoiced.
opw 614256
When the user is not logged, there is no branding for the options.
This is why, the product_id of the option must be written in the
template "optional product".
opw:633093
The onchange handler is doing a weak comparison between the values received from
the onchange() method and the current field value, which leads to a falsy value
such as "0000" being treated as equal to False.
This patches changes the operator to enforce non-coercive equality.
Fixes#6405
Ensure correct sequence of bank statement action views.
As the views are sorted based on the sequence, make sure the tree is selected
before the form view.
Fixes#6413
The previous filters didn't take timezones into account, and
returned stringified naive datetime values in local browser
time. Those would then be interpreted by the server-side as
UTC date, and depending on the current timezone offset vs UTC,
yield partially incorrect results.
By returning directly a datetime.datetime object instead of
a stringified version (see previous commit 76881fb),
we can get the expected result regarless of the timezone.
Fixes#2972Closes#6229
opw-621282