In 5af12238 a change was made to have the correct hierarchy levels, but
this can cause an issue when editing less files.
This is because we now had "undefined + 1" which gives NaN which breaks
Array constructor.
opw-814579
opw-815397
opw-814322
opw-815265
opw-814021
closes#23006
Before this rev., the aggregates values displayed in the footer of
list views were formatted according to the field type, and the
field's widget was ignored, whereas it should be used by default.
For instance, if the 'float_time' widget is set on a float field,
the sum should be formatted as FloatTime as well.
Closes#22724.
Before this rev., the list of selected records wasn't correctly
reset when the list was reloaded (e.g. when coming back using the
breadcrumbs). In the UI, the records weren't selected anymore, but
in javascript, the list of selected records wasn't empty. As a
consequence, the aggregates were wrongly computed, and always
displayed 0.
Closes#22725.
Before this commit, when a planner made a link from an action, the view_type was always 'list'
This prevented the view from being properly loaded, as an action of view_type form wouldn't be recognized
After this commit, such links are well formed, and form view_type actions are correctly loaded
OPW 806758
Since the <widget> tag is not used anymore in any of our views, it was
not really properly supported. In particular, the form widget was not
notified when the state of the form view has changed, which makes it
very difficult to actually do any useful work.
With this commit, we make sure that the widget method 'updateState' (if
it exists) is called with the new state whenever it changed.
This should allow developers to do useful work without having to work
around the issue. Note that this is not really a perfect solution, since
the updateState methot may or may not have been implemented.
I think that we need some kind of ViewWidget abstraction, which could be
used to have a better and more complete API for widgets in a basic view.
And AbstractField could inherit from ViewWidget.
Fixes country_id and company_id mismatch in 65832dc.
Removes the view added by said commit as it was not a true stable
fix since it required users to update the module.
This commit uses a workaround to get the missing company_id field
which is monkey-patching the fields_view_get of the model, as
suggested by rco.
This commit also removes the exception catches that were rendered
useless by the False value given to the raise_exception parameter
of phone_format, introduced in 65832dc as well.
This commits fixes the behaviour in the website form as the phone
numbers were sanitized but never saved as such on their record.
This commit also renames the Phone Validation config setting to
suit its true functionality.
Rev. dbdd742 introduced the 'baseMode' parameter of field's nodes
in the BasicRenderer. Its purpose is to encode the generic mode
of the field, regardless of its readonly modifier (i.e. in form
views, the baseMode of all fields is the mode of the renderer and
in list views, the baseMode of all fields is 'readonly', except for
fields in the row being edited, whose baseMode is 'edit').
Unfortunately, when the value of the readonly modifier of a field
was 'readonly', its baseMode was changed from 'edit' to 'readonly',
which shouldn't, as the baseMode's value should not be affected by
the modifiers.
This produced a bug when a field had a readonly modifier, as once
its value became true, the field was rendered in 'readonly', and
whatever the value of the modifier afterwards, it always remained
in 'readonly'.
The rev. ensures that the baseMode is no longer impacted by the
value of the readonly modifier.
Closes#22729
Before this commit, on the reconciliation widget in Firefox
filtering lines through the input triggered a Traceback
This was due to the use of the absence of a defined "event" parameter on the handler
After this commit, filtering does work as expected
opw 813791
Before this commit, user see a traceback:
(res_users.partner_id in (3,ARRA.. ...
operator does not exist: integer = integer[]
After update from initial commit
After append from commit 1bb74b7588
Now, extend to allow [1].extend([2,3])
This commit closes#22944
Courtesy of @paulius-sladkevicius for reporting
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.
In master, we should probably make the ParentedMixin set the parent itself.
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.
In master, we should probably make the ParentedMixin set the parent itself.
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
- create a product comp1 tracked by lot
- make an inventory adjustment for comp1 ; 1 quant with lot1 and 1 quant
without lot
- create a bom for product finished1 composed by 1 comp1
- create a mo for 1 finished1, reserve it
- the mo reserved the quant with lot1
- produce finished 1
- unlock the mo
- change the component from lot1 to lot2 (that do not exist)
- the write on a move line will trigger a re-reservation that will
fallback on the quant without a lot (that's how untracked quant for
tracked products are handled)
- delete the move line, it'll unreserve with lot2 and fail
We fix the issue by applying the same logic of fallback on the untracked
quants in the unreserve of a move line.
We add a test for the unreserve of a move, as it simply unlink the move
lines.
opw-814914
The access_token is automatically added by the media editor. It's added
on the website and by the html editor to send by email. The widget display
the attachments from 'ir.ui.view' (public attachment) and the attachment
from the current record.
Issue: can't load image in gmail or mobile because the client mail use a
proxy who avoid ours odoo access.
Deleting/replacing an image through summernote gave unexpected results.
As modifiying the related function may be tricky, this commit instead
wrap them to solve the specific erratic behavior: if the range is in/
matches an image, then simply remove the image and move the cursor to
its previous location.
Create a quotation in sign confirmation mode.
Send it by email
Follow the link
Go the quote's user's portal
Go to the quotes menu, and enter the right SO
Before this commit, although the confrmation mode of a SO
was rightly computed, it was badly retrieved and displayed.
The button on the email was 'accept and pay'
On the portal, the form view of the SO displayed 'pay now'
After this commit, in both cases it displays 'accept and sign' or the like
OPW 806554
related to #22390
Bafore this commit, fields that were not written during on change were kept
leading to having a wrong overall address when changing vat when the return of the API
did not contain the same fields as before.
Also, ZIP from Netherlands were not supported
After this commit, when changing the VAT number, fields that were not set by this operation
are reset to False
Also, NL zip codes compute fine
OPW 807666
Steps to reproduce:
* Create a sales order (SO).
* Assign a carrier.
* Don't press on "Set price" button next to carrier.
* Validate SO.
* Validate picking.
* Delivery line is added to the SO with price 0.
This is because the delivery SO line is added with the value of
picking carrier_price field, but that field hasn't been set.
If you modify on view carrier field, there's an onchange that
fills correct price, so I use that onchange method for getting
same results.
Before this commit, it would do the opposite of what it should:
When 'Do not show this dialog later' is checked, it would remove the
localStorage item instead of creating it.
When unchecked, it would create the localStorage item to prevent the dialog to
shows up again.
Now, we perform the correct behavior.
This closes#10882, closes#11550
This is a small correction of odoo/odoo@3aad756 ; a traceback occured when ESC
was pressed in a list view with modifiers.
The `confirmChange` was done on the parent datapoint (of type list) which has no
attribute `evalModifiers`.
`confirmChange` is now called on the record datapoint. Note that for x2m, it
means that all modifiers linked to the parent record won't be re-evaluated (but
this wasn't probably intended as this is a bit overkill).
Closes#22718
A traceback was occuring when downloading the pivot view without data.
The export function expects the attribute `main_row` set on data, which
is defined in `_prepareData`. The latter wasn't called because of the `return`.
Closes#22728
Before this commit, when filing a phone number field on a model form (typically on website_form),
the module phonenumbers would try to parse the number against the country of the model.
However, this call fails when the number starts with 00 instead of + and that the model
doesn't have a country_id field or if said field is not set.
For this specific case, we chose to skip the number parsing altogether as providing a default
country to the parser can lead to a wrong parsing. i.e, phonenumbers.parse(+32477111111, 'US') will
find the number as US-based when it is a belgian number.
solves issue #22513
Also corrected a faulty behaviour where the option to have a number parsed in its international format
field `phone_international_format` on `res.company` was never properly assessed when the field comany_id of a
model was not present in the model's form view. Added company_id field on opportunity's form view for a proper fix.
Also fixed a syntax error in a logger.
Before this commit:
On portal (My Account > Invoices > Pay Now), a stripe payment in a normal
currency (eg: a non integer currency) would debit the amount *100.
This comes from b335ae0348 which added a workflow to handle integer
currencies but it also sent the *100 amount to /website_payment/transaction
that would create a TX with that amount instead of the normal amount.
Now, the normal amount is correctly sent to the backend, the multiplied amount
is just sent to StripeCheckout handler to correctly display the amount on the
popup after clicking on "Pay Now".
Note: the amount will be multiplied on the backend independently ecda057e11
Before this commit:
When website default lang was not en_US, the translation of fields* in the
web_editor would not be saved correctly.
Let's illustrate with fr_BE set as main lang:
The web_editor's RPC calls does not send language in the context when editing
a page (6ebcc06), but it does in translation mode.
Note that editing is always performed in the website main lang, fr_BE in this
case.
Therefore:
1. When EDITING:
The backend suppose the language is en_US as there is no lang in the
context (hardcoded everywhere).
It then write in the record itself instead of the ir.translation as it
should since fr_BE is a translation. (In Odoo, every lang is a translation,
en_US is always the main lang)
2. When TRANSLATING (in en_US):
It would also write on model as the web_editor send the language to the
backend when in translate mode. But since en_US is recognized as the main
lang (which is correct), it also writes in the model, overriding the
incorrect fr_BE writing which was also wrote on the model.
This has been fixed in 10.0 with these 2 commits:
036ccbe2955bf2
With these fixes, the lang is correctly added (by the backend) if the website
module is installed.
By ensuring the lang is correctly set, the ORM _write() function will process
the edition and translation datas as it should:
- If it receive en_US, it will write on the model
- If it receive another lang, it will write on ir.translation
This closes#10883, closes#22403
*Not the HTML/XML fields which are handled differently by the ORM/translation
Traceback because the `_get_asset` function was called by the
`theme_customize` route without the `values` argument (which is not
necessary for the feature).
Closes https://github.com/odoo/odoo/issues/22516