From 1925e830db385b808becbd4cf022513b984466ce Mon Sep 17 00:00:00 2001 From: Martin Quinteros Date: Tue, 18 Nov 2025 09:57:14 -0300 Subject: [PATCH 1/4] [IMP] Add ZPL reports to print node closes ingadhoc/miscellaneous#300 Signed-off-by: Juan Carreras --- base_report_to_print_node/__manifest__.py | 2 +- base_report_to_print_node/models/printing_printer.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base_report_to_print_node/__manifest__.py b/base_report_to_print_node/__manifest__.py index 0d91b428..427c88c4 100644 --- a/base_report_to_print_node/__manifest__.py +++ b/base_report_to_print_node/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Print Node Printing", - "version": "18.0.1.0.0", + "version": "18.0.1.1.0", "category": "Generic Modules/Base", "author": "ADHOC SA, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/base_report_to_print_node/models/printing_printer.py b/base_report_to_print_node/models/printing_printer.py index bcb8e951..6963e2cb 100644 --- a/base_report_to_print_node/models/printing_printer.py +++ b/base_report_to_print_node/models/printing_printer.py @@ -95,7 +95,7 @@ def print_document(self, report, content, **print_opts): try: res = self._submit_job( self.uri, - options.get("format", "pdf"), + options.get("format", report.report_type), file_name, options, ) @@ -152,6 +152,8 @@ def _submit_job(self, printerid, jobtype, jobsrc, options): """ if jobtype in ["qweb-pdf", "pdf", "aeroo"]: jobtype = "pdf" + elif jobtype in ["qweb-text"]: + jobtype = "txt" else: raise UserError(_("Jobtype %s not implemented for Print Node") % (jobtype)) @@ -166,7 +168,7 @@ def _submit_job(self, printerid, jobtype, jobsrc, options): data = { "printerId": printerid, "title": title, - "contentType": "pdf_base64", + "contentType": "pdf_base64" if jobtype == "pdf" else "raw_base64", "content": content, "source": "created by odoo db: %s" % self.env.cr.dbname, } From 729e468155f35d813e26c65fe02daf155d7d68d2 Mon Sep 17 00:00:00 2001 From: Celina Devigili Date: Tue, 9 Dec 2025 19:46:39 -0300 Subject: [PATCH 2/4] [FIX] portal_backend: add missing company fields in session_info Part-of: ingadhoc/miscellaneous#314 Signed-off-by: Juan Carreras --- portal_backend/models/ir_http.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/portal_backend/models/ir_http.py b/portal_backend/models/ir_http.py index a4f4c7a7..6a68b7f2 100644 --- a/portal_backend/models/ir_http.py +++ b/portal_backend/models/ir_http.py @@ -26,6 +26,9 @@ def session_info(self): "load_menus": hashlib.sha512(menu_json_utf8).hexdigest()[:64], # sha512/256 } ) + # We need sudo since a user may not have access to ancestor companies + disallowed_ancestor_companies_sudo = user.company_ids.sudo().parent_ids - user.company_ids + all_companies_in_hierarchy_sudo = disallowed_ancestor_companies_sudo + user.company_ids session_info.update( { # current_company should be default_company @@ -36,9 +39,21 @@ def session_info(self): "id": comp.id, "name": comp.name, "sequence": comp.sequence, + "child_ids": (comp.child_ids & all_companies_in_hierarchy_sudo).ids, + "parent_id": comp.parent_id.id, } for comp in user.company_ids }, + "disallowed_ancestor_companies": { + comp.id: { + "id": comp.id, + "name": comp.name, + "sequence": comp.sequence, + "child_ids": (comp.child_ids & all_companies_in_hierarchy_sudo).ids, + "parent_id": comp.parent_id.id, + } + for comp in disallowed_ancestor_companies_sudo + }, }, "show_effect": True, "display_switch_company_menu": user.has_group("base.group_multi_company") From 9c31a8a813a162075ed896ed930c24a2e231a128 Mon Sep 17 00:00:00 2001 From: Celina Devigili Date: Wed, 10 Dec 2025 16:03:01 -0300 Subject: [PATCH 3/4] [FIX] portal_holidays: add rule for multi-company hr.leave.type access closes ingadhoc/miscellaneous#314 Signed-off-by: Juan Carreras --- portal_holidays/__manifest__.py | 2 +- portal_holidays/security/ir.model.access.csv | 1 - portal_holidays/security/ir_rule.xml | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/portal_holidays/__manifest__.py b/portal_holidays/__manifest__.py index ffdf2238..c341318c 100644 --- a/portal_holidays/__manifest__.py +++ b/portal_holidays/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Portal Holidays", - "version": "18.0.1.5.0", + "version": "18.0.1.6.0", "category": "Base", "sequence": 14, "summary": "", diff --git a/portal_holidays/security/ir.model.access.csv b/portal_holidays/security/ir.model.access.csv index 5f49a630..5edc760f 100644 --- a/portal_holidays/security/ir.model.access.csv +++ b/portal_holidays/security/ir.model.access.csv @@ -11,4 +11,3 @@ portal_holiday_resource_calendar_leaves,portal-holiday-model_resource_calendar_l portal_holiday_resource_resource,portal-holiday-model_resource_resource,resource.model_resource_resource,group_portal_backend_holiday,1,0,0,0 portal_holiday_hr_leave_mandatory_day,portal-holiday-model_hr_leave_mandatory_day,hr_holidays.model_hr_leave_mandatory_day,group_portal_backend_holiday,1,0,0,0 portal_holiday_user_calendar,portal_holiday_calendar_atendee,calendar.model_calendar_attendee,group_portal_backend_holiday,1,0,1,0 -portal_holiday_access_hr_leave_type,hr.leave.type,hr_holidays.model_hr_leave_type,group_portal_backend_holiday,1,0,0,0 diff --git a/portal_holidays/security/ir_rule.xml b/portal_holidays/security/ir_rule.xml index b00b59d6..246c907e 100644 --- a/portal_holidays/security/ir_rule.xml +++ b/portal_holidays/security/ir_rule.xml @@ -9,4 +9,11 @@ + + + Time Off Type: portal holiday: multi-company + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + From b258783bfed2f814aeb0cb4bb8f57efaa5324e32 Mon Sep 17 00:00:00 2001 From: Virginia Date: Wed, 17 Dec 2025 14:25:11 -0300 Subject: [PATCH 4/4] Update project.toml from template --- .copier-answers.yml | 2 +- pyproject.toml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 7730f24c..638b4ac4 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: d46567f +_commit: 2f2f7c4 _src_path: https://github.com/ingadhoc/addons-repo-template.git description: '' is_private: false diff --git a/pyproject.toml b/pyproject.toml index 9f837a8c..9b15bb04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,9 +27,9 @@ ignore = [ [tool.ruff.lint.pycodestyle] # line-length is set in [tool.ruff], and it's used by the formatter # in case the formatted can't autofix the line length, it will be reported as an error -# only if it exceeds the max-line-length set here. We use 999 to effectively disable +# only if it exceeds the max-line-length set here. We use 320 (max available value) to disable # this check. -max-line-length = 999 +max-line-length = 320 [tool.ruff.lint.isort] combine-as-imports = true @@ -46,6 +46,7 @@ known-third-party = [ "urllib2", "yaml", ] +section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] [tool.ruff.lint.mccabe] max-complexity = 20