The filters for sponsor countries works by adding a domain term on
`partner_id.country_id`. Currently this is evaluated by the ORM by first
searching for all partners in those countries, and then substituting the
IDs in the final query (`partner_id in <ids>`).
On large databases with many partners, this makes the filtering really
slow (e.g. 3 seconds with 1M partners), even though only a few sponsors
actually match.
From a security standpoint, most of the data on the linked partner is
already available on the sponsor through related fields, and those
partners are only visible when they are already published anyway.
Besides, the calls in `_event_exhibitors_get_values` are performed
in `sudo` mode.
It should be noted that `res.partner.country_id` is not currently
indexed, and doing so helps marginally: the query goes from 3000ms to
800ms. It is still much slower than with `auto_join`, which makes it
go down to about 1-2 ms on the same dataset.
Indexing `country_id` does not help make the `auto_join` version faster,
as it only requires the primary key index to find the records.
closesodoo/odoo#66692
X-original-commit: b5246315875dfad151fcb23936499750e0f1f42a
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Steps to reproduce the bug:
- Create a multi-company environment with two companies A & B
- Create two sales taxes TA & TB, one for company A & one for company B
- Created a shared product P and assign both TA & TB
- Create a fiscal position FP that maps TA and TB to other taxes
- Login with user having access of both companies
- Enable a POS session S with fiscal position and select FP
- Open S and select P as product
Bug:
A traceback was raised
PS: Only the taxes of company's user are loaded in taxes_by_id
So when trying to fetch taxes from a product with function get_taxes,
the taxes from other companies than company's user must be ignored.
opw:2448785
closesodoo/odoo#66724
X-original-commit: 5dcfdcb265a7217fd52ab5b7e3e51cc5c2430761
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This fix (odoo/odoo#46850) was too permissive and fix too much
stock valuation issues (other than rounding error) under the hood.
The problem of the "too permissive" is will hide some errors
without get any feedback about them. Also, it changes the SVL value
without any explanation.
To avoid the first issue, apply a threshold on the rounding adjustment.
This threshold is '(quantity_out * smallest_value_of_the_currency) / 2'
(`smallest_value_of_the_currency` = `rounding` field of the related
currency).
Also to improve debugging, add a line in the description
about the rounding adjustment done in a SVL
task-2452786
closesodoo/odoo#66725
X-original-commit: a169d62e8999e90743401fcfe85200450ac6c628
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
To reproduce:
1. Activate pos_hr feature.
2. Authorize an employee with pin.
3. Open a pos session and login with that employee.
4. [BUG] The popup to input pin is broken.
This is because of the 'minus' button. In this commit, we make sure
to hide the 'minus' button when the popup is used to ask for pin.
closesodoo/odoo#66716
X-original-commit: 67dc3b2a1f1a1ca938682706bf1fc20c511d4ab0
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Issue
- Install Inventory module
- Go to Inventory -> Reporting -> Inventory Valuation
- Click on "Inventory At Date" button
- Select any date
The datetime in breadcrumb is displayed in UTC.
Solution
Display datetime in current user timezone.
opw-2464744
closesodoo/odoo#66721
X-original-commit: 235386e4e6c8a4b55e9bee5dd901c611cd7950da
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
When switching employee on point of sale, we may have a PIN to enter.
If we enter the barcode and there is a PIN, we get an "Invalid Password"
error.
Why:
====
When we switch with a barcode 12, the barcode system will catch events
and prevent their propagation:
- {'type': 'keypress', 'key': 49}
- {'type': 'keypress', 'key': 50}
- {'type': 'keypress', 'key': 13}
For respectively '1', '2', 'Newline'.
If it match an employee, the PIN number modal is opened which will
listen to KEYUP events => it receives very shortly:
- {'type': 'KEYUP', 'key': 13}
which is the newline character which follows the KEYPRESS.
With a "Return" key received, the PIN modale closes with empty value
and an error "Invalid Password" is shown.
Solution:
=========
Ignore the newline character if no number has been selected.
opw-2448585
closesodoo/odoo#66466
X-original-commit: d056feb4ac885acc6c829c57531b985027d94daf
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Joseph Caburnay <jcb@odoo.com>
This commit unpins a livechat channel initiated by an admin when
it's closed and no message has been sent
closesodoo/odoo#66703
Task-id: 2276571
X-original-commit: becb242a43ed559bc7729b979f03743b729ce16c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The `mail` module logs bus notifications it does not handle. However, some
notifications are not meant to be handled by `mail` and it's perfectly fine.
This commit removes the log to avoid useless noise in the console.
closesodoo/odoo#66683
X-original-commit: e0ae3c6270467985a4d56c902ef109ffc5513b13
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Do a transfer in two steps with several move lines (e.g.: Vendors => Input => Stock).
In the first picking, set quantity = 0 on a single line. Transfer it and say 'No backorder'.
In the second picking, set all quantities (you have two move lines confirmed and one canceled). Validate the
transfer. The backorder wizard is launched. It should not.
closesodoo/odoo#66680
X-original-commit: 79d834f2c2ec167831fe0986afb728207a467d67
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Remove minified ePOS library and replace it with direct calls to the
web server of the printer.
closesodoo/odoo#63403
Taskid: 2417429
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
The executing function for FieldCommand should return boolean value
to indicate whether the value changed for triggering the re-computation.
closesodoo/odoo#66681
X-original-commit: a3f5d0b292361a4aa3af8e7662f74150c5d85254
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Scenario:
- go to /slides and start editing the page
- change the position of background banner
- save
=> traceback
Why:
The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).
opw-2427560
closesodoo/odoo#66643
X-original-commit: 96c22e816981d72c185520750167c514c6bded5b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Commit e5ab8cf9623bc436f43706926bc6ee596c549244 missed a use case.
Steps to reproduce:
- Activiate "Packages" setting in Inventory
- Configure an operation type to "Move Entire Packages"
- Create a "Planned Transfer" picking with that operation type and add a
package to be moved
- Turn off "Move Entire Packages" and try set the destination
package of the move line to nothing (False).
Expected result:
Move line has no destination package + package level is deleted as
expected.
Another bug will still exist due to the design of package_level where if
in addition to the above use case, if a different package is used instead
of deleting it and "Move Entire Packages" is reactived => final package
shown in the Detailed Operations will show all move lines as being part
of the same package even though they are not. Data appears to be correct
in the database otherwise and a reasonable fix doesn't seem feasible for
now so we leave this bug as is.
Related to Task: 2418907
closesodoo/odoo#66638Fixes: odoo/odoo#66542Fixes: odoo/odoo#66517
X-original-commit: a73505ddafe9ce6f4f3e9896494900d419a815bd
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Steps:
- Login as an admin user
- On a fresh branch install event_crm
- Give a "test" user access rights of "Own Document only" in the "Sales"
app, nothing in "Events"
- Assign any lead to "test" user
- Login as "test" user and try to access your own leads
Bug:
Error: While parsing modifiers for button: for modifier "invisible":
Unknown field registration_count in domain
Explanation:
The button `event_registration_action_from_lead` tries to access event
registrations even if the user doesn't have access to events.
opw:2462127
closesodoo/odoo#66599
X-original-commit: 29be97615554337591f0b31ba34942c2d728cbef
Signed-off-by: backspac <backspac@users.noreply.github.com>
Before this commit, 'hours' was on the next row instead of the same line.
closesodoo/odoo#66640
X-original-commit: 6820eef1e9dfe2695560ebcf265a5d69c38e4f91
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Writing on x2many field should be done last, because deleting x2many
lines causes pending computations and updates to be flushed. Writing on
column fields after that inevitably adds extra update queries.
We introduce an attribute `write_sequence` on fields to order fields for
write. The prescribed order is: all fields except monetary and x2many,
monetary fields, x2many fields.
closesodoo/odoo#65959
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
The goal of this change is to simplify the code managing `create_date`
and `write_date` in methods `create()` and `write()`, and also to remove
weird behaviors caused by the way those fields were updated.
Assume we update a simple field on a record. This adds pending updates
for the field and `write_date`. However, the value of `write_date` is
not known yet: it will be updated as `NOW() AT TIME ZONE 'UTC'` in SQL.
So `write_date` is actually given a dummy value in pending updates, and
it is invalidated from cache, until its value is flushed to the database
and fetched again.
Now assume we access another field on the record, and that field is not
in cache. The prefetching mechanism will read all column fields,
including `write_date`, and flush them first.
# this adds pending updates foo: 42, write_uid: 1, write_date: False
record.foo = 42
# assume 'bar' is not in cache; this prefetches all column fields,
# which flushes the pending updates above before reading them back
result = record.bar
We can avoid flushing pending updates if the values read from database
do not overwrite existing values in cache. If you assume that the value
of a pending update is in cache (in the example, `foo: 42`), you don't
need to flush the corresponding field. Indeed, the value of `foo` will
remain 42 in cache, whatever its value in the database. This assumption
(pending updates are in cache) is true for all fields *except* for
`write_date`: it is invalidated from cache, and given a dummy value in
pending updates. This branch actually makes this assumption true for
all fields. The avoidance of flushing pending updates will be done in
another commit.
In order to directly assign `write_date` its value, we use a cache for
the value `NOW() AT TIME ZONE 'UTC'` from the database. This costs at
most one query per transaction, and potentially saves a few queries.
Co-authored-by: Victor Feyens <vfe@odoo.com>
Adapt some query counts to their optimal value, in order to measure the
effect of the following commits on queries.
In module test_performance, some query counts were actually not correct:
the initial flush() done by the context manager assertQueryCount() may
prefetch some data to the cache, and that prefetching is not accounted
for in the query count. This is very true when assertQueryCount() is
preceded by a cache invalidation. We have to move the invalidation
inside the context manager, so that the prefetching is now counted.
- Go to the website
- Drag a "Tabs" block on the page, you will have 3 example tabs
- Click on the tab "Contact" and drag in the block "Image Gallery"
- Add multiple images to the image gallery
- Click on one of the other tabs so that the image gallery is hidden
- Save
The image gallery do not have the thumbails anymore.
This occurs because when the carousel-indicator is hidden, jquery is not
able to fetch its real length, so no icons are added.
opw-2438513
closesodoo/odoo#66608
X-original-commit: eeb6eea90b9d44a42b1cc4f6b6f6c29cc7370d26
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, in some cases the attachment of the Belgian EDI might not exist any longer when printing the pdf, which caused a crash when trying to embed it into the xml.
closesodoo/odoo#66605
X-original-commit: ec72e3f02f4854870faccdbbb1048e5be62fa6af
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
Let's assume the following scenario:
- have an action in target new (e.g. a form view)
- in the dialog, have an action/object button with confirm
attribute
- when clicking on that button, a confirm dialog opens
- if validated, the following action returned by the server
is again an action in target new
Before this commit, the confirm dialog remained in the DOM.
This issue occurred because it's parent wasn't correctly set (wrong
use of `this`), so when the first dialog was destroyed, the confirm
dialog wasn't automatically destroyed in turn.
OPW~2440712
closesodoo/odoo#66597
X-original-commit: 98f9cb4f692a15494cd8ef298673fe1c949c423c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
There is only a single mail template for invoices at the moment.
To make things easier to work with, this will add a new template for
credit notes.
Task id #2343331closesodoo/odoo#58244
Signed-off-by: William André (wan) <wan@odoo.com>
before this commit: when there is only one page in the notebook tag and
there is a boolean field in form to show/hide that notebook page based on
invisibility attrs, if we toggle boolean field notebook hides, that's OK
but when we toggle boolean field again then notebook page is displayed but
it is not active and due to that content of notebook page is not displayed.
after this commit: when there is only one page in notebook and it has attrs
for invisibilty, when we toggle boolean field to hide/show notebook page
then notebook page as well as content is toggled.
task-2449053
closesodoo/odoo#66582
X-original-commit: a0b5ecd344d6ac79d8e4d194cfabf3d639259c73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Open POS, add something to the order, go to checkout, add payment,
double click on validate
js error will popup
opw-2429523
closesodoo/odoo#66571
X-original-commit: c3aea6783b8bfb3af383ae881af247fa5507e99f
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Since commit 2716828f25, the error dialog
has an additional JS lib dependency, which means that it may needs to
perform a request before it opens up. However, a test in the
crashmanager was only waiting for a next tick, which is possibly too
short for a network request.
So, depending on the network speed (and on the test order), this test
could fail. To fix it, we simply make sure that the test also wait for
the library to be loaded
closesodoo/odoo#66546
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently we always auto-reserve products for moves when other incoming
picking makes the product available. This is unwanted for some users.
In this commit, we allow to disable this by add a parameter to
ir.config_parameter. To disable it, set a parameter with name
"stock.picking_no_auto_reserve".
PR #66373closesodoo/odoo#66436
X-original-commit: 04424cddf1e28a52fd7df3ad954d2d484b52972e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, in sample mode, cover images might be displayed
in kanban views. It isn't what we want as those images are real
images from the database, not sample ones, but randomly linked to
the sample records (the id of many2one fields is randomly generated).
This commit tweaks the SampleServer to always set many2one fields
pointing to model 'ir.attachment' to false.
task-2368505
closesodoo/odoo#66381
X-original-commit: f7b2a5825e3786be53d04276af4c4c403b7a293e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When printing a draft invoice, it raises an error.
The error comes from fix#65320: the latter registers the printed
invoice as main attachment, but this needs to be done only with posted
invoices.
OPW-2427247
closesodoo/odoo#66563
X-original-commit: 49a57dd5b34b66733564b31ed861fe9bfcbda2b3
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Context:
1) Edit mode
2) Click on anchor edition button of website form submit button
3) Traceback occurs
The "focus" triggered on $editable element in editor's 'getLinkInfo()'
discards user's text selection on submit button, as a result,
'range.create()' method returns null since no selection is found.
Note: the bug only occurred in Chrome.
Note 2: [1] apparently tried to solve the same issue but the fix was not
solving it correctly, at least not in all cases.
[1]: https://github.com/odoo/odoo/commit/da14e4449e5e318eb72e1b9f268fb797adb0c6a6
opw-2443441
closesodoo/odoo#66574
X-original-commit: adf3d039acbac60b7ea7e6ab0ea8fdd9f940c3b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Scenario:
- start editing background position
- press TAB key
- press CTRL + Z
=> traceback
Why:
Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.
reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417
opw-2423445
closesodoo/odoo#66564
X-original-commit: 2c0aa825ee54ed674ff9f43722031df8e2f35ca6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Issue
- Install "Accounting" module
- Create a new bill :
- Set vendor
- Set no payment reference
- Set a bill reference
- Add products to bill
- Confirm and click on Register Payment
Memo field has no value.
Cause
The memo field is based on lines name.
Lines name is computed in `_onchange_payment_reference`
and depends only on payment_referecence.
Solution
If no `payment_reference`, fallback on `ref` to set line name.
opw-2440389
closesodoo/odoo#66491
Co-author: nboulif <bon@odoo.com>
X-original-commit: 7a7dc212af7279544cffba362bce7daa4fc00865
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
The support for "active_test" context key has been introduced in c2918c1
However, the context key is ignored in many mocked ORM methods (if not all).
This commit adds support for the `search` and `search_read` methods.
Note: this is done to easily write some tests in odoo/enterprise#16363
and it might be usefull to test futures features (or fixes) using this
context key.
closesodoo/odoo#66393
X-original-commit: 0ad1c1631eb233b3e8f98b40f8c0813d0ad7acbe
Related: odoo/enterprise#16447
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Currently, the quotation amount field added in the CRM Sales Teams Kanban view is overflowing the kanban card once the number is too large.
The fix adds the class text-truncate in the corresponding div to avoid the overflow. Notice that this class is the one already used in the parent view implemented in the CRM module, for the other amount fields.
X-original-commit: 14915f4b6a12bbd4882db5af229fb97be3dd52e9
Improve the development experience in debug=assets mode by reducing the
number of requests to the server. We are adapting the solution used for
the JS files to the CSS files. This solution consists of no longer
sending all the files separately, but sending only the bundles
associated with their sourcemap. This allows us to keep the same
debugging experience while drastically reducing the number of requests
to the server.
Benchmark:
saas 14.2 917 requests domcontentloaded after 3.76s
master (bundling du js) 299 requests domcontentloaded after 2.03s
branch (bundling js+css) 36 requests domcontentloaded after 1.01s
Task id : 2463840
closesodoo/odoo#66169
Related: odoo/design-themes#453
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Were not removed when the module was removed (bad forward port?)
closesodoo/odoo#66528
X-original-commit: 4d4555b2c6ba352107b0173c792fd4d43fa9be9e
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The function was wrongly imported and used, and it was hidden by a
generic catching of all exceptions.
The return value and some legit exceptions were also badly handled:
* The return value was always thruthy as it returns an object containing
information about the check.
* Exceptions can be raised if the format is not correct. In that case,
we don't want to go to the simple vat check.
Fixes#64897
opw-2451951
closesodoo/odoo#66522
X-original-commit: e711f359fef7ed4c37cb26d3946744e140bf00e0
Signed-off-by: William André (wan) <wan@odoo.com>
For odoo-master Transifex project, no demo data
closesodoo/odoo#66500
X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Scenario:
- start cropping of an image
- press TAB key
- do CTRL + Z
=> now the image cropping tool are inside the page and there is no way
to remove them.
Why:
The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.
opw-2394877
opw-2423445
closesodoo/odoo#66499
X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Recently, the debug=assets mode was changed to use a bundle with
sourcemap instead of serving static files. Therefore, when someone
modifies a javascript file, refreshing the browser does not load the new
code anymore.
We did not notice that because this is only an issue when the server is
not started in dev mode. In dev=all (or xml), the assets code does not
use a cache and checks everytime the file checksum number to determine
if a new bundle needs to be done.
It is probably not common for developers to modify source code
without restarting the server and/or using dev=all, but it is a case
that is easy to handle anyway: we just need to make sure that in
debug=assets, the assets code does not use the cache and checks directly
the files checksum.
closesodoo/odoo#66460
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>