Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion base_report_to_print_node/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions base_report_to_print_node/models/printing_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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))

Expand All @@ -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,
}
Expand Down
15 changes: 15 additions & 0 deletions portal_backend/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion portal_holidays/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
"name": "Portal Holidays",
"version": "18.0.1.5.0",
"version": "18.0.1.6.0",
"category": "Base",
"sequence": 14,
"summary": "",
Expand Down
1 change: 0 additions & 1 deletion portal_holidays/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions portal_holidays/security/ir_rule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@
<field name="perm_unlink" eval="False"/>
<field name="perm_write" eval="False"/>
</record>

<record model="ir.rule" id="hr_leave_type_portal_holiday_rule">
<field name="name">Time Off Type: portal holiday: multi-company</field>
<field name="model_id" ref="hr_holidays.model_hr_leave_type"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
<field name="groups" eval="[Command.link(ref('portal_holidays.group_portal_backend_holiday'))]"/>
</record>
</odoo>
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down