Users will generally not have the right to read Journal Items unless
they are members of one of the Accounting/Invoicing groups.
Removing the payment-related fields & widgets from the view should let
those users view relevant customer invoices (e.g. for Salesmen) without
getting an AccessError, due to the underlying access to Journal Items.
It may be confusing that a constraint is not triggered in a name_create call.
Testing the absence of value should be done in an override of create, not in a
api.constrains.
Closes#18382
It is costly to compute all issues, return the full list of all issues, only to
compute the length and display it.
Use proper issue_count field.
Closes#18858
The reference widget is also meant to be used on a char field, not only on a
reference field.
The rev. https://github.com/odoo/odoo/commit/a4e30a1b43d0b9acd76508d9e6c466cd1dbdffab removed
the use of `field_utils.format.many2one` and replaced it by `_formatValue` to
support this use case.
The replacement wasn't complete as some occurences was remaining (in reset),
which led to traceback when the widget was reset (impossible to create an
External Identifier anymore).
Also, the reference `_formatValue` wasn't correct as it was displaying the
record `display_name` and not the reference field value ; this only makes sense
for the External Identifier as its display name is the reference field value but
it doesn't make any sense for other reference field.
Last but not least, this commit implements the `onchange` and `default_get` for
the reference field.
Use case to reproduce:
- Create multiple warehouse
- Select a warehouse to ressuply on a warehouse form view
- Go to the supplied warehouse form view
- Change the delivery method -> Traceback can't adapt stock.location type
This happens because there is a write method using a stock
location instead of its id.
This commit use the location id instead of location
Before this commit, the calendar view showed Sunday as the
first day of the week.
Now it depends on the user lang.
This is the same behavior that we had before the refactoring
of views.
before this commit, when a portal user edited its details, the State field was not updated on change of country_id
This was because a CSS class was missing.
We make the details template calling portal_layout as it should to get every resource we need in the rendering of details
OPW 767041
Closes#18984
When a product has multiple company taxes and b2c prices is enabled, price is
not computed properly and adds to the base price every company tax present.
This patch filters the company set on the company so taxes are computed just
for that company.
This closesodoo/doo#18840
In a multiwebsite environment, (de)activating some theme views produces
undesired results if the same view exists in different ways for different
websites.
With this patch, we search before for a website-specific view with the provided
key, and fall back to the XMLID-found one if there is no specific view.
This commit closesodoo/odoo#17970
Before this patch, if some view had both `inherit_id` and `website_id`,
its inheritances were being applied even in different websites.
After this patch, if a view inherits from another, inheritances will only apply
when both views belong to the same (or none) website.
Refactoring based on the pr #17635
This closesodoo/odoo#17635
Without this patch, all Qweb cache is shared among all available websites.
This turns impossible in practice to actually create multiple websites with
different look.
This closesodoo/odoo#18462
- When you move an all day event to a scheduled event,
the default duration should be 2 hours instead of 1 hour.
- Before this fix, it was not possible to drop an event
to an all day event
- In week mode, an all day event was displayed over two days.
When refunding an invoice with the option: "Cancel: create refund and reconcile",
it raised a warning: "You are trying to reconcile some entries that are already reconciled!"
because in some cases the refund is linked to several entries which match the same
account of the invoice. So it tried to reconcile several times the same entries.
opw:765673
Do not remove fields from models except for custom fields. Removing a base
field from a model screws up the model cache: that field may be required to
speed up the setup of the model in another registry.
In general (e.g. read, search_read), values for many2one fields are pairs
[id, display_name]. The default_get is an exception, it only returns the id,
so we need to manually perform a name_get afterwards. In the case of
list views, those name_get RPCs are batched.
Before this rev., the code in charge of it didn't handle the case where the
many2one value was false, so it crashed when it happened.
This rev. deals with this use case and a test case has been added.
When starting the HTML editor, the first view that is shown is supposed
to be the main one of the page by default. This was not the case for
custom pages as the 'xml_id' of the page was considered instead of its
'key' value.
- Create a product with attachment, and name the attachment 'テスト'
- Purchase the product, make a payment, validate and pay the invoice
- Go to My Orders under My Account, open the order, and try to download
the file 'テスト'.
An error 500 is raised due to a UnicodeEncodeError.
```
File "/home/nim/src/odoo/addons/website_sale_digital/controllers/main.py", line 104, in download_attachment
return http.send_file(data, filename=attachment['name'], as_attachment=True)
File "/home/nim/src/odoo/odoo/http.py", line 1595, in send_file
headers.add('Content-Disposition', 'attachment', filename=filename)
File "/usr/lib/python2.7/dist-packages/werkzeug/datastructures.py", line 1093, in add
_value = _options_header_vkw(_value, kw)
File "/usr/lib/python2.7/dist-packages/werkzeug/datastructures.py", line 830, in _options_header_vkw
for k, v in kw.items()))
File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 212, in dump_options_header
segments.append('%s=%s' % (key, quote_header_value(value)))
File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 165, in quote_header_value
value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
```
opw-766568
In case of foreign language, using unicode characters, the error message may be
badly formated.
e.g.
Unknown error during import: <class 'odoo.exceptions.AccessError'>: เฉพาะผู้ดูแลร..
insted of
Unknown error during import: <class 'odoo.exceptions.AccessError'>: (u'\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e1c\u0e39
opw-766580
New saas-16 web views have a more consistent handling of `readonly`
attributes and do not save read-only fields inside x2m. In the previous
implementation this was an exception to the rule (even if rather
inconsistent/unexpected).
A new attribute `force_save` was introduced to workaround the default
behavior when considered necessary.
The portal wizard is affected by the change, as the partner_id field of
the lines is readonly but required. It could be avoided by filling the
wizard lines before opening it, instead of relying on default values and
onchanges. However this would likely require extra boilerplate code and
an extra server action. Dropping the readonly flag would work too, but
would look weird.
Using the new `force_save` flag is a simpler alternative.
See also rev. 3b3f6f04af