... records on models having a sequence field (e.g. project.task).
When a record is dragged and dropped, the following RPCs are done:
- write (the new group id on the moved record)
- read (the moved record)
- resequence (the column where the record has been moved to)
To perform the resequence RPC, we need to retrieve the list of ids
of the records being in the column. We do that by iterating over
the cards in the column and reading the id in their data attribute.
However, a traceback might occur if the resequence was triggered
exactly when the user was holding a record over the column being
resequenced, because jquery-ui creates a placeholder for the record
being dragged and dropped, and this placeholder doesn't have the
required data attribute.
The field `ssnid` is used on the payslip. However, it is not available
in any view, therefore it is impossible to fill it.
We replace by the `identification_id`, which is the field commonly used
for identification.
opw-742204
Closes#16798
Before this rev., there might be a crash when the user quickly
clicked several times on the browser's back button. This crash
occurred in the code saving/restoring the scroll position of the
current action.
When clicking fast on the back button, several actions are
executed but don't wait for each other (those actions are triggered
by the hashchange event), so when it is fast, and mainly when the
appswitcher is involved, it may happen that we try to get the
scroll position of an action that isn't loaded yet.
opw~741814
The function _get_bom_component_qty has been deleted by odoo@2ddc35a
But this function was still used in 10.0 in function _get_anglo_saxon_price_unit.
opw:742462
As administrator is used to create all records from website form he is
also put into followers. This creates a lot of unnecessary notifications
and/or emails depending on the system configuration.
Using the magic context key this behavior is modified. Administrator
will not follow every records created through the website form anymore.
- Create a bank statement for Partner A, with one line of 1000 EUR
- Open the reconciliation widget (click on "Reconcile")
- Using another browser, open the same reconciliation widget
- Create an entry for the opened balance in browser 1, click on
"Reconcile"
- Create an entry for the opened balance in browser 2, click on
"Reconcile"
The entries are created twice, no check is performed to verify that the
statement line is already reconciled.
opw-741824
The typical multi-company record rule is
['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
As the company is just created, the current user does not belong to the company.
Create first without company (to still check the access rights) and after add
the company in sudo
Can not apply the same patch for stock as locations and sublocations are created
based on the warehouse company.
Fixes#16807
Before this commit product quantity was computed as if the uom on the product represented the *unit* in which a product was sold
Hence, in the report, it produced something like this:
I sell 10 packages of something, which is sold essentially by 10 itself = which makes a total unitary quantity of 100
This wrong behavior has been introduced in 10.0 by 9c5d4cd60c
After this commit, the computation is done to match the *standard* unit of measure in which a product quantity is *represented*
OPW 741745
Closes#16834
Add a check for the presence of color field. (only applies when "useContacts" is not set)
Before this fix, if the view xml does not set "useContacts", the calendar view fallback on the color attribute (not required) which may be non-existent on the model and on the view.
web_calendar.js:799 is using "if (color_field.type == "selection")" so its throwing this error when color is not defined:
Uncaught TypeError: Cannot read property 'type' of undefined
Public users (website visitors) do not need to be part of
a livechat channel to talk with the operator, they are using
a dedicated mechanism.
Explicitly including them is redundant and bloats the database.
By default auto_search is set to `True` on window actions, this mean
that for example on a list or kanban view the records will be searched
on the view opening without any user action needed.
Setting it to `False` disable this.
Doing this had two drawbacks:
- depending on race condition, the view could be displayed before the
search view was loaded,
- the code expected `active_search` to be present which was not the case
in this instance.
Before 151c9074 the second issue would not happen (active_search was set
directly resolved if a search was not to be done) and this commit also
wait for the search view being ready before showing the view.
opw-741186
opw-741546
closes#16805
- Create an article with one supplierinfo (with a delivery delay and a
min. quantity > 0) and a customer delivery delay
- Trigger the creation of a PO by a procurement order for this article
The supplier delivery delay is not taken into account in the date order
of the PO because the seller is not selected.
This is because the procurement quantity is not sent to the seller
selection.
opw-16702
Closes#16702
Steps to reproduce:
1. Create two products A and B that require a serial number
2. Create a product C with no trcking
3. Create a BOM for a A with two components B an C
4. Create a MO for A with qty > 1
5. Check availabiltity and produce the first A
6. Record the SN for the first assembly
Bug: When producing the second assembly, it was not possible to
record the SN for the components.
opw:741316
When multiple clicking fast (and with the server not too fast), we could
end up with an error (eg. "Cannot read property 'controller' of null").
Something has been done previously to improve this when switching
between views in: fc8a4b5e. This commit do something similar to limit
multiple click on kanban records (doing it as in 26f91c429).
opw-705329
closes#16698
Issue: 741582
This bug happens when you click multiple time quickly on 'run scheduler' button
or if you call 'run reordering rules' and then 'run scheduler' rapidly
It could create duplicate PO or MO.
This happens because the run_scheduler function free the lock while it should
not. ProcurementSudo was created with the old cursor that contains the lock and
the record set that search returns also contains this cursor. The run will call the record set with the bad cursor and commit the lock instead of the wanted
behavior.
This commit creates the ProcurementSudo with the new cursor that does not
contains the lock.
- Create 5 PO with 40 lines each for Partner A
- Create an invoice
- Add each PO thanks to the field "Add Purchase Order"
The process takes more and more time for each PO.
Most of the time is spent in the recomputation of the secondary fields
(in the `onchange` method of "models.py"). The root cause is the cache
invalidation due to the relational fields recomputed as superuser by
default.
opw-740485
Before this commit, when the user modified the dashboard, it was not always visible without refreshing the web client
For example, display the current dashboard, then go to another view and add an extra view in the dashboard, then go back to the dashboard.
The reason is that the dashboard layout is actually stored in the arch of a form view, and that arch is cached by the data manager.
This is why each change to the dashboard arch requires that we clear the cache.
OPW 740739
Closes#16691
Since the account is a mandatory field, we raise an clear error is no
account is defined.
This is necessary when running an automatic reconciliation on the POS.
The POS uses a try/except to avoid any error, but in the case of an SQL
error, the cursor is invalidated, so the transaction fails.
opw-741677
In PostgreSQL, a field of type `integer` must be in the range
-2147483648 to +2147483647. If the user enters a lower or a larger
value, a traceback is thrown.
opw-740286
When a invoice line is create a default layout_category_sequence was created
with a value of 0, updating the value of layout_category_id.sequence instead
of fetching it.
This operation was very slow on the invoice creation wizard
opw-741517
- Create a SO of 1000
- Create a down payment of 300, validate
- Create the final invoice
In the partner view, a total of 1600 is displayed as invoiced.
In the case of a down payment, the corresponding invoice line has an
amount with a negative sign. Since the report computes the absolute
value before multiplying by the sign, this information is lost.
The absolute value is not necessary since `price_subtotal_signed`
already includes the correct sign.
opw-741159
The calendar view display records with the start corresponding to the
record field set as `date_start`, and the stop to the record field set
as `date_stop`.
Since ef886aed2 there some issue when mingling calendar with
`date_start` or `date_stop` date fields and `all_day` unset:
- if user had timezone between UTC+8 and UTC+14, when moving as
"All day", the record start would be saved on the previous day.
- if used had timezone between UTC-12 and UTC-5, when moving as
"All day", the record end would get on the following day.
- if the event was moved onto a given time (in the "Day view"), the
event start would be set to the previous day if it was before midnight
in UTC time, and the end would be set on the following day if it was
after UTC 23:59.
The source of the issue was that after ef886aed2 a datetime was always
sent to the server, so depending on the browser timezone the server
could for example receive '2017-04-27 23:00' instead of '2017-04-28'.
This fix go back to the previous behavior.
fixes#15540
opw-15540
closes#16698
In some email templates of Odoo, the From: field is generated from the
company name. If this name contains an "&" character, this will lead in
an escaping eg; &
Sender header will look like:
From: Machin & Brol <machinbrol@toto.com>
This case is not well handled by email providers like Gmail, that
splits the line on the ";" and considers there are 2 senders, and then
discards the email.
We then fix the templates, waiting for a better fix in master.
To reproduce, see issue #16611.
In the mentioned use case, a line with a quantity of zero is created,
which generates a traceback at invoice validation.
Fixes#16611
opw-741055
In function name_get on model "delivery.carrier", the field name
is taken from "product.template" and the translations were just
available on model "product.product".
The translations for the "product.template" records were not available
in the .pot file because there was no external identifiers created for
the "product.template".
Now when creating the external identifier of a record, all the external
identifiers of the inherits models of this record are also created.
In this way, all the translations will be created.
opw:728682
This reverts commit 75d9674d4 and revert well 551719a81e which wass done
on mail.mass_mailing instead of mail.template (on which it should not be
done).