Skip to content

[16.0][FIX] rma_repair: correct visibility logic for RMA smart button#570

Open
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-rma_repair-rma-button
Open

[16.0][FIX] rma_repair: correct visibility logic for RMA smart button#570
nicolas-delbovier-acsone wants to merge 1 commit into
OCA:16.0from
acsone:16.0-fix-rma_repair-rma-button

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Apr 1, 2026

Copy link
Copy Markdown

The RMA smart button used an 'invisible' condition checking for 'rma_ids' = False. In Odoo, relational fields (One2many/Many2many) return an empty recordset rather than False, causing the button to remain visible even when empty.

This PR:

  • Adds a computed 'rma_count' field to the repair order model.
  • Updates the XML to use 'rma_count' for the 'invisible' attribute.
  • Improves UI feedback by displaying the record count within the stat button.

(This follows a pattern for smart buttons that can be found in many other places)

image

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @peluko00,
some modules you are maintaining are being modified, check this out!

The RMA smart button used an 'invisible' condition checking for 'rma_ids' = False.
In Odoo, relational fields (One2many/Many2many) return an empty recordset
rather than False, causing the button to remain visible even when empty.

This commit:
- Adds a computed 'rma_count' field to the repair order model.
- Updates the XML to use 'rma_count' for the 'invisible' attribute.
- Improves UI feedback by displaying the record count within the stat button.

(This follows a pattern for smart buttons that can be found in many other places)
@nicolas-delbovier-acsone nicolas-delbovier-acsone force-pushed the 16.0-fix-rma_repair-rma-button branch from 672cc71 to e6bec94 Compare April 1, 2026 09:40
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.

2 participants