Before this commit, the inverse of `datas` would be computed after the `create`,
which would lead to unnecessary queries, not only for writing the new values,
but also because of the re-computation of fields that depend on these values.
This makes sense because in `create` the "previous" value of a field is
obviously non-existent.
This avoids having to fetch pre-existing attachments when they are known to be
inexistent, which optimizes stored related binary that are computed post-insert.
Before this commit, flushing a model that uses the `image.mixin` would generate
twice as many queries as it should.
This is because `_compute_related` is not meant to be overridden. In the
override of `Image` we call `super()` then post process the records by
reassigning each record's relevant image field with `_image_process`.
The `super()` will assign the field of the records once which
will in turn trigger a `write` (and thus, will generate queries) then
after the `super()` call we reassign them which will re-trigger the same
`write` and the same queries.
With this commit, instead of overriding `_compute_related` we extract the
processing to a method that can be overridden, so that the `write` is called
simply once.
The result, obviously, is that queries related to the `write` are cut in half.
Related PR: #36683 & #36288
Co-authored-by: Adrian Torres <adt@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
This fixes an issue when a Model A with a `many2one_reference` is inherited in
Model B with `_inherits`, and another Model C defines a `one2many` having as
inverse the inherited `many2one_reference` in Model B.
Without this commit, the value of `model_field` is `False` by default for the
field in B, which would lead to incorrect queries when building
`get_domain_list` for the `one2many`.
This commit fixes:
- body of a email.template in a small field
- translation of website_description of a product does not show the
source of the translation
- translation of website_description of a product shows the full
content for the current language
HTML fields are typically fields with longer of content.
If the field is an HTML field, it should be displayed in a textarea,
like the text fields.
Most of HTML fields are split in meaningful chunks of content (using
xml_translate or html_translate method).
For these fields, the source must be displayed.
Also sort the entries on the source to have a consistent order
closesodoo/odoo#37215
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When real cost invoice policy is active in a delivery carrier, the
delivery price is set after validating the delivery. When there is
margin, the estimated price is calculated with margin but when the
delivery is validated, the price set in the delivery line does not
include the margin. This commit fixes this behavior by setting the price
of the delivery line with appropriate margin.
closesodoo/odoo#37178
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were not displayed.
To fix this, we have to revert back the initial position on some elements.
closesodoo/odoo#37076
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were out of the screen area.
To fix this, we have to revert back the initial position on some elements.
Before this commit, web_editor dialog was opened inside an iframe and
not on the window.top. So dialogs didn't take all screen area.
To fix this, we open dialogs in full screen mode but we also put the
web editor in full screen to increase the size of the iframe.
Note that the initial state of the web editor (full screen or not) is
preserved when you close the modal.
We also add some fixes to make the "web_editor media dialog" responsive.
When converting an opportunity to a quotation, it will give 3 options where
the last option is "Do not link to a customer". When clicked it has the
same behavior than "Create a new customer".
Followup of 1d2bccd0db that added the
selection entry but did not implement its behavior.
This commit fixes that behavior. Now it opens a quotation without linked
customer.
Task ID 2065014
closesodoo/odoo#37026
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Having this field required in the view forbade the 'send for digitalization' button of account_invoice_extract to work, as it could be empty there (as the invoice was created via .create({})). The constraint defined in the view was checked before executing the code related to the button and caused everything to fail before running anything.
closesodoo/odoo#37279
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
So the logs contain some indication as to what was exceeding the limits.
closesodoo/odoo#37303
X-original-commit: 0a266f444a0abda026d09ad88024dca1c50c92b9
Signed-off-by: Denis Vermylen <Icallhimtest@users.noreply.github.com>
The field second_amount_type was not taken into account when doing automatic reconciliation and 100% of the remaining amount was always used
closesodoo/odoo#37282
X-original-commit: 8c2ed8849bdf5f6b84f63a01c1b27b83d31e3a8d
Signed-off-by: wan <william-andre@users.noreply.github.com>
-TVA à l'encaissement (vente) 10,0% for sale
-TVA à l'encaissement (vente) 10,0% TTC for sale
-TVA à l'encaissement (achat) 20,0% for purchase
-TVA à l'encaissement (achat) 20,0% TTC for purchase
-TVA à l'encaissement (achat) 10,0% for purchase.
-TVA à l'encaissement (achat) 10,0% TTC for purchase
-TVA à l'encaissement (achat) 5,5% for purchase
-TVA à l'encaissement (achat) 5,5% TTC for purchase
-TVA à l'encaissement (achat) 2,1% for purchase
-TVA à l'encaissement (achat) 2,1% TTC for purchase
also add accordingly fiscal positions
task - 42558
closesodoo/odoo#37266
Signed-off-by: Josse Colpaert <jco@openerp.com>
Since 11.0 88b75f150 the wishlist can't contain duplicates: thus if we
remove an element from wishlist (by adding it to cart or removing) there
is an error next times it is added (since the product is already in
wishlist but archived until next garbage collection).
opw-2074843
closes#37255closesodoo/odoo#37287
X-original-commit: 0b085ce0800f410d5f88615fd18bd633c0d48fb5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
If groups are deleted (or does not exists yet in case of upgrade), it
wasn't possible to update the `account` module.
closesodoo/odoo#37286
X-original-commit: 5c5823f254ab79b5ea4e88aee5b6d088508db9a0
Signed-off-by: Christophe Simonis <chs@odoo.com>
Go to Configuration > General Settings.
Before this commit:
if a setting is None, a stack trace appears.
After this commit:
a warning message is logged in this case, but there is no crash.
closesodoo/odoo#37271
Opw: 2075047
X-original-commit: ed64477d0a9fc58a577d9174a347268186eff70f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Avoid to crash when trying to render an employee's org chart
when in a different company than yours.
- Retrieve the context from the current environment instead of
the `_check_employee` function parameters.
closesodoo/odoo#37251
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Before this commit, when the domain alias was set (e.g. my_domain.com),
the reply-to and the reply-path were filled with default values using
this domain (e.g. reply-to : catchall@my_domain.com and reply-path:
Return-Path: bounce+number@my_domain.com). As we have a second SMTP
server, the certified email
(https://en.wikipedia.org/wiki/Certified_email), with a different domain
than the domain alias filled in the settings, the SMTP servers will
arise an error : "SMTPRecipientsRefused: Sender address rejected: not
owned by user", this error arise because the domain of the certified
email is different from the one setted in the settings, is also
different from the domains of the reply-to and the return-path.
Now, when we know that we are going to use the certified email SMTP
server, for example to send invoices to the Italian government, the
email will be sent without a reply-to or without a reply-path. This
behaviour is exactly the same as the behaviour will have if we didn't
set a domain alias.
opw-2045244
X-original-commit: 66c5053
When having a long systray (icons from different apps, mode debug,
multi-company...) the resize of the window can trigger a crash for apps
that have not too much top-level menus (e.g. Contacts).
This also happens when loading those apps.
Steps to reproduce (on an iPad, portrait):
* use a Runbot with all modules installed (12.0+)
* activate "debug mode"
* ensure that the menu/systray bar is quite full
* open the "Contacts" app
=> traceback with a "cannot call getBoundingClientRect of undefined"
error
The reason is that the resize's callback iterate over the systray/menu
items to find which one should be folded behind a "more" ("+") menu
item.
Sadly in some cases (combination of screen width, systray size, app's
number of menus) it can lead to a traceback.
This commit ensures that when looping for menu items, we don't try to
reach an non-existing item.
closesodoo/odoo#37245
X-original-commit: d7bae0329990171710acf2d9c0d4d9579cba2c0e
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
Before this commit, when printing an invoice that has at least
one tax which is part of a tax group and some repartition lines
On the invoice pdf the group of tax contained twice the base amount for that
tax
After this commit, the tax group contains the base only once
OPW 2073989
closesodoo/odoo#37226
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
omission in d26e253edd
kill -3 (SIGQUIT) is not processed like the other signals so it doesn't
go through this bit of code, but leaving the AttributeError lurking
there is not a good idea.
closesodoo/odoo#37221
X-original-commit: ac65ef0208a5ec814d263aeb44a98b47a5ee3947
Signed-off-by: Denis Vermylen <Icallhimtest@users.noreply.github.com>
If SQL, if you do
```display_type IN ('line_section', 'line_note') OR account_id IS NOT NULL```
and `display_type` is `NULL` then you can only have `'t'` because
`SELECT NULL OR 'f';` yields `NULL`
`SELECT NULL OR 't';` yields `'t'`
The check of NULL is not blocking, hence the constraint doesn't work.
closesodoo/odoo#37075
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- Create a survey with one page per section.
- Go to the second section and select an answer.
- Go back to the first section using the breadcrums.
Before this commit:
if you go back again to the second section, you will see that your answer
wasn't saved.
After this commit:
answers are saved even when navigating with breadcrums.
closesodoo/odoo#37157
Opw: 2072948
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Prior to this commit, the documentation page for the installation of Odoo had lots of inconsistencies, errouneous information and a bad structure.
This commit restructures the page to split the Source Install chapter into three sections for Windows, Linux and Mac OS.
Each section is entirely rewritten to be accurate, logical, clean, easy to understand and focused on its purpose (removed tutorials of non-Odoo softwares).
task-2072822
closesodoo/odoo#37001
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
on a picking, move_ids_without_package is a subset of move_lines.
The inverse function on move_ids_without_package only work well when we
add a move.
This commit improves the inverse function to take deletion into account
closesodoo/odoo#36558
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Payment tokens created before the installation of this module and that
used the Charge API did not need to keep the card reference on Odoo's
side - since we were allowed by the API to simply specify a customer
reference when creating a charge and it would take the default one for
that customer. Odoo creates one customer per payment token (even if it's
the same partner), so there was no uncertainty there.
Now, with the PaymentIntent API, the payment method reference is
mandatory. We have a field to keep it in db, but this info needs to be
retrieved for tokens created before the module's installation. This fix
introduces that remote call.
closesodoo/odoo#37206
X-original-commit: 1b760a988fdf7bbc08b92e0705929d5620356a2f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The computation of kit quantities was not efficient. A loop on each product
of the recordset to consider performed. Each time a product was seen as 'not a kit',
a new computation on the complete recordset was done. This leads to a N^2 complexity
This commit only compute stock quantities for non kit product in one batch
opw-2070768
closesodoo/odoo#37205
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
From Accounting app under the kanban card "Bank" click on
"Reconcilile items". Select a line to reconcile with a selected partner
or counterpart (or input one) and then filter the underlying lines using
for example the name of the record
No filtering will occur, this is due to commit 900d89c997.
The domain used by the filtering function is matching all lines
from the current partner instead of restricting the search to
the filtered elements.
Reverting that commit and providing a fix for the original issue:
removing a check on the partner id make a logical separation between the
domain involving the partner_id and the one related to the search string,
so that they do not interfere with each other (at most they will overlap).
Preserving tests from the reverted commit and adding some more as well
opw-2070458
closesodoo/odoo#37179
X-original-commit: d434251f3350e033843d941b48cf84f7de28d20f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Commit fff2a30 introduced a popup on sale order line to show some information about available quantity
of the sold product.
This commit adds various imporvement on this widget
closesodoo/odoo#36995
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
SPECIFICATIONS
* Remove the /home from the breadcrumb in user profile
* Rename the Home (on a specific course) into "Courses"
Task 2062640
closesodoo/odoo#36900
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Customer invoices and supplier refunds lines involved with taxes will be credit lines, hence their balance must be inversed when shown in the tax audit field.
The method is_inbound() encloses exactly those documents, whereas is_outbound() stands for customer refunds and supplier bills.
closesodoo/odoo#37092
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
From the settings activate:
- Multiple Sales Prices per Product
-- Prices computed from formulas
- Discounts
Create a pricelist with discount policy "Show public price & discount to
the customer", set the price calculation formula:
- Rounding: 10
- Price discount: 10%
Modify the sale order xml list view adding 'digits="[3, 2]"' to the
discount shown in the sale order line.
Create a sale order with such pricelist and on the so line put a
product with quantity 1 and sale price 4190 (VAT 19% included in the price).
The discount will not display the requested number of decimal digits (2)
in list view, but it will when editing the field.
The cell formatting is done calling the appropriate function (formatFloat),
which search the digits option from the 'options' parameter or from the field
definition. The latter stores the default digits coming from
the DecimalAccuracy settings, which, as side effect, alter the behavior
of the discount calculation.
https://www.odoo.com/web#view_type=form&model=project.task&id=2069939&active_id=2069939
When passing into edit mode the field is created as widget, parsing its options
which have 'digits', instead when coming back in list mode it is "just a
float field" rendered directly from the list_renderer which no options,
so the formatFloat will look at the field definition
https://github.com/odoo/odoo/blob/12.0/addons/web/static/src/js/fields/field_utils.js#L172
Adding the correct parameter to the dictionary passed to formatFloat
during the list rendering is a possible solution, because it is the
"closest" point in which parsing the parameter is possible without
touching higher level code or forcing the creation of a widget (adding
widget='float' as xml parameter).
closesodoo/odoo#37167
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Initial bug report, full of red herrings:
receive two support requests by email while on Odoo.sh, the first creates a
ticket, while the second replies to the server with the error:
550 Requested action not taken: mailbox unavailable
When a request is done, the service check function tries each request multiple
times when getting Operational errors.
When two email are received within a 'short' amount of time (e.g .1 second)
the two requests are initiated with a new cursor.
When both mails generate the creation of a new record of the same model,
the second cursor is going to fail because of an:
ERROR: could not serialize access due to concurrent update
However, the record we used in the computations needed in the creation of the
second record have been added to the environment.
When that second creation is retried, it will operate on the same records,
and find them in the todo, with the environment that was obtained for the first
trial. Since the cursor is closed, this crashes.
To explain the bug report, Odoo.sh transfers the mail through an xmlrpc
to process the mail.
Because of this crash, the server interprets the lack of well-formed response
by a generic 'mailbox unavailable'.
opw 2060476
closesodoo/odoo#37165
X-original-commit: 845eecdfa7b27d84862e94f4b63d40a851e0c410
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Display the difference when an unbalanced journal entry is created to
help pointing out the source of the issue.
opw-2069673
closesodoo/odoo#37145
X-original-commit: d00e3158cd30067f7cc8d524eff81ccd6e620342
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: jev-odoo <jev@odoo.com>
- Add the following in a PDF report:
```html
<p>
<blockquote>
<ol class="loweralpha simple">
<li>Item that explain terms</li>
<li>Another item that explain something else</li>
</ol>
</blockquote>
</p>
```
- Print the report
Wkhtmltopdf crashes with the error:
Wkhtmltopdf failed (error code: -11). Memory limit too low or maximum
file number of subprocess reached. Message : b''.
This is a known issue:
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4115
Actually, since this CSS is only used for Wkhtmltopdf reports, we can
simply remove the CSS rule causing the problem.
Closes#37034Fixes#37033
opw-2073195
closesodoo/odoo#37155
X-original-commit: 8d08893172ae8c0f3ad1f1af6ab9514aa30bf843
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In case where no argument is given to _compute_price_rule, it would default to
context_today().
This gives "today" in function of the context, depending on the user timezone.
In contrast, an explicitly given date would always be UTC.
Furthermore, on the webshop an unlogged user would get the Public User timezone,
and once logged would get its portal user's timezone.
To make everything coherent, we always use UTC.
opw 2054881
closesodoo/odoo#37154
X-original-commit: 35d4a8ccce8f3a34701d231e17a324cbbf5abfab
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>