This module is intended to disable the indexation of data on the
ir.attachment model.
Attachment model has a field called 'index_content' where the content
of the attachment is read and stored directly in the database. This field is
useful in order to search content of a file. But most of cases it is not used,
so, you can install this module in order to:
- **Avoid Duplicating Data:** Because indexation extracts text content
from files and put it on the database in order it could be searched, but
this implies you have the file data in your `filestore` directory, and
also part (or sometimes all) of that data in your database too.
- **Improve Performance:** Since not all indexed files are plain text, they
require extra process to read them.
Maybe you could try to uninstall modules like `document` in order to
disable its indexation features, but you could face the uninstallation of other
modules that could be useful for you (e.g, `hr_recruitment` depends on that).
But even if you don't have `document` installed, you'd still have
plain text content indexation by default.
Using this module you will not require to uninstall any module to
disable the attachment content indexation, because we directly disable it at
`ir.attachment` base.
The goal of the modified method is to create or remove the relationship
(in the M2m relation tabel) between the tested model (such as
sale_order) and the exception rules. When the ORM writes on
ExceptionRule.sale_ids (using the example of sale_exception), it will
first proceeds with these updates:
* an UPDATE on exception_rule to set the write_date
* INSERT or DELETE on the relation table
* but then, as "write" is called on the exception rule, the ORM will
trigger the api.depends to recompute all the "main_exception_ids"
of the records (sales, ...) related to it, leading to an UPDATE
for each sale order
We end up with RowExclusiveLock on such records:
* All the records of the relation table added / deleted for the current
sale order
* All the records of exception_rule matching the current sale order
* All the records of sale_order related to the exception rules matching
the current sale order
The first one is expected, the next 2 are not. We can remove the lock on
the exception_rule table by removing `_log_access`, however in any case,
the main_exception_ids computed field will continue to lock many sale
orders, effectively preventing 2 sales orders with the same exception
to be confirmed at the same time.
Reversing the write by writing on SaleOrder instead of ExceptionRule
fixes the 2 unexpected locks. It should not result in more queries: the
"to remove" part generates a DELETE on the relation table for the rule
to remove and the "to add" part generates an INSERT for the rule to add,
both will be exactly the same in both cases.
Related to #1642
Replaces #1638
Fixing #1134.
Odoo stores values of computed fields at the end of the transaction
only, as such performing a 'read()' to make a data snapshot on the record
created in the current transaction doesn't return the expected result
regarding these fields.
Also as a side-effect 'read()' alters the environment cache and break the
values on the record inducing issues in the whole user
transaction/workflow.
This fix replaces the use of 'read()' to do the data snapshot directly
from the cache of the record (computed values are already there).
* Add default stage_id logic that returns lowest sequence stage associated with
inheriting model and update unit tests accordingly
* Improve _read_group_stage_ids unit test
* Implement latest abstract model testing strategy