Restore behaviour of not adding the separating dot if the module field
of an ir.model.data record is empty. This is useful/important for
interop with external systems.
When a record fields are prefetched, the currently accessed record is
prefetched as well as PREFETCH_MAX (=1000) minus currenly accessed
records.
Since 439fa826 the id field was thought as "prefetched" but was not,
which caused that in an onchange, we would have a prefetching as follow
for 1200 records:
- get records 1-1000
- get record 1001 (1001-1200 INTERSECTION 1-999 (id) + 1001 (current))
- get record 1002 (1002-1200 INTERSECTION 1-999 (id) + 1002 (current))
- get record 1003 (1003-1200 INTERSECTION 1-999 (id) + 1003 (current))
- ...
- get record 1200 (1200 INTERSECTION 1-999 (id) + 1200 (current))
So we would do 201 queries instead of 2 when prefetching the records.
The added test without this change failed the query count with:
"AssertionError: 284 not less than or equal to 5 : admin"
opw-1837548
opw-1837552
closes#24326
- Create a stockable Product A
- Get create an incoming picking at date D for A
- Go to Inventory > Report > Inventory, and search for the the inventory
at date D-1.
- A should appear with a quantity on hand of 0.
- Filter on 'Available Products'
The product still appear in the list with a quantity on hand of zero.
The optimized method `_search_qty_available_new` is used, although it
doesn't take into account dates.
The original use case for this optimized method was to quickly get
products with stock on hand, i.e. products with quants without needed
information of stock moves.
opw-1833510
The portal view for tasks previously listed all task of all projects
without grouping them. It was a problem, mainly when we want to make
the distinction on project label_tasks, to make the difference
between tasks, issues, ... Grouping task by project by default allows
to show the label_tasks before each project.
Grouping the tasks removes the possibility to define a primary
ordering. We want to be able to ungroup the tasks in some cases.
The implentation was done in the portalsearch bar adding
a group by option. The portal proposes two grouping options,
project (by default) and none (to keep strict ordering).
Task: #1827950
PR #23769
Here is a scenario that could happen before this commit:
1. go to a list view with more than one record, say 3
2. click on the 3rd record to open the form view
3. the pager says 3/3
4. click on edit button
5. click on discard button
6. the pager says 1/3 (but the record displayed is still the same)
It is often necessary to restore the offset for the sub records, because
the number of pages in a one2many could have changed. However, it is
not a good idea to do that for the main record, since it interferes with
the usual flow of operations.
Currently, the default field widget of type html is not defined in the
web addon, but in the web_editor addon. It uses the summernote library
and different assets.
The web_editor addon is defined with auto_install=true, so it is usually
not an issue. However, it could happen that there is some issue with
the web_editor asset bundles. In that case, any form view with a field
of type html will crash.
With this commit, we define a default widget of type html in the web
addon. This will render as text (so, not exactly what one might
expect), but it is still better than making the web client unusable.
Assume a custom field F is defined on model 'res.partner'. The setup of F may
silently fail because of missing stuff. In that situation, setting up the
field inherited from F on model 'res.users' should also silently fail.
To reproduce the bug, install Invoicing, create a related custom field F on
'res.partner' with 'property_account_position_id.active', and install another
module. Setting up F after loading module 'base' will fail because the field
'property_account_position_id' does not exist yet. The error is not caught by
the inheritance of F on model 'res.users', and the installation crashes.
When calculating the stock_value of a product,
the system will take into account all the locations
that have this company as company. (that way if owner_id
is not set, the company_id on the location is the owner (virtual: not set))
The Qty on Hand field takes into account however
the quantities that are in the warehouses.
This could lead to weird situations where the Quantity On Hand is 0
and so the record is not shown, while the stock value is positive.
(e.g. stock in Transit)
In order to use the same logic for both fields, we pass company_owned=True
in the context.
Assume a custom field F is defined on model 'res.partner'. The setup of F may
silently fail because of missing stuff. In that situation, setting up the
field inherited from F on model 'res.users' should also silently fail.
To reproduce the bug, install Invoicing, create a related custom field F on
'res.partner' with 'property_account_position_id.active', and install another
module. Setting up F after loading module 'base' will fail because the field
'property_account_position_id' does not exist yet. The error is not caught by
the inheritance of F on model 'res.users', and the installation crashes.
OPW 1835872
- Fix an issue where the transaction were always set a 'form_save' thus always creating payment tokens.
- Fix an issue where when the customer paying while not being logged in was crashing.
The issue is due to the fact that we are creating payment transactions linked to no partners, doing so it crashing the code when creating the payment token with no partner set.
The Arabic we use on Transifex is "simple" Arabic, not the one from Syria.
The .po files we synchronise are named 'ar.po', not 'ar_SY.po'
Change the iso_code to match the one we actually use.
transifex module relies on the iso_code to make its URL
The issue occurs when `read_group` is called with a date/datetime field to
group and order on, and the group_by is qualified, such as:
model.read_group(..., groupby=['date:week'], orderby='date')
The ORDER BY clause in the query should use the same term as the GROUP BY
clause for the corresponding field.
OPW 1834148
When working with relational fields, the sorting function would
compare empty recordsets with Strings (the field value),
crashing in the process.
This is essentially an addendum to previous commit
b6c962e62a
which fixed the sorting for non-relational fields.
opw 1831457
If a user only has the stock user access rights, he's not able to
validate or write on a move that has to update the delivered quantities.
Closes#23782
opw-1835138
The check on the event target and the barcode target is done outside
the check on barcode found. That result in a warning for each modal/form
view that is pending.
This commit do the check before doing any operations in order
to directly stop if the event target is not similiar to listening
barcode target
The barcode scanner and the quantity listener do not use
the same proccess although they act for the same operation.
(For example the quantity listener trigger onchange server side
while the barcode scanner not if 'notifychange' key on the
active_barcode is set to False)
Since quantity listener is based on candidate we could directly
call the _barcodeSelectedCandidate method in order to have a common
behavior and code.
Before installing pads, create a second company
On the first company, create a task and initialize its pad
Switch companies and try to edit the task
Before this commit:
There is a traceback because since the pad credentials of the second company are not set,
the url cannot be computed
After this commit, we prevent the Null field to concat with a string
hence there is no traceback
OPW 1837059
closes#24263
On a DB with thousands of events including recurring ones, fetching the
complete list of events might lead to a memory overflow due to the
prefetching of all virtual events.
We reduce the memory footprint by handling no more than 50,000 records
at a time and clearing the cache at each step. This limit is purely
arbitrary, but seems to be a good compromise between performance and
memory usage.
opw-1832482
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.
This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.
With this commit, custom views are edited in place.
Fixes#23712
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.
This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.
With this commit, custom views are edited in place.
Fixes#23712
When we make a payment, we need the write access on account.journal
because check_manual_sequencing on account.payment is a related field
of account.journal and was used to decide on numbering the check or not.
With this change, the write access is not required.
opw-1834343
opw-1835888
closes#24281
In the reference widget, the focus was always on the input (many2one) even
though the first select (with the model) was not set.
Thanks to @kaerdsar for the original PR.
Partially closes#24070
Before this rev., in the ir.model.fields form view, it crashed
when the user specified an invalid model name as a relation for
fields of type many2many (the onchange crashed). This rev. displays
a warning instead.
opw 1837401
On a pivot view expand a field in column
another one in row
Then put a domain in the search view
Save the whole thing (ir.filter) as favorite
Before this commit, the ir.filter was not saved the right way when a domain was present
(Let alone its restoration)
This was because of
- the internal default groupbys of the pivot model was not updated, and what we got in the params was overwritten
by what existed before
- a slight typo in the code made the row updated with the col values
OPW 1835865
OPW 1829925
closes#24215
This is confusing for end users because on the fleet form/kanban view the
model is displayed. The information displayed in the name is the default
depreciated cost on the model. But in reality the depreciated cost of the
car could be different.
When an unlogged user creates a livechat, typing the /help command in the
backend would result in the help command sending a traceback.
The function processing the command would assume the existence of a channel
partner name, which is not the case when the user starting the chat is unlogged.
opw:1835484
When producing a byproduct in a BoM, the quantity for the byproduct was
increased by twice its produced quantity.
This is essentially a revert of commit d7fdb636b8
which was erroneously forward-ported to 11.0,
where byproducts were already correctly counted.
opw:1834226
Before this fix, when a user don't have write access on a document, he
can't send an email with attachment because, the attachments is added on
the document.
The change improving security was introduced by the commit:
https://github.com/odoo/odoo/commit/6494f511718893eec3573c60c0a62e04d386359d
With this fix, for mail, the attachments is added on the
'mail.compose.message' and re-render the fields attachments displayed in
the current view. This change respect the access rules like all others
attachment of 'mail.compose.message' (can send an email when the user have
read access on the document).
The media dialog of the html widget display all documents attachments and
the added attachments Allowing users to use these in the body of their
message.
When sending the test email of a mass mailing campaign, it might be
observed that the result is different from the final email sent to
customers.
This is because the `body` field of the final mail message is an `Html`
field with options `sanitize_style=True` and `strip_classes=True`. On
the other hand, the `body_html` field the test mail is a simple `Text`
field which is not sanitized.
We sanitize the `body_html` field with similar options.
opw-1820064
Here is a scenario that could happen before this commit:
1. web client is started
2. it binds a callback on hashchange
3. it performs some async work (read initial action for user)
4. the user (or more likely, a tour) changes the url
5. the hashchange handler is called, and it starts a new action
6. the async work for the web client is over, it then executes the
default action and/or clicks on the first menu
7. we are now in the default action state, instead of the desired action
state (the one from the new url)
With this fix, we simply do nothing when there was an hashchange before
the initial action was done.