Skip to content

[18.0][FIX] document_page_approval: Avoid errors when creating a page history and send mail#584

Merged
OCA-git-bot merged 1 commit intoOCA:18.0from
Tecnativa:18.0-fix-document_page_approval-TT61290
Mar 3, 2026
Merged

[18.0][FIX] document_page_approval: Avoid errors when creating a page history and send mail#584
OCA-git-bot merged 1 commit intoOCA:18.0from
Tecnativa:18.0-fix-document_page_approval-TT61290

Conversation

@victoralmau
Copy link
Member

@victoralmau victoralmau commented Mar 2, 2026

Avoid errors when creating a page history and end mail

Example use case:

  • Modify the Odoo Features category, check Require approval, and set Approver group > Administration / Access Rights
  • Modify the Marc Demo user and define Document Knowledge > Editor permissions
  • Go to the Odoo Features category and, taking into account the ID, delete the mail_message record table with the same ID from the database
  • With the Marc Demo user, go to the Knowledge > Odoo Features menu and enter the Odoo 15.0 Functional Demo page (it is important to follow these specific steps)
  • Modify the page and save

Before this change, an error could occur because the action https://github.com/OCA/knowledge/blob/0881d75a35e7fc2f814110df4878177e805e589b/document_page/views/document_page_category. xml#L83C17-L83C42 defined a default_parent_id=x (page category ID) if there was no mail_message linked to that category ID; now the value of default_parent_id is removed to avoid this specific error.

Please @pedrobaeza and @pilarvargas-tecnativa can you review it?

@Tecnativa TT61290

@victoralmau victoralmau force-pushed the 18.0-fix-document_page_approval-TT61290 branch from 19dfc28 to 971a862 Compare March 2, 2026 16:22
@victoralmau victoralmau marked this pull request as ready for review March 2, 2026 16:24
@victoralmau victoralmau force-pushed the 18.0-fix-document_page_approval-TT61290 branch from 971a862 to 96d3621 Compare March 2, 2026 16:37
@victoralmau victoralmau changed the title [18.0][FIX] document_page_approval: Avoid errors when creating a page history and end mail [18.0][FIX] document_page_approval: Avoid errors when creating a page history and send mail Mar 2, 2026
@victoralmau victoralmau force-pushed the 18.0-fix-document_page_approval-TT61290 branch 2 times, most recently from 6479914 to cc01f92 Compare March 2, 2026 16:38
@christian-ramos-tecnativa

Can you be a bit more specific about the third step?

Go to the Odoo Features category and, taking into account the ID, delete the mail_message record table with the same ID from the database

I'm not able to reproduce the error and assuming is because of this step. I went to mail_message and deleted the one linked to the Category Odoo Features the one saying "Document Page created", is that correct?

@victoralmau
Copy link
Member Author

Can you be a bit more specific about the third step?

Go to the Odoo Features category and, taking into account the ID, delete the mail_message record table with the same ID from the database

I'm not able to reproduce the error and assuming is because of this step. I went to mail_message and deleted the one linked to the Category Odoo Features the one saying "Document Page created", is that correct?

I think an example is the best way to explain it.

Before:
ejemplo-antes

After:
ejemplo-despues

Copy link

@christian-ramos-tecnativa christian-ramos-tecnativa left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the Gif, I was able to replicate and understand the error

…ry and send mail

Example use case:
- Modify the Odoo Features category, check Require approval, and set Approver group > Administration / Access Rights
- Modify the Marc Demo user and define Document Knowledge > Editor permissions
- Go to the Odoo Features category and, taking into account the ID, delete the mail_message record table with the same ID from the database
- With the Marc Demo user, go to the Knowledge > Odoo Features menu and enter the Odoo 15.0 Functional Demo page (it is important to follow these specific steps)
- Modify the page and save

Before this change, an error could occur because the action https://github.com/OCA/knowledge/blob/0881d75a35e7fc2f814110df4878177e805e589b/document_page/views/document_page_category. xml#L83C17-L83C42 defined a default_parent_id=x (page category ID) if there was no mail_message linked to that category ID; now the value of default_parent_id is removed to avoid this specific error.

TT61290
@victoralmau victoralmau force-pushed the 18.0-fix-document_page_approval-TT61290 branch from cc01f92 to 52b1c22 Compare March 3, 2026 11:03
@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-584-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 39c68eb into OCA:18.0 Mar 3, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 18.0-fix-document_page_approval-TT61290 branch March 3, 2026 12:10
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.

4 participants