When an asset is set as Prorata Temporis, with a one month period, the
first depreciation amount is computed on the basis of the remaining days
in the purchase year. This doesn't make sense for a monthly
depreciation.
This commit makes the distinction between a monthly and a yearly
depreciation. In the case of a monthly depreciation, the remaining days
in the purchase month are taken into account.
opw-690034
As of f814dd9908355465dd03735f4589dd1697b3658a, debug
mode causes an extra X-Debug-Mode header to be sent
by the rpc() JS method.
This custom header was not whitelisted in the accepted
CORS headers, therefore any cross-origin call to a route with
`cors=True` would fail in debug mode, with a console error
along those lines:
"Request header field X-Debug-Mode is not allowed by
Access-Control-Allow-Headers in preflight response"
This would prevent loading the POS GUI in debug mode,
for example.
This commit is necessary in the 8.0 branch because
the POSBox is currently based on a 8.0 server and may
be accessed by a 9.0 POS or later, thus with the extra header.
Steps to reproduce :
1. Create a new customer
2. Create an invoice with an amount of 50.- for this new customer and validate it
3. Create a refund with an amount of 70.- for the same customer and validate it
4. Create a Customer Payment for this customer and validate it. The Invoice will be paid with 50.- of the refund. 20.- are still on residual in the refund.
5. Create a new invoice with an amount of 50.- for the same customer.
6. Create a new Customer Payment for the same Customer and validate it.
The Full Reconcile Boolean stays checked inspite of "Open Balance" of Refund amount is less than the Invoice amount.
After the fix:
Full Reconciliation Boolean doesn't get checked and Allocation amount on invoice journal item line should be same
as Open balance of the Refund Journal Item. So Invoice stays open with Balance amount.
opw:691577
Depending on the version of dateutil, rule._bynweekday can either be
a tuple or a set (see https://github.com/dateutil/dateutil/pull/54), which,
in the case of a set, breaks the access by index (see related issue:
https://github.com/dateutil/dateutil/issues/24).
By casting it into a list, we make sure that we can access [0] in both case.
Credits to jke ; closes opw-690761.
Before this patch, the debian package depends on `python-pybabel`.
According to the documentation, this is a dummy package for transition
from `python-pybabel` to `python-babel`[1].
This dummy package has thus been removed in debian stretch in favor of
`python-babel`, and the odoo package is thus not installable in debian
stretch.
To fix this, we depend directly on `python-babel`, which is available in
all debian releases[2].
Closes#13905
[1] https://packages.debian.org/jessie/python-pybabel
[2] https://packages.debian.org/jessie/python-babel
Underscore method _.each expects an array like object when a "length"
property is present.
This was an issue with a record having a numeric "length" field set to a
non-negative value. When changing a line the change would not appear on
blur.
This issue was fixed with 0e664c9e9 but introduced back with f0e331e00.
opw-691070
This revert the fix made on 7bdd4de and replace it with a proper one that do create an account entry from stock_input to stock_output on a dropship move. That way, we avoid the manual change of account on supplier invoice. See the whole discussion on odoo#12687
Before this commit, the inventory by lot/pack/serial/... was only visible
if you switch quickly between res_config and adjustment inventory... once
the vaccumn clean the osv memory, the options was ignored.
Same issue with the _get_string_qty_information function.
Like in Invoices Analysis, the expenses must be expressed in the currency
of the company. In this way, it makes sens to sum them to compute the total.
opw:689760
The effect of this change is to trigger the recomputation of fields on larger
recordsets. This takes advantage of batch computations within compute methods.
when extending these methods with the new api, the context is a frozendict
so we need to copy before mutating.
this patch was made by searching for key addition to context and calls to the
update() method on the 8.0 addons, and checking if a copy was made before in
the method.
Most people install the im_livechat module and expect it
to be enabled automatically on their website.
When it doesn't work they try to use the integration JS
code and add it to their website layout, which does not
work as expected.
Setting it as auto-installed solves the issue.
* Failing test for one2many [(5,)] action, when domain is callable.
The problem is that `self` inside a callable domain becomes the comodel when at [(5,)].
* [FIX][fields] Make [(5,)] with computed domain work.
To reproduce this failure, declare a field like:
```
child_ids = fields.One2many(
comodel_name="other.model",
domain=lambda self: [("id", "in", self._ids_to_find())],
)
```
Now set some value to it.
Now unset them. Impossible because ``self`` becomes ``other.model`` in domain evaluation.
Web client use fields_get (which one call get_description) to know if
a group operator exists. But until now, group_operator are never returned.
Without it, the web client cannot display the sub-total except for sum
(the fallback in the web client).
This commit closes#13713
Todo: do the same on Class Monetary in next branch
An issue occurs in the following situation:
- Define a currency exchange rate at day 1 and day 2
- Create an invoice at day 1, and calculate the taxes. Do not set an
invoice date!
- Validate the invoice at day 2
The exchange rate for taxes is the rate at day 1, while the exchange
rate for other amounts is the rate at day 2.
There is actually no way to know what was the rate applied for the
taxes at invoice validation. There are two solutions:
- recompute the taxes at validation
- force the user to set an invoice date and recompute manually the
taxes
The first solution might have unexpected effects, therefore the second
solution is applied.
Fixes#13473
opw-688517
It wasn't possible to cancel a purchase order
within the state "Waiting for Approval", despite
the fact the button cancel is displayed.
Clicking on the cancel button just did nothing.
This is now properly working, thanks to the additional
path added by this revision, between the workflow states
`CheckForApproval` and `cancel`.
opw-688685
Also restrict XML data attribute evaluation context
even for real module data files. This will prevent
accidentally depending on context parameters that
would not be available inside base_import_module.
When receiving new mail (not replies) to an alias we should not take
case into account.
This also homogenize the treatment of local parts. For instance, lines
967 and 980 convert the local part to lower case to avoid
case-sensitivity issues.
Also `mail_alias` normalizes alias names by lowering case and finding,
if necessary to make it unique, a suffix to alias name provided.
From RFC 5321, section 2.4:
> Exploiting the case sensitivity of mailbox local-parts impedes
> interoperability and is discouraged
Closes#334Closes#13037
extract terms in correct folder
If two addons path have a common part in the folder name (e.g. `/home/alice/dev`
and `/home/alice/devodoo`), the `get_module_from_path` method may match the
wrong folder.
A file `/home/alice/devodoo/bob/models.py` would wrongly match `/home/alice/dev`
path (due to the lack of separator) and the returned module would be `odoo`
(`"odoo/bob/models.py".split('/')[0]`).
In such scenario, the translations of files (code, static folder, report) would
not be included in the exported translation file.
Force the module path to ends with a folder separator to avoid wrong matching.
Closes#13363
encode the filter in utf-8
This prevents a UnicodeDecode error in python-ldap when the
filter contains non ascii characters.
opw-682783
closes#10899closes#12710
When we are on the page:
/blog/myblog-1/page/2
the link to page 3 is:
/blog/myblog-1/page/3
So we need to give /blog/our-blog-1 as source url of pager.
Previously in this instance, since 4faed0b7 the page 3 url
in this scenario would erroneously be:
/blog/myblog-1/page/2/page/3
opw-688681
If the title was 'true' or 'false', the export failed, because we are tying to
concat bool and str. TypeError: cannot concatenate 'str' and 'bool' objects
How to reproduce, install sale, be sure to have one order with delivered = True
In Reporting / Sale analysis, add a group by 'shipped' filed to have 'true' as
title.
This commit closes issue odoo/odoo#13425
Currently, when rendering a list view cell with a many2many we would
empty the list of ids, and fill it again once a name_get is resolved.
But in some instance, the code could use the data when it has been
emptied out.
For example, if we set the tax_id field (inside the order_line list view
inside the sale.order form view) as requred, if we modify the order line
and save directly (without clicking outside of the list view) we can get
an incorrect error saying that the "Order Line" is not valid.
It has been reproduced when saving with CTRL + SHIFT + S on google
chrome and firefox, and there have been reports that for some
configuration it also happen when clicking on the "Save" button.
This commit change the behaviour so the value is kept whilst the name_get
is ongoing, and just use a default "false" value for the name during this
interval.
closes#13478
opw-668067
Although we have been reluctant to perform this change, a specific
use case can cause customers to be redirect to the Odoo DPN url
with a GET request.
This happens when a Paypal Merchant account has the feature Guest
Checkout active; in that case, a customer can pay without having
a Paypal account (using only his credit card) and will *not* be
subjected to auto-return; as detailed here:
https://www.sandbox.paypal.com/be/cgi-bin/webscr?cmd=p/pop/help-account-optional
Request coming from that payment flow will always trigger a GET
request, causing the customer to be welcomed by a
405 - Method Not allowed
error on the Odoo server. The payment is normally correctly processed
through IPN, so this does not normally causes loss of data; however
this is not a nice way to welcome back your customer right after
they pay you.
Until 9.0 our psycopg2 DSN connection strings do not allow having
spaces within the db name, and passing some can cause duplicate
registries to be loaded.
Stripping spaces is a simple workaround until we actually support
spaces within db names.
Fixes#13078