Errors that are not whitelisted are not managed correctly due to the jsonrpc behaviour in Odoo.
When we make a post in json using iap.jsonrpc function, it contacts iap.odoo.com.
However, if this url does not respond, it falls back to the 'typo' page and the answer to the call
has a '200' status code but with an 'error' key in its response.
Currently, we manage the errors via whitelisting, which hides this kind of errors.
We opted to raise this error (odoo server side) as a UserError and to add UserError to the whitelist.
stock_landed_costs.yml is adapted to validate the picking before
applying a landed cost on there. Applying a landed cost on a non
validated picking was never supported but the test fails due to
implementation changes in v11.
Due to this change, the last assert was wrong: indeed, applying a landed
cost on a delivered product creates 6 account move lines if anglo saxon
accounting is enabled. This case creates 4 landed costs on 2 delivered
stock moves, 4*2*6 == 48 account move lines.
The value and remaining value fields were correctly adapted when a
landed cost was applied on a move, but not the unit price one. This is
problematic, as the product should indeed cost more.
To properly compute this value, we change the meaning of
`stock_landed_cost_value` which is now the total value of the landed
cost, not the prorated value of what is still in stock.
Also fix the computation of the quantity already delivered in case of
negative stock.
Fixes#19254
Before this commit, when putting the mouse over an attachment in the attachment drop menu list, the date time displayed was UTC only.
After this commit, we convert that value to the correct timezone datetime.
OPW 776704
Before this commit, if you had a simple link (just a href, not handled
in JS), you couldn't simply make it clickable only once.
This could be a problem in some cases. (eg: a btn creating a record, it would
create as many record as many times you clicked on it)
The same behavior could occur for link/button redirecting to a route creating a
record. There is a window of time between the click on the btn and the moment
the page is getting redirected.
You have time to click multiple time on it and it would call the URL multiple
time.
Now, there is a class 'js_disable_on_click' that will be handled in
website_root.js and will disabled the button after the first click.
The fix was originally aimed to fix multiple click on "Create Page" btn on 404
On P3, "text" IO (open(f, mode='r')) will default to the encoding
provided by locale.getpreferredencoding(False) which apparently is
regularly cp1252.
Replace by misc.file_open which enforces UTF-8 decoding in text mode.
Following the 3.6 wordcode change, EXTENDED_ARGS gets used for jumps
offset by more than 256 bytes (128 opcodes), most commonly
absolute (so many script of more than 128 opcodes with conditionals
arer going to trigger the issue).
In bytecoded Python versions, EXTENDED_ARGS was only necessary above
65k opcodes: the opcode would get a separate 16-bits argument, while
wordcode opcodes get 8-bit intrinsic.
I don't quite get how it can trigger on user systems (as it apparently
requires resetlocale() to fail to set up an UTF-8-encoded-locale
somehow, disabling resetlocale() is how I could get the issue
triggered on my system), but anyway it's apparently possible for Odoo
to run with an ASCII system encoding, and it turns out Python 3 will
not use UTF-8 everywhere but will rather use whatever
locale.getpreferredencoding(False) yields, which in theory could be
completely bonkers.
This is an issue when using text IO with an implicit encoding, which
is what load_locale (/web/webclient/locale/<lang>) was doing.
* Fix by using binary IO
* Fix (2) by using direct-passthrough IO with specified encoding, that
way we let the WSGI server handle the file streaming
Fixes#20075
Opening a record in a calendar view always showed the default form view when it is not a popup.
Example in CRM: opening an opportunity will always show a lead view.
The fix aims to use the "get_formview_id" method to find the right id of the view that must be shown instead
of using a default id.
opw-774272
opw-776927
Closes#19973
Due to the fact that some products might be maintained in a module and
will write on the product on upgrade we need to take care that it will
allow to write not changed product types.
When validate an invoice, if you are timesheet
user and billing user, it is forbidden for you
to create an analytic line without a project set.
This commit allow billing user to create AAL.
opw-776391
With Odoo v11 running on Python3:
1. Go to Settings -> Translation -> Import Translation
2. Choose a valid .po file (e.g. generated with the menu Export Translation)
3. Click Import
There is a server error.
There are two bugs behind this error:
1. we open a temporary file that cannot insert bytes ('w+')
2. the name of the temporary file is an integer (its file descriptor)
Python2 processed some implicit conversion between str and bytes, so that the 1st error doesn't occur. The name of a temporary file in Python2 is '<fopen>'.
We made the following corrections to the code:
1. open the temporary file with w+b access (write bytes)
2. enhanced a conditional statement so that we skip instructions in case where the field name of the tempfile is a string
Related Ticket:
opw-775445
This commits fixes a traceback that appears when ticking a checkbox in
an x2many which triggers an onchange. The root cause of the issue is
twofold:
- confirmUpdate requires currentFieldIndex to be defined, but might be
needed when setting currentFieldIndex;
- confirmUpdate attempts to restore the selection range even if we are
not dealing with a char field (e.g. checkbox).
We solve the issue by ensuring that _selectCell gives a temporary value
to currentFieldIndex. This value is chosen so that confirmUpdate calls
_selectCell with the right parameters. Moreover, we only restore the
selection range when the range is defined.
This commit ensures that tab navigation works properly when editing a
form view that contains input fields with phone widgets. Previously,
pressing TAB would skip those fields.
It is possible that the price unit the move was created with is no
longer valid (for instance, one could change the price unit on the
purchase before validating the receipt, or the currency rate has changed
in the meantime).
Fixes#20035
The name field is a stored related on the resource.resource record.
The name on the resource is required.
If no name (and no resource_id), the creation fails as trying to create a
resource without name (non-null constrain)
Force in the view to indicate to the user that a name is required but without
adding the constrain at the database level.
required=True on the fields adds a non-null constrain on the SQL column but the
related values are populated *after* the INSERT so it would fail depending on
the given values (e.g. a resource_id value but no name)
Fixes#20126Closes#20128
The automated tests of rpm,deb and src packages are using docker
images and containers. Those tests were not working as expected due
to various small glitches:
* some debian python- packages were missing in the Debian image
* pip was called instead of pip3 for the src test
* a wrong addons path was given for the tests
* the containers id's were wrong due to a bytes implicitly converted
to str
When you open a move of a component in a manufacturing order, we cannot
see the move lines and so add a new on if there are no move lines in it
with finished lot. We now always display the list of move lines if
product is tracked by lot/serial or has finished lots.
The idea is to warn user if he created a special file (website.page with
supported extension) and he wants to change the file's name, which will at the
end also change the key).
If this special file has been t-called elsewhere, they t-call wont work anymore
This is why warning user is needed.
Note that this is different than the already existing page_search_dependencies
that is just checking if the URL is present in menus, templates, blog or pages.
This is about checking if the key is present somewhere. (we assume that if the
key is present, it is surely about a t-call.
Technically, the flow is:
1. Get supported extension
2. Get key dependencies
3. Check if user modify name
4. If name changed and it is/was a supported extension (special file) and it
has dependencies (surely t-call) then warn user these call wont work anymore
--
search_page_dependencies is also improved by returning links to be clickable
(on delete dialog eg) and splitting template/page results.
it also refactor dependencies warning that was creating HTML in javascript into
using XML template