Declaring the keyword argument `context` in an API v7 `orm.browse_record` can
lead to mixed API v7/v8 inheritance bugs (`context` will be treated as a
function parameter instead of being injected in `self.env.context`). As the
context is already propagated in line 953, we can safely remove it from line
971.
Closes#13115
When the user name entered hasn't an email specified the error message wasn't
displayed in the reset view.
The error message was in e.name, not e.message
Using the constructor `new Event()` is not supported in IE >= 9.0
(tested on IE 11). It raises the below error:
`Object doesn't support this action`
This revision implements the Polyfill `CustomEvent()` suggested
by the MDN here:
https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
and uses it if the `new Event()` call fails.
opw-690984
Due to the following revision:
456d7b38f1
The company on the order line was not assigned
when creating a new line in an existing sale order.
The company was correctly assigned when you created
the order line with the order, and when changing the company
of the order, but not when adding a new line on an existing order.
This new trigger repairs this regression.
Due to the following revision:
295b96c0b3
The company on the version and items was not assigned
when creating a new pricelist version on an existing
pricelist.
They were if you changed the company of the pricelist,
thanks to the triggers added in the above revision,
but not when they have just been created in the pricelist.
These new triggers repairs this regression. It also handle
changing the `pricelist_id` of a version (this is doable through
the "Sales > Configuration > Pricelists > Pricelist Versions" menu).
Fixes#14631
If wkhtmltopdf is missing, a call to a report will be catched to warn the user.
In case of a report generated indirectly (e.g. via an attachment on an email
template), the rendering would crash.
As warning the user is better than returning a traceback, raise a UserError.
Closes#14535
It's possible that the command `wkhtmltopdf --version` returns an empty
string (in the use case, it output later in stdout "wkhtmltopdf: error
while loading shared libraries: libfontconfig.so.1: cannot open shared
object file: No such file or directory").
We chose to display the report in html in this case and also to show
a warning to the user inviting him to fix his installation.
- adds position before to COP currency in res_currency_data
- adds address_format to Colombia in res_country_data
- CLA signature for kurkop
Closes#10618
- Create a new assets
- Set a any gross value, any number of depreciation, and any number of
months in period
- Set "Prorata temporis" to True!
- Save, then confirm the asset
- Post at least one of the line by clicking on the red bubble next to it
- Click on "Modify Depreciation" and choose another number of month
- Click on "modify" to confirm the modifications
The depreciation of the latest posted month is duplicated. However, the
first unposted depreciation should be the first period after the last
posted period, as it is the case for non prorata temporis assets.
opw-693081
session.context no longer exists, it is session.user_context
Add the missing context in the message_fetch call. The dates in the chatter were
not formatted according the user locale.
The tacked messages in the chatter were parially translated.
e.g. "Lead created"
The call did not gave the user context and the subtype message was not
translated.
Closes#14589
Variable `membership_line_ids` was misspelled `membership_lines_ids`
Thus the list of partner returned has extra partners not filtered by search domain
Closes#13768
For the field "tax_ids", a command must be written in the the returned dictionary.
In this way, the ids of the tax will be set on the account move line.
opw:689806
When using a many2one widget, in the following scenario:
<h2><span t-field="o.partner_id.parent_id.country_id"/></h2>
If 'parent_id' is an empty recordset, the following error will be
raised:
[...]
[read] = record.read([field_name])
ValueError: need more than 0 values to unpack
This is because record.read([field_name]) returns an empty list which
cannot be unpacked.
In version 10 this problem is avoided by using recordset but to keep the diff
minmal in v9, only returns empty string as the line below does
`if not read[field_name]: return ''`
Closes#14489
The website `default_lang_id` was not required,
while the algorithm choosing the website language
expects it to be required.
This solves the below issue, when your browser language is en_US:
- add a second language to the website (e.g. fr_BE or es_VE),
- in the website settings, remove English from the languages
- in the website settings, unset the default language
- try to go on the website
You will have a crash:
```
File "/home/odoo/src/odoo/saas-11/addons/website/models/ir_http.py", line 193, in _dispatch
resp.set_cookie('website_lang', request.lang)
File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in set_cookie
self.charset))
File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_cookie
value = to_bytes(value, charset)
File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_bytes
raise TypeError('Expected bytes')
TypeError: Expected bytes
```
This is because the `request.lang` is set to `False`
because of the below algorithm in `ir_http.py`:
```
nearest_lang = not func and self.get_nearest_lang(path[1])
url_lang = nearest_lang and path[1]
preferred_lang = ((cook_lang if cook_lang in langs else False)
or self.get_nearest_lang(request.lang)
or request.website.default_lang_code)
is_a_bot = self.is_a_bot()
request.lang = request.context['lang'] = nearest_lang or preferred_lang
```
`nearest_lang` is `False`, because there is no nearest language
available for the browser lang (`en_US`)
`cook_lang` is `False` for users who never went on the website
`request.website.default_lang_code`, which is the last feedback,
is also `False` because you removed the default language
in the website settings.
opw-695621
The deleted code put the same picking_type_id for all companies.
The function _get_picking_in returns the right default picking_type_id
according to the company.
Steps to reproduce:
-stock.warehouse0 is on company A.
-Define another company B with its own warehouse.
-Update the purchase module -> a new default value for picking_type_id on purchase
order for company B is created wtih the value of company A
-Create a purchase order on company B, Odoo tries to get the picking_type_id from company A.
If user doesn't have any rights on company A, it occurs a security warning.
Otherwise the purchase order is linked to a picking operation of another company.
opw:694059
When passing a value along with a currency
to the `formatLang` method,
the currency symbol was added to the value,
but the amount wasn't rounded to the currency
decimal places, as it would be expected.
For instance, when using the currency "XOF",
with as symbol "CFA" and 0 decimal places,
2 digits after the comma were still displayed
in the accounting dashboard, while the user expects none.
This behavior to take the number of digits out of the currency
is already the behavior of the `formatLang` methdod in the reports
(`/openerp/report/report_sxw.py`)
it was just not yet the case in the misceleanous tools
(`/openerp/tools/misc.py`).
opw-695496
To reverse all the the exchange rate difference entries created during the reconciliation.
Before the fix:
Configuration
- Company Currency USD
- Multicurrency
- Other Currency EUR with exchange rates per day.
- Bank journal in EUR with allow cancelation.
Steps
- Create more than 1 invoice for customer in EUR and validate it. (Example. 3 invoices 100 EUR each)
- Create a bank statement in EUR Bank with the payment of that invoices (Example. 300 EUR)
- Conciliate the payment with the invoices.
- The journal entries for exchange difference are correctly created(three exchange rate difference entries).
- Cancel the payment from bank statement.
Bug:
There was only one reverse journal entry created for the exchange rate difference of the all reconciliation.
But three reverse journal entries for exchange rate difference entries were expected.
opw:694120
In `action_cancel` method below, the date_cancel is set when the linked invoice
is canceled.
When the canceled invoiced was reset to draft, the date_cancel was not removed.
This change makes sense as the state of the membership line is changed from
`cancel` to `waiting` when the invoice is reset to draft.
Closes#14313