- Create a product with variants
- Create a BOM for this product
- Add a component, specify a variant in 'Apply on Variant'
- Change the product of the BOM
The 'Apply on Variant' fields remain filled, although it doesn't apply
anymore to the new product.
opw-1943918
closesodoo/odoo#31435
In some special instance, a mention could get linked and the user would
not really be linked.
This is because of a difference between linking the mention and adding
the user as follower that required a space after the mention.
With this change:
- `[adding mention]@admin [backspace].`: was linked but not added as
follower => now it is not linked either.
- `[adding mention]@admin [backspace][enter][adding mention]@admin `:
the first @admin was linked => now the second is linked
Without the change, added test fails with:
"should not contain a link in the message content"
"should not have linked mention without space"
opw-1934946
closes#31433
The SSF would properly mark its own records as deleted, but it would
not properly handle deletion requests coming from an onchange, and it
would not necessarily convert DELETE_ALL commands (5) into the proper
sequence of individual (2)s matching existing records.
closesodoo/odoo#31431
Before this commit, we used dict keys before they existed
And made the share button crash
After this commit, there is no crash
OPW 1943301
closesodoo/odoo#31427
The margin-top/margin-bottom on a address on the top of the report does
not work because:
- display flex on an address in wkhtmltopdf is not perfectly implemented
and seems to remove vertical margin
- margin-top on the page first visible element is removed
To fix this issue, this code remove the display:flex on the address
widget and add an empty "visible" element at the start of pages.
opw-1925894
closes#31184
Before this commit, the template that was rendered when sending
an email to a customer to invite hime to pay online
was not translatable
This was because the override of the template did not have an xml_id
After this commit, it is translatable
OPW 1944258
closesodoo/odoo#31396
When the currency used for a payment/internal transfert is not the same
as the company currency, the prices shown in the reconciliation
suggestions are computed using the company currency.
1) Enable multi-currency.
2) Setup two bank, one in USD, the other in EUR.
3) Leave the company currency to USD.
4) Create an invoice for a partner targeting the EUR bank and
validate it.
5) Create a bank statement for the EUR bank amounting the **exact**
value of the invoice for the **same** partner and reconcile it,
this will create the payment behind the hood.
6) In the reconciliation the invoice appears as suggestion, if the
currency symbol is correct, the amount is shown as USD.
opw-1937202
closes#30623closesodoo/odoo#31290
Have an editable list that begins with a date/time field
create a line.
The first field is focused and the datetimepicker is popped up
Now, stroke ESC key
Before this commit, there was a traceback because the datetimepicker received an erroneous
BLUR/INPUT event
After this commit, there is no traceback as we detroy the widgets of the line
(including the datetimepicker) before removing the row from the DOM
OPW 1932409
closesodoo/odoo#31342
For a translated field with a callable method (e.g. xml_translate), when
modifying the value of this field in another language than en_US, the master
version was lost.
Before this patch:
>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Titre</h1>"
>>> record.arch
"<h1>Titre</h1>" # lost English version
After this patch:
>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Title</h1>" # write had no effect
>>> record.arch
"<h1>Title</h1>"
When modifying a translated HTML field in English, a matching to detect the
difference and avoid losing the translations is done.
This is not supported for update in another language.
The main reason is the difficulty to detect changes in the architecture.
To update translations, the supported way is to go to the list of translations
and update them there.
Before this patch, the given value in another language was given to the SQL
query and made an update in database:
if single_lang or not (has_translation and field.translate is True)
-> True or not (True and False) -> True
If a field is callable, it should also be ignored, the same way than
translate=True fields
opw-1887162
closesodoo/odoo#31330
Let users A, B be in in companies C1 and C2,
such that A is currently in C1 and B in C2.
User A tries to assign to B an activity on record R belonging to C1.
It fails because at the time of the check B is not in the correct company,
even if B could handle the activity after switching company.
The _check_access_assignation was added in commit 96a223a5f0,
to avoid activities to be created for records that the target user can't read.
Previous use-case is a legitimate one where we want to bypass this restriction.
Note that the systray notification widget is not company dependent,
and there is no way to remove a notification on a record the user can't read.*
In case where the record is company dependent and on a different company,
we skip the record rules check.
It is assumed that the check would fail because or company-related record rules.
It will create some unwanted activities, but only the minimal number we can let
through while allowing for all legitimate flows.
*Better solution for master is to give the user some more explicit message
if reading the record, suggesting to switch company,
or to allow to dismiss the notification altogether.
opw 1933862
closesodoo/odoo#30810
Have a SO; accepted and signed; and the client choose to pay with wire
transfer.
Before this commit, the transfer's transaction is never updated to 'done'.
Even after the invoice is created and the payment is encoded and
reconciled. The client will continue to see the pending message.
Now, when the SO is confirmed, the transfer's transaction is set to 'done'.
The client will see the done message.
opw-1935516
closesodoo/odoo#31352
Before this commit, it was impossible to search anything in the list view
when doing a Inventory Valuation > Current Inventory
After this commit, a few meaningful fields are searchable
OPW 1943676
closesodoo/odoo#31356
fix retro compatibilty
Old qweb template http_error_debug was wrong, but we never entry in the if.
Now that we fixed to enter in the if, we need to make retrocompatible code to
be able to display the QWebException from v9 with the old view from v8.
odoo.exceptions.QWebException
vs
odoo.addons.base.models.qweb.QWebException
closesodoo/odoo#31383
The issue happened when a user which does not have access to some fiscal
position try to print a sale order. In this case a traceback is generated.
In order to avoid the traceback and to be able to print the report
the access rights are bypass thanks to a sudo() in the report.
OPW-1943727
closesodoo/odoo#31357
Before this commit, the unit price in the invoice's reports, had the
same decimal precision as the currency and not the one specified for the
unit prices.
Now, the reports shows the unit prices with their specific decimal
precision.
opw-1940406
closesodoo/odoo#31314
This rev. fixes 3 issues with async (field) widgets in the kanban
view.
From rev. 5faec34a, widget'$el doesn't exist before start. This
means that for async widgets, one can't interact with the widget's
$el right after calling appentTo. In KanbanRecord, this is exactly
what we did for both field widgets (<field name=.../>) and widgets
(<widget name=.../>).
Moreover, when the kanban view was updated (e.g. when the user
refined the search using the search view), and the rendering was
async (because of the presence of an async widget), the renderer
didn't wait at all for the widget to be ready before updating the
view. This caused flickering, mostly, but also a crash in
accounting with the JournalDashboardGraph widget (because
on_attach_callabck was called before the widget was ready). To
reproduce this particular issue, go to accounting, add a filter
that doesn't match any record and save it as favorite (default),
press F5 (no record is displayed), remove the filter.
opw-1925079
opw-1925479
Fixes#30087Closes#31254closesodoo/odoo#31327
Go on the website, create a new product from there
Click on the image to change it, select an unsplash image
Save your product.
Beforer this commit, the image wasn't saved because the qweb field image
did not know what to do with /unsplash/ urls
After this commit, the image is saved on the product (or any object...)
OPW 1936191
closesodoo/odoo#31328
- Create a product category A
- Create a product category A1
- Add a product in A1
- Launch an inventory adjustment on A, and select 'Exhausted Products'
All products (even from other categories) are included.
Since there is no product found in the category `products_to_filter`
and `quant_products` are empty. Therefore, we fall back on
`[('id', 'not in', [])]`, which selects everything.
The root cause is that we don't include child categories. There is no
real point of doing so.
opw-1932192
closesodoo/odoo#31322
This is necessary to get --dev=xml working on windows, because the xml
import uses normcase in file_open and the case normalized filename is
then used to find the addon path (which was not found before on windows)
With this fix arch_fs is now correctly filled in windows and --dev=xml
works.
closesodoo/odoo#28331
Usecase to reproduce(or any other way to lower initial demand on move):
- Build a MO with 5 products to do
- Produce 3
- Update the quantity on the mo to 3
-> All the consumed quantity on move lines is dropped.
It happens because lowering the initial demand on a move
will call unlink on its move lines. (increase it will
update the move's state and reassign if it comes from a supplier)
Instead of dropping and reassign the move in order to change
the reservation, it is possible to directly write the new
reserved quantity on the move lines and that will update the
reservation on qaunt directly. Also we don't want move lines
without reserved quantity and quantity done thus we drop them.
closesodoo/odoo#29941
Add a check to see if we're in test mode that returns an InsufficientCreditError to avoid failing other tests if partner_autocomplete server fails
closesodoo/odoo#28324
web_editor dirty elements are saved by calling the ir.ui.view `save()` method.
As this method is called through call_kw _rpc on the ir.ui.view model, self
is binded to the view which has the `id` sent in the request.
In some cases, when editing a field for example, the id sent is the id of the
field's record (eg: product.template for price field).
In that case, the view binded on self will be the view with the id of the
field's record being edited.
If there is no ir.ui.view with the same ID as the field's record, self won't
exists.
This misbehavior resulted in no error luckily since we only use self to call
ir.ui.view methods without ever using self properties.
Since multi-website 47b00c5d53 overrided the `save()` method and used self.key
it was crashing when the self record did not exists.
This commit will fix that by doing the multi-website check only when it is a
view and not a field that is being edited. (We know that if xpath is set)
opw-1904637
Step to reproduce:
- Go to a product on ecommerce, eg product.template 13013
- Edit the product price field, the oe-id attribut is 13013
- Delete the ir.ui.view that has the same ID than the product (13013)
- Save -> It will crash since self is binded to "ir.ui.view(13013,)" but it
does not exists and we try to access key
closesodoo/odoo#28469
Steps to reproduce the bug:
- Let's consider three products P1(in Unit), P2(in kg), P3(in Unit)
- Create a BOM kit for P1 whit 1kg of P2 and 1 Unit of P3 as components
- Create a SO with P1 and validate it
- Go to the shipment and validate
Bug:
An error was raised saying:
The unit of measure kg defined on the order line doesn't belong to the same
category than the unit of measure Unit defined on the product. Please
correct the unit of measure defined on the order line or on the product,
they should belong to the same category.
PS: The quantity delivered on a SO line must only be computed for the product
defined on the SO line. Otherwise with a BOM kit, the sum of all its components
was done instead.
opw:1905223
closesodoo/odoo#28460
* web, web_editor
The logic which chose if the user text color was supposed to be used as
bootstrap "dark" text color or bootstrap "light" text color
(https://github.com/odoo/odoo/commit/8b2dbd1441d6713d9072db03e8d3cb6c2246410f)
was fine when using the default theme with default bootstrap but was not
working as intended in some themes.
This commit also introduces a more accurate and complex method to
determine the correct contrasted color in most cases.
closesodoo/odoo#28468
When a user accesses a PO through the portal thanks to an access token
(without being connected), the product image on each order line is
rendered using the image placeholder with a size of 48x48.
This raises a 403 Forbidden at image retrieval since the access token is
not passed as a parameter. This commit corrects that behavior by sending
the resized image along with the rendering of the template instead of an
url.
Another solution could be to generalize the access token check to any
model in:
https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/models/ir_http.py#L303-L311
But this seems overkill regarding this specific error.
opw-1902741
closesodoo/odoo#28479
- Configure custom payment instructions
- Create a SO, send it by email to the client (do not validate)
- As the client, open the link received by email and 'Accept & Sign'
- Click on 'Pay Now', choose 'Wire Transfer'
The page reloads and shows the message:
> Pending... The order will be validated after the payment.
along with the custom payment instructions. However, no communication is
provided for the payment.
First, the `reference` is never set when calling the
`payment_confirmation_status` template, as it is done in
`portal_invoice_page_inherit_payment`. Moreover, in this workflow, the
reference is never set on the SO because of an incorrect filtering in
`_set_transaction_pending`.
opw-1906464
closesodoo/odoo#28466
Following commit b43151c11c
The order of the pricelist items on the interface was made deterministic, but
there was still a problem with the actual computation because the SQL was
created manually and used a different order than the _order of the model.
Moreover, it is better to use id DESC instead of ASC to make sure the
automatically created default rule matching everything is actually applied last.
PR: #28476
Some code is in charge of setting the same min-height for all items of
a carousel to the natural height of the tallest item, once the page is
loaded. This code was not working correctly in the case the natural
height of this tallest item depends on the height of one of its inner
image, as we have to wait for the image to be loaded in that case.
closesodoo/odoo#28159
When there is a language and its base language translation files in a
module, in 12.0 an empty translation in the language translation file
will not fallback on the base language.
eg.
fr.po : {'one': 'un', 'seventy': 'soixante-dix'}
fr_BE.po: {'one': '', 'seventy': 'septante'}
=> the translation in fr_BE will be {'one': '', 'seventy': 'septante'}
but before 7288b477 it would have been {'one': 'un', 'seventy': 'septante'}
With this commit, an empty translation is no longer created so does not
override base language.
Also the intention of d84b795b0a that was also lost is restored by
upserting only noupdate==false translation, and inserting the other
ones.
opw-1904638
closes#28297
Since the opt out per mailing list, the intermediate model was used
to list all the recipient of a mailing list. The side effect was that
importing new contacts into mailing list was not possible anymore.
Also, creation of a new contact into a mailing list was made indirectly
by creating a new many2many record between contaxct and list, which was
not really user friendly.
This commit restores the mailing contact model as the view of the mailing
list recipients. In other terms, the contact import is restored.
An opt-out computed field as been added to be able to filter on opted out
contact inside the mailing list recipients view.
This opt_out field SHOULD NOT be used in a form view as it need the active
mailing list id in the context in order to be computable and searchable.
This field has no sense without this active mailing list id context.
Task ID 1891228
Linked with blacklist and opt out per mailing task (ID 33224)
Closes PR #27632