Skip to content

Conversation

@StefanRijnhart
Copy link
Member

@StefanRijnhart StefanRijnhart commented Jan 2, 2026

Continued from #3391

sebalix and others added 30 commits January 2, 2026 12:06
…itlog.log' model (standard 'create_date' field is used instead)
…ail data - if any - are migrated during the installation)
… 'field_description' fields changed into related fields
baptiste-n42 and others added 6 commits January 2, 2026 21:17
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'
```
@StefanRijnhart StefanRijnhart changed the title [19.0][MIG] auditlog; Migration to 19.0 [19.0][MIG] auditlog: Migration to 19.0 Jan 2, 2026
@StefanRijnhart StefanRijnhart force-pushed the 19.0-mig-auditlog branch 2 times, most recently from 16d7007 to 292d89c Compare January 2, 2026 21:06
@StefanRijnhart
Copy link
Member Author

/ocabot migration auditlog

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jan 2, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Jan 2, 2026
40 tasks
@StefanRijnhart
Copy link
Member Author

test_auditlog for 19.0 is green at #3484

@StefanRijnhart StefanRijnhart force-pushed the 19.0-mig-auditlog branch 3 times, most recently from c5b052c to c1403e9 Compare January 3, 2026 22:10
StefanRijnhart and others added 2 commits January 3, 2026 23:14
Co-authored-by: Eric Lembregts <eric@devrandom.be>
Co-authored-by: Raf Ven <raf.ven@dynapps.be>
@StefanRijnhart StefanRijnhart force-pushed the 19.0-mig-auditlog branch 4 times, most recently from 9c4c168 to 065c19e Compare January 3, 2026 22:55
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.