diff --git a/lighting_export_xlsx/report/export_product_xlsx.py b/lighting_export_xlsx/report/export_product_xlsx.py index ce35b96b..3b5a73c7 100644 --- a/lighting_export_xlsx/report/export_product_xlsx.py +++ b/lighting_export_xlsx/report/export_product_xlsx.py @@ -114,20 +114,16 @@ def generate_xlsx_report_ctx(self, workbook, data, objects): # noqa: C901 col += 1 row += 1 if (i % th) == 0: - _logger.info( - " - Progress xlsx writing %i%%" % round(i / n * 100) - ) + _logger.info(" - Progress xlsx writing %i%%" % round(i / n * 100)) _logger.info("Xlsx writing completed...") # make exported attachments public (single write at the end to avoid # concurrent access issues during batch processing) if non_public_ids: - _logger.info( - "Setting %i attachments to public..." % len(non_public_ids) + _logger.info("Setting %i attachments to public..." % len(non_public_ids)) + self.env["lighting.attachment"].sudo().browse(non_public_ids).write( + {"public": True} ) - self.env["lighting.attachment"].sudo().browse( - non_public_ids - ).write({"public": True}) _logger.info("Attachments updated...") def _check_duplicate_labels(self, header, template_id):