Skip to content

[18.0][FIX] document_page: fix type error, tuple assignment#605

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
Nitrokey:18.0-fix-document_page-type-error
Jun 16, 2026
Merged

[18.0][FIX] document_page: fix type error, tuple assignment#605
OCA-git-bot merged 1 commit into
OCA:18.0from
Nitrokey:18.0-fix-document_page-type-error

Conversation

@jans23

@jans23 jans23 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

How to reproduce: Knowledge -> Pages -> Change Requests -> New this causes the following exception:

Traceback (most recent call last):
  File "/srv/odoo/odoo/parts/odoo/odoo/http.py", line 2167, in _transactioning
    return service_model.retrying(func, env=self.env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/service/model.py", line 157, in retrying
    result = func()
             ^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/http.py", line 2134, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/http.py", line 2382, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/addons/base/models/ir_http.py", line 333, in _dispatch
    result = endpoint(**request.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/http.py", line 754, in route_wrapper
    result = endpoint(self, *args, **params_ok)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/addons/web/controllers/dataset.py", line 36, in call_kw
    return call_kw(request.env[model], method, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/api.py", line 535, in call_kw
    result = getattr(recs, name)(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/addons/web/models/models.py", line 1019, in onchange
    snapshot1 = RecordSnapshot(record, fields_spec)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/addons/web/models/models.py", line 1106, in __init__
    self.fetch(name)
  File "/tmp/addons/web/models/models.py", line 1121, in fetch
    self[field_name] = self.record[field_name]
                       ~~~~~~~~~~~^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/models.py", line 7083, in __getitem__
    return self._fields[key].__get__(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/fields.py", line 1311, in __get__
    self.compute_value(recs)
  File "/srv/odoo/odoo/parts/odoo/odoo/fields.py", line 1493, in compute_value
    records._compute_field_value(self)
  File "/tmp/addons/mail/models/mail_thread.py", line 443, in _compute_field_value
    return super()._compute_field_value(field)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/odoo/odoo/parts/odoo/odoo/models.py", line 5302, in _compute_field_value
    fields.determine(field.compute, self)
  File "/srv/odoo/odoo/parts/odoo/odoo/fields.py", line 110, in determine
    return needle(*args)
           ^^^^^^^^^^^^^
  File "/tmp/addons/document_page/models/document_page_history.py", line 57, in _compute_display_name
    rec.display_name = rec.id, "%s #%i" % (rec.page_id.name, rec.id)
                               ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: %i format: a real number is required, not NewId

@KDRdev

KDRdev commented May 4, 2026

Copy link
Copy Markdown
Contributor

Tested. LGTM

@jans23

jans23 commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

@etobella could you review this, please?

Comment thread document_page/models/document_page_history.py Outdated
@jans23 jans23 force-pushed the 18.0-fix-document_page-type-error branch from cfbdb93 to cef1a1d Compare May 29, 2026 19:17

@Reyes4711-S73 Reyes4711-S73 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@adrip-s73

Copy link
Copy Markdown
Contributor

LGTM

@etobella etobella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

However, can you use a proper commit name.

Something like [IMP] document_page: Fix tuple assignment error

@jans23 jans23 force-pushed the 18.0-fix-document_page-type-error branch from cef1a1d to af45aee Compare June 10, 2026 04:41

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jans23 could you please take a look at this suggestion?

#605 (review)

Other than that, LGTM!

@jans23

jans23 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@BhaveshHeliconia I changed the commit name accordingly. Anything else?

@BhaveshHeliconia

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia I changed the commit name accordingly. Anything else?

Also, could you please update the PR title to something more appropriate?

@jans23 jans23 changed the title fix type error, tuple assignment [18.0][FIX] document_page: fix type error, tuple assignment Jun 16, 2026
@jans23

jans23 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Done. Like this?

@etobella etobella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-605-by-etobella-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 647b31d into OCA:18.0 Jun 16, 2026
6 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at c5313cf. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants