-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[19.0][MIG] auditlog: Migration to 19.0 #3483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
StefanRijnhart
wants to merge
168
commits into
OCA:19.0
Choose a base branch
from
StefanRijnhart:19.0-mig-auditlog
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+47,145
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… ones to make overridding easier
…itlog.log' model (standard 'create_date' field is used instead)
…S.txt file removed
…ail data - if any - are migrated during the installation)
… a field is deleted (e.g. migration)
… 'field_description' fields changed into related fields
Currently translated at 96.7% (88 of 91 strings) Translation: server-tools-18.0/server-tools-18.0-auditlog Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-auditlog/ja/
Currently translated at 100.0% (91 of 91 strings) Translation: server-tools-18.0/server-tools-18.0-auditlog Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-auditlog/it/
Currently translated at 95.6% (87 of 91 strings) Translation: server-tools-18.0/server-tools-18.0-auditlog Translate-URL: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-auditlog/sv/
Fixes OCA#3424 Previous approach was to create a copy, so that the recomputes were also applied to the real world cache. However, this causes an issue when a field is required that is only available in the real world cache, such as the `date` field in ``` @api.depends('date', 'sequence') def _compute_internal_index(self): for st_line in self.filtered(lambda line: line._origin.id): st_line.internal_index = f'{st_line.date.strftime("%Y%m%d")}' ... ``` It actually makes sense to avoid recomputes in this isolated environment that is meant to retrieve the original values from before the write. Fixes ``` File "/odoo/odoo/addons/account/models/account_bank_statement_line.py", line 427, in create st_line.move_id.write(to_write) File "/odoo/server-tools/auditlog/models/rule.py", line 464, in write_full old_values = {d["id"]: d for d in records_write.read(fields_list)} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/server-tools/auditlog/models/rule.py", line 406, in read result = read.origin(self, fields, load, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo/odoo/models.py", line 3857, in read self._origin.fetch(fields) File "/odoo/odoo/odoo/models.py", line 4153, in fetch fetched = self._fetch_query(query, fields_to_fetch) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo/odoo/models.py", line 4264, in _fetch_query field.read(fetched) File "/odoo/odoo/odoo/fields.py", line 4654, in read lines = comodel.search_fetch(domain, field_names) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo/odoo/models.py", line 1781, in search_fetch return self._fetch_query(query, fields_to_fetch) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo/odoo/models.py", line 4240, in _fetch_query rows = self.env.execute_query(query.select(*sql_terms)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/odoo/odoo/odoo/api.py", line 992, in execute_query self.flush_query(query) File "/odoo/odoo/odoo/api.py", line 984, in flush_query self[model_name].flush_model(field_names) File "/odoo/odoo/odoo/models.py", line 6768, in flush_model self._recompute_model(fnames) File "/odoo/odoo/odoo/models.py", line 7332, in _recompute_model self._recompute_field(field) File "/odoo/odoo/odoo/models.py", line 7360, in _recompute_field field.recompute(records) File "/odoo/odoo/odoo/fields.py", line 1471, in recompute apply_except_missing(self.compute_value, recs) File "/odoo/odoo/odoo/fields.py", line 1444, in apply_except_missing func(records) File "/odoo/odoo/odoo/fields.py", line 1493, in compute_value records._compute_field_value(self) File "/odoo/odoo/odoo/models.py", line 5297, in _compute_field_value fields.determine(field.compute, self) File "/odoo/odoo/odoo/fields.py", line 110, in determine return needle(*args) ^^^^^^^^^^^^^ File "/odoo/odoo/addons/account/models/account_bank_statement_line.py", line 295, in _compute_internal_index st_line.internal_index = f'{st_line.date.strftime("%Y%m%d")}' \ ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'bool' object has no attribute 'strftime' ```
32d9e39 to
3b60fc5
Compare
1 task
16d7007 to
292d89c
Compare
Member
Author
|
/ocabot migration auditlog |
Member
Author
|
|
c5b052c to
c1403e9
Compare
Co-authored-by: Eric Lembregts <eric@devrandom.be> Co-authored-by: Raf Ven <raf.ven@dynapps.be>
9c4c168 to
065c19e
Compare
The concept of subscriptions is slightly misleading in the auditlog domain because users do not 'subscribe' to individual rules and no notifications are being sent out.
Since odoo/odoo@6dc96811c24ec, test methods from inherited test classes are not run by default.
065c19e to
8b2af87
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continued from #3391
env.transaction.cacheis no longer a data store.