Skip to content

Fork Sync Branch 18.0#180

Merged
btl-bot merged 3 commits intoBTLzdravtech:18.0from
OCA:18.0
Jan 8, 2026
Merged

Fork Sync Branch 18.0#180
btl-bot merged 3 commits intoBTLzdravtech:18.0from
OCA:18.0

Conversation

@btl-bot
Copy link

@btl-bot btl-bot commented Jan 8, 2026

No description provided.

StefanRijnhart and others added 3 commits January 1, 2026 12:04
Fixes #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'
```
Signed-off-by etobella
Copy link

@sireko sireko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved

@btl-bot btl-bot merged commit 6061318 into BTLzdravtech:18.0 Jan 8, 2026
4 checks passed
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
auditlog/models/rule.py 90.29% <100.00%> (+0.02%) ⬆️
test_auditlog/tests/__init__.py 100.00% <100.00%> (ø)
...auditlog/tests/test_account_bank_statement_line.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

5 participants