Conversation
9cdb5c7 to
008cb16
Compare
| <script> | ||
| var page = window.location.search.match(/[?&]page=(\\d+)/); | ||
| if (page && parseInt(page[1]) > 1) {{ | ||
| var elements = document.getElementsByClassName('{css_class}'); | ||
| for (var i = 0; i < elements.length; i++) {{ | ||
| elements[i].style.display = 'none'; | ||
| }} | ||
| }} | ||
| </script> | ||
| """ |
87ba8b0 to
c6135ae
Compare
c6135ae to
8749993
Compare
|
Tests CI is fixed at #1142. |
a1d9344 to
7a887ff
Compare
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
| { | ||
| "name": "Report Positioned Image", | ||
| "summary": "Add positioned images to PDF reports generated by Odoo.", |
There was a problem hiding this comment.
| "summary": "Add positioned images to PDF reports generated by Odoo.", | |
| "summary": "Add positioned images to PDF reports", |
| # Copyright 2026 Quartile | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
There was a problem hiding this comment.
| # Copyright 2026 Quartile | |
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
| class ResCompany(models.Model): | ||
| _inherit = "res.company" | ||
|
|
||
| report_positioned_image_ids = fields.Many2many( |
There was a problem hiding this comment.
I think this should be one2many. It looks inconsistent with how company_id is defined as many2one in report.positioned.image.
There was a problem hiding this comment.
I intentionally avoid using a One2many field because it can lead to unintended behavior.
For example, when we add a positioned image to an Order/Quotation report for a specific company, that image is also assigned to the company’s report images. As a result, every time we create a positioned image for a specific report, all of those images are added to the company as well.
Then, if we remove the report images from the company, they are also unlinked from the specific report, which is not the intended behavior.
There was a problem hiding this comment.
Okay, we may add a help text to company_id of the image model to make the intent clear.
| class IrActionsReport(models.Model): | ||
| _inherit = "ir.actions.report" | ||
|
|
||
| include_company_report_image = fields.Boolean( |
There was a problem hiding this comment.
| include_company_report_image = fields.Boolean( | |
| include_company_images = fields.Boolean( |
There was a problem hiding this comment.
I wanted to include report to make the purpose clearer, but I think include_company_images is already enough. So I updated it.
| @@ -0,0 +1,4 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | |||
| access_report_positioned_image_portal,report.positioned.image portal,model_report_positioned_image,base.group_portal,1,0,0,0 | |||
There was a problem hiding this comment.
This one doesn't look necessary. Please confirm.
| access_report_positioned_image_portal,report.positioned.image portal,model_report_positioned_image,base.group_portal,1,0,0,0 | |
| access_report_positioned_image_portal,report.positioned.image |
There was a problem hiding this comment.
I initially thought that portal users would need access to the model.
After verifying the behavior, I confirmed that this is not necessary because _show_report in the portal runs with sudo().
7a887ff to
0b84ccf
Compare
@yostashiro For some reason, my latest code changes are not reflected in this PR. In my update, I added |
| first_page_only = fields.Boolean() | ||
| company_id = fields.Many2one( | ||
| comodel_name="res.company", | ||
| required=True, |
There was a problem hiding this comment.
Can we remove this required=True? I think it will allow more flexible use of the images. We should also add a record rule for this model.


@qrtl QT6451