Skip to content

[16.0][ADD] helpdesk_mgmt_purchase: links purchase orders and helpdesk tickets.#879

Open
nicolas-delbovier-acsone wants to merge 7 commits intoOCA:16.0from
acsone:16.0-add-helpdesk-mgmt-purchase
Open

[16.0][ADD] helpdesk_mgmt_purchase: links purchase orders and helpdesk tickets.#879
nicolas-delbovier-acsone wants to merge 7 commits intoOCA:16.0from
acsone:16.0-add-helpdesk-mgmt-purchase

Conversation

@nicolas-delbovier-acsone
Copy link
Copy Markdown

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Nov 6, 2025

image image

@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-add-helpdesk-mgmt-purchase branch 2 times, most recently from a0a0bb0 to 42ffdbc Compare November 6, 2025 15:16
@nicolas-delbovier-acsone nicolas-delbovier-acsone changed the title [ADD] helpdesk_mgmt_purchase: links purchase orders and helpdesk tickets. [16.0][ADD] helpdesk_mgmt_purchase: links purchase orders and helpdesk tickets. Nov 21, 2025
@api.depends("ticket_ids")
def _compute_ticket_count(self):
for order in self:
order.ticket_count = len(order.ticket_ids)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@nicolas-delbovier-acsone you should use a read_groupto avoid perf issue if the field is accessed on a large recordsed....

@nihelgabsi-acsone nihelgabsi-acsone force-pushed the 16.0-add-helpdesk-mgmt-purchase branch from e465d5b to c69e5c2 Compare January 16, 2026 16:16
Copy link
Copy Markdown

@lmignon lmignon left a comment

Choose a reason for hiding this comment

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

@nicolas-delbovier-acsone please make sure to fill in the README.rst files with the module info and remove any empty ones.

The button to view Helpdesk tickets from a Purchase Order was incorrectly
passing a 'default_sale_order_id' in the action context due to a
copy-paste error from the sales module.

This caused new tickets created from a PO view to be linked to an
unrelated Sale Order.
Shifting the action logic to Python facilitates dynamic customization. This approach allows inheriting modules to override or extend the action via super(), avoiding the limitations and complexity of XML xpath inheritance for conditional logic
Following the removal of the erroneous 'default_sale_order_id' from
the purchase action, this commit strengthens the test suite to
prevent regressions.

The test logic now explicitly validates the content of the action
context. This ensures that:
- The expected Purchase Order ID is present.
- No unrelated context keys (like 'default_sale_order_id') are
  leaking into the view from inherited methods or copy-paste errors.
@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-add-helpdesk-mgmt-purchase branch from 3d6ed92 to de624f4 Compare March 13, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants