Before this commit, if extra products are added in a delivery generated
by a sale order, the added products will not be take in account to the
invoice. Now, the corresponding SO line will be created.
Also, the price for the SO lines added this way will be either 0 or the
product's sale price, depending of the product's invoicing policy.
task-2372938
closesodoo/odoo#62874
X-original-commit: 1f0835a9d01b46b5cc617756f854c25541b644a7
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
Commit 49b965eb1ec6a7ec6c07fa643cc6ae35ee8b5d91 introduced
`product_tmpl_ids` into the context for displaying kit components but
did not use it in the domain due to a missing `s`.
This commit adds the missing `s` in the domain.
closesodoo/odoo#62870
X-original-commit: aa135eb966810311837f4d446962850bb5aec82d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
`mailing_list_id` is m2o field and this form is only used in
one2many field, so there is no point to display many2one field inside
form view of o2m.
closesodoo/odoo#51923
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Upon the first call to `onchange`, the `values` dict is filled with
default values. But the fields without a default are left unassigned.
This allows to compute fields when accessing them, but non-computed
fields will ask again for their default value, which is a waste of time
because we know they don't have one. This may even be a performance
issue on forms with many fields.
Fix this issue by completing `values` with falsy values, and consider
the fields with some initial value (given or default) as the assigned
ones for triggering onchanges. This explicitly triggers the computation
of fields that depend on fields with some initial value, without forcing
them to `False`.
Also avoid accessing x2many fields on the record in `snapshot.diff()`.
Enable the prefetching by simply putting the right value in cache.
closesodoo/odoo#62844
X-original-commit: 80c1dad6d9124da9459ce38d9e8c03e5c461c180
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Before this commit the existing tags list contained the unsaved newly
added tags.
After this commit the existing tags list does not contain the unsaved
newly added tags.
Fixes https://github.com/odoo/odoo/issues/62647closesodoo/odoo#62829
X-original-commit: 8520a3ef14dd1e79ace1dea70eebeffb4f21f0eb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the method who check if the user is in
multiwarehouse wasn't call when a warehouse is archived/unarchived.
closesodoo/odoo#62615
X-original-commit: 1ca34276e7684927d8628df9aa592fad7c1a5871
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit adds a pylint checker that will check every override of
`BaseModel.unlink` to verify that there are no raise statements within
the body of the method, if that is the case, an error will be raised.
closesodoo/odoo#58517
Related: odoo/enterprise#13557
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
With this commit, a new ORM api decorator is introduced:
`api.ondelete(*, at_uninstall)`.
This decorator is to be applied to Model methods that check for specific
business conditions when attempting to unlink a record via the
interface.
E.g. trying to unlink a validated journal entry
This decorator allows this logic to exist outside the `BaseModel.unlink`
method and is automatically bypassed when in uninstall mode, this means
that during an uninstall any and all data related to a module can and
will be removed easily and cleanly while still being able to apply
business logic to manual deletion of records.
This feature opens the gates to solving a very big problem with
uninstalls: records and tables that remain in a database despite the
relevant module being uninstalled, because if an override to unlink
raises an error, the data will never be deleted from the database.
Henceforth, overrides of unlink shall solely be used for data-cleaning
purposes, i.e. deletion or modification of data that is related to the
one currently being deleted but cannot be automatically deleted because
there are no proper SQL relations.
In certain very specific, low-level scenarios an unlink may be
overridden to raise an error, but this should only be done if you know
what the fuck you're doing, most of the time you'll want to resort to
`@api.ondelete`.
Note that this new decorator includes a keyword-only, required argument
called `at_uninstall`, in most business cases this argument shall be
False as this argument dictates whether or not this method should be
executed in the `unlink` call during uninstall. It should only be set to
True if you are certain of all the implications which most likely means
that the records of the model in which this ondelete function is defined
will NOT be removed during uninstall, they will forever linger in the DB
until manual intervention, this in turn can mean a wide range of
undefined problems due to crap left on the database.
Following commits will replace any `unlink` overrides that raise
business errors by methods decorated with `api.ondelete`, another commit
will introduce a pylint checker that will raise a warning any time that
an unlink override raises an error.
When you are configuring the picking type used in the point of sale to
not use existing lots and not create lots, the POS still ask you to
encode a lot for product tracked, and the picking created don't use
existing lots in stock because no reservation is made when a picking is
valaidated from point of sale.
As we want to reserve only in this specific case, we are now checking
the options on the picking type to reserve or not product tracked.
We are also not asking anymore for lot or serial number if picking type
is configured that way.
OPW-2377008
closesodoo/odoo#62857
X-original-commit: f9dd1d88d0d24914028464cc12b69ff0878346f8
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Before this commit, in case of Google Translate is enable, some content
can be wrapped in extra node.
Use currentTarget is more secure to get the right element clicked.
**Steps to reproduce:**
1. Add a website and multiple language
2. Create a page in 2 languages
3. Visit the website in Chrome and enable the translation by Google translate
4. Change the language and you should get an error similar to:
Error:
Uncaught TypeError: Cannot read property 'replace' of undefined
closesodoo/odoo#62849
X-original-commit: a2ebc05c83de305bc0323f2793ac06dbc15c63cd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
After a migration, if the payment is using the bank account instead of the oustanding one, we shouldn't block the user in any case when checking the payment consistency.
For example, when writing the matching number on a journal item will trigger the check consistency on the payment. So, you are unable to reconcile any journal items until you replace the account by the outstanding.
closesodoo/odoo#62842
X-original-commit: 28bc59e794f15bf4f7de31e24f496e707ba639dc
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- use a default scale when the viewer is shown, to fit the document to
the available space
- avoid using CSS scaling on the canvas, as this makes the output blurry
- add some zoom controls in the viewer
- fix CSS class for icon on the full-screen toggle (this toggle was
previously not displayed because of it)
- move download button left (to avoid overlapping with "Chat with Us"
box on odoo.com)
opw-2389716
closesodoo/odoo#62836
X-original-commit: 0247a94f252186aae33f5f137021fa04747fa2fb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
steps to reproduce:
- start a certification with time limit
- close it and go to it back after time limit +10 seconds is passed
=> an "There was an error during the validation of the survey." appear
that prevent to finish the survey or do it a second time until the
ongoing survey.user_input of the user is deleted.
This was done to prevent people from cheating by answering after the
time limit end. With this changeset, when we go back to the survey after
its end, we will finish it without saving the answers.
opw-2390623
closes#62752closesodoo/odoo#62770
X-original-commit: 4d088ad719b456e73b7586087084a6d0b59ff455
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: David Beguin <dbe@odoo.com>
- Activate Multi-Currency, set a rate for a foreign currency
- Create a product with a cost of 10
- Create a PO
- Add the product
The price remains 10: it is not converted in the foreign currency.
Up to 13.0, a price of zero was set if no seller was found. This was
changed in 6b41dbf683 to set the standard price instead.
However, no currency conversion is performed.
opw-2394076
closesodoo/odoo#62831
X-original-commit: 315b7f822124fcd06c4c6ea7c8ecb8b7411338c5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
revert of commit 2027721601890870e14b396ae4bb8b6c6dea1ac0
I tried to remove the BoM feature since mrp refactoring it would
probably create some issue and I thought that the feature was not
used. However it seems that it's write in the documentation and
some people realy use it so.
opw-2393302
closesodoo/odoo#62830
X-original-commit: 65a63216a3522922348cd57396db7de36c24a893
Related: odoo/enterprise#15137
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
We go back to the fake textarea to avoid a flickering created by the
`this._textareaRef.el.style.height = "0px";`.
This height reset create an unwanted scrollbar jump that could hide the content
of the textarea (not aside mode).
task-2390354
closesodoo/odoo#62828
X-original-commit: 52f3db8ef61d4284d8ea624022bc1355f7f8cf00
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Bug
===
Sometimes, the registration testing tour failed.
The bug can be semi-deterministic if we add a "sleep(1)" in the endpoint
"/event/<event>/track".
Reason
======
The reason for that is the service worker. It will pre-fetch all the
links in the page (see "prefetch-pages"), so for the "Online Reveal"
we will pre-fetch ~100 pages... If the server is slow, it can cause
issues.
If one endpoint takes some time, all other HTTP requests done by the
service worker will be waiting for it.
So, at the end of the testing tour, the service worker will continue to
make HTTP requests (because it makes the request sequentially) and so
some threads will still be created after the tour.
Even if "_wait_remaining_requests" is called to wait those threads, as
the service worker is still running, it will still continue to make HTTP
requests, creating new threads...
Fix
===
The solution to this issue is to kill the service workers of the browser
when we stop the tour before waiting for the end of the "HTTP request
threads".
Task 2381066
closesodoo/odoo#62827
X-original-commit: 6d08408a33880221b28f0f8a81d699825d927a48
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Steps to reproduce the bug:
1. Install PoS
2. Change the Shop type to "Bar/restaurant" (into its setting) then save
3. Go into the newly created "Bar" settings
4. Enable "Direct devices" (with any IP)
5. Open a session on Bar
6. Pick a table
7. Ignore the "Connection to the printer Failed" error
8. Take a coca
9. Click on the "Bill" button
10. On the Bill Printing screen, pick "Print"
Bug:
A traceback was raised
opw:2382350
closesodoo/odoo#62790
X-original-commit: 00ba9d2d244314ee09ffefb616f9bc3a26027092
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
The rating_card view was not translated for a portal user
opw-2408859
closesodoo/odoo#62698
X-original-commit: 8cd0315702247b65758bd9a392a2520440500485
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Before this commit, the company recordset returned by
env.company/env.companies
was sometimes in sudo and sometimes not.
If 'allowed_company_ids' was specified in the context, the returned
recordset wasn't sudoed.
If no company was specified through the context, company/companies was
using env.user.company_id(s)
as fallback, which is always sudoed since env.user is always sudoed.
With this commit, the behavior is now consistent, we enforce that the
returned recordset is only sudoed if the current environment is.
As everybody has read access on res.company records, there is no need
to return the company as a sudoed record.
When a specific operation has to be done on the company, then a sudo
should be called if needed.
closesodoo/odoo#62074
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Mailing model holds a convert_links method that converts its local links.
It is not used in standard flows as it has more used for external tools.
Indeed sending mailings effectively shorten links without going through
that method.
However sms mailings are not supported by this method. In this commit we
ensure calling this method effectively convert links for sms mailings.
Same as email mailings links in standard flows are already shortened.
This allows notably to fix demo data as links were not converted
correctly as it was calling convert_links in xml.
Task ID-2274770
PR odoo/odoo#56887
Related: odoo/upgrade#1744
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently KPIs reporting on mailings is supported only for mail mailings.
However we think it is interesting to have insights on SMS mailings as well
even if less KPIs are available. Indeed we currently do not support open
or reply KPIs.
This report will be sent by email 24 hours after the campaign sms are sent.
Modification are done of the digest_mail_layout to be able to use it to
generate the KPI report for Email or SMS mass mailing campaigns.
The goal is to have a single template that can be used for both SMS and email
mailings.
Some wording is also improved in various places of KPIs process.
Task ID-2274770
COM PR odoo/odoo#56887
UPG PR odoo/upgrade#1744
When importing an xml in tests, if the import fails, the OCR will try to parse the file, which will cause an user access error. This polutes the logs and makes it hard to debug the code/test. With this commit a helper is added to create and invoice with OCR deactivated to be used to import the file.
closesodoo/odoo#62817
Related: odoo/enterprise#15134
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
Steps to reproduce the bug:
- Connect to Odoo on Safari
- Go in the POS
- Make an order O
- Pay O
- Print the receipt of O
Bug:
Nothing was displayed on the receipt
opw:2391810
closesodoo/odoo#62785
X-original-commit: 50ebca958ab5ab0ea6ab1ec2a54ce8fad488b17a
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Steps:
- Install eCommerce and a delivery method (here, UPS)
- Go to Website > Configuration > Settings
- Select Pricing > Product Prices > Tax-Included
- Go to Configuration > eCommerce/Shipping Methods
- Click UPS US and publish it
- Go to the eCommerce
- Add a product to the cart (here, Customizable Desk)
- Click My Cart > Process Checkout
- UPS has a delivery price
- Select UPS
Bug:
The delivery price of the UPS line has changed
Explanation:
When we first arrive to the delivery selection, prices are computed by calling the carrier's API and are shown straight away. However, when a list item is clicked, a "Delivery" sale order line is generated and the price on the list is copied from that sale order line.
Before 13.0, we explicitly asked customers to click on a delivery method to see its price. Now, it's automatically computed. This fix makes sure the taxes are applied to the delivery prices before clicking on them.
opw:2392281
closesodoo/odoo#62806
X-original-commit: bc2615d8ab5135f21c488c5a260c59605b0da498
Signed-off-by: backspac <backspac@users.noreply.github.com>
SPECIFICATIONS
By default, ORM supports creation of records in batch (one SQL INSERT by
record but batching other operations). When a create override on a given
model is specified as api.model or api.model_create_single this ability
is disabled and records are created one by one. This leads to performance
losses.
In this merge we update create to support batch creation. This allows to
gain performances linked to batch code improvements. Note that some of the
changes done in this merge will not have much impact because some records
are always created one by one. Converting them
* encourages new overrides to support multi record creation;
* provides the basis for a potential future API change to enforce batch
creation support;
LINKS
Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In this commit we rewrite part of alias name uniqueness check as well as
alias mixin alias creation to enable batch create of
* alias records (mail.alias);
* records using aliases through mail.alias.mixin;
See merge commit for more details.
Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
See merge commit for more details.
Note that mail.alias model will be done in a separate commit.
Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
Done for res.partner.bank, res.company and board models. Some override may
have been ignored because heavily linked to business code (like company
in stock).
See merge commit for more details.
Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
When opening all the statement lines from a bank journal, the default sequence was used. We change that for a more user-friendly ordering.
closesodoo/odoo#62768
X-original-commit: 36d2e7d497e30142de989020e7653cb2d7c2d3af
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>