During the conversion of the module
`account_asset` to the new API,
in revision 6120bab,
the variables `current_currency` & `company_currency`
have been changed from identifier integers to
browse records.
The currency passed in the `create` method
values must therefore be adapted according
to this change.
This prevented the correct use
of the assets when the currency of the assets
was not the same as the currency of the company.
opw-669571
During the conversion of the module
`account_asset` to the new API,
the currency conversion in `create_move` has been inverted.
```
amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context)
```
has been converted to
```
amount = company_currency.compute(line.amount, current_currency)
```
while it should have been converted to
```
amount = current_currency.compute(line.amount, company_currency)
```
See:
https://github.com/odoo/odoo/commit/6120bab#diff-e35933343c229da0afceb2a3b9e3639bR356
opw-669568
With a high number of pricelist items
(8.000.000 in the observed case),
the SQL request performed in `_price_rule_get_multi`
took a significant time (>3000ms)
to be executed without an index on the `pricelist_id`.
opw-670153
The Dialog class destroys the modal (and so removes it from the DOM)
when the dialog closes but leaves the modal-open class on the body
element if there are still other modal(s) in the DOM.
The problem is that (maily on the frontend side) there may be others
modal(s) in the DOM (not handled by the Dialog class) but which are
not shown to the user, and in that case the modal-open class should
be removed.
If the help message is translatable,
there is no reason why the thanks message
coudln't be as well.
This is a following of the revision
f37a40c4c0
opw-670228
If there is no currency set on the journal,
the fallback currency must be the currency
of the journal company, not the currency
of the user company.
This would mean that when you change of company,
with another currency set,
the bank statement change of currency, this is non-sense.
opw-670187
When creating account move lines from an account move, the partner
set on the account move lines has to be the same than the one on the
account move.
opw:668322
When a product has no company set, it assumed it use the main company
currency. Read the main company currency as SUPERUSER as current user
may not have access to it.
Followup of 3622c0d12a.
tl;dr: accept both `None` and empty ('') results as
cache hits, then double-check that the file_size
is really 0
A. Valid empty files
When a LESS file compiles to an empty result
(e.g. `variables.less`), do not treat the empty file
as a cache miss. Those are valid because file_size == 0.
Note: empty files are not stored in the attachment
filestore and return a null (None) `datas` when read
from the database.
B. Invalid empty files
Under some circumstances (e.g. damaged filestore,
race conditions during deletion, etc.), cached
compiled assets may be deleted in the underlying
attachment filestore, while still present in the
table. The filestore implementation returns an
empty file ('') when they are later accessed.
Those can be considered **invalid**
because the expected file_size is > 0.
The image that is set based on the type should not be colorized as it has no
transparency (image_colorize method would fail).
The _get_default_image is called explicitely to pass False to colorize attribute.
A proper refactoring of the method _get_default_image has been done at 66d4de7
but for 9.0 versions, makes this minimal hack without changing signature method.
Fixes#11027
The former `domain` and `context` values were dropped at revision
e021a08b30, as they referred to fields
that do not exist in Odoo 9.0.
Resetting them to empty values is required in order to force
the new value for upgraded databases.
From revision cb01be2,
the purchase stat button is only on product template form,
and no longer on the product variant form.
The domain of the list that this purchase button
opens has not been adapted according to this change,
the domain was still applied as coming from a product
variant form rather than a product template form.
As a result, it opened the purchases of products variants
having as ID the product template ID from which you came
from before hitting this button.
opw-669618
t-field handles better the currency rounding than t-esc.
When setting the currency rounding to 0.05 instead
of 0.01 (e.g. Switzerland), for 600.00:
- t-esc returns 600.0
- t-field returns 600.00, as expected.
opw-669945
In the interest of being flexible and customizeable all of the defined
classes in the POS should be exported so people can easily inherit them
and change their behavior. A lot of the time you can get to them even if
they're not exported if you get creative enough, but noone should have
to resort to such ugly methods.
This commit does this for all of the modules except for
point_of_sale.popups. It has been omitted because currently it exports a
single object (PopupWidget). Modifying this to export an object of
objects could potentially break other unofficial modules which we do not
want in a stable release.
By shadowing the `product` variable, the suggested products option had
the side effect of showing the comments of the last suggested product
instead of the current product ones.
The methods calling `reverse_moves` expects a list
as returned result.
For instance, in `account_move.py`, `account.partial.reconcile`,
method unlink:
```
reversed_moves = exchange_rate_entries.reverse_moves()
for rev_move in self.env['account.move'].browse(reversed_moves):
```
If there was no reversed moves, the method returned a boolean,
and a list otherwise. It should always return a list, empty
in the above first case.
opw-669790
When printing a receipt in the PoS, the debug manager and the Livechat
content are displayed in the receipt. That's obviously something we
don't want.
opw-668675