Skip to content

Conversation

@lav-adhoc
Copy link
Contributor

… compute methods

Copilot AI review requested due to automatic review settings October 23, 2025 12:43
@roboadhoc
Copy link

Pull request status dashboard

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a potential error in the product_catalog_tree module by adding context validation to prevent crashes when the required context variables are missing. The changes ensure that _compute_catalog_values and _inverse_catalog_values methods exit gracefully when res_model or order_id are not present in the context.

  • Adds early return guards to prevent None values being passed to self.env[res_model].browse(order_id)
  • Improves robustness of compute and inverse methods by validating required context before execution

res_model = self._context.get("product_catalog_order_model")
order_id = self._context.get("order_id")

if not res_model or not order_id:
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'prodcut' to 'product' in PR title.

Copilot uses AI. Check for mistakes.
@lav-adhoc lav-adhoc changed the title [FIX] prodcut_catalog_tree: add context validation in product catalog… [FIX] product_catalog_tree: add context validation in product catalog… Oct 23, 2025
@matiasperalta1
Copy link
Contributor

@roboadhoc r+

roboadhoc pushed a commit that referenced this pull request Oct 23, 2025
… compute methods

closes #792

Signed-off-by: matiasperalta1 <mnp@adhoc.com.ar>
@roboadhoc roboadhoc closed this Oct 23, 2025
@roboadhoc roboadhoc deleted the 18.0-h-102503-lav branch October 23, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants