Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion rma_repair/models/repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class RepairOrder(models.Model):
rma_line_id = fields.Many2one(
comodel_name="rma.order.line", string="RMA", ondelete="restrict"
)
under_warranty = fields.Boolean(
rma_under_warranty = fields.Boolean(
string="Under Warranty",
related="rma_line_id.under_warranty",
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow Aug 5, 2025

Choose a reason for hiding this comment

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

This was making the repair one related to the linked RMA (at least that's the intention, I have not functionally checked). In case, we don't want to disconnect them, you should fix only the view and keep only one.

If what I describe above (have both fields related) does not work as one would expect, a refactor with proper compute methods might be needed.

)
5 changes: 4 additions & 1 deletion rma_repair/views/repair_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
<field name="arch" type="xml">
<field name="tag_ids" position="after">
<field name="rma_line_id" />
<field name="under_warranty" />
<field name="rma_under_warranty" invisible="not rma_line_id" />
</field>
<xpath expr="//field[@name='under_warranty']" position="attributes">
<attribute name="invisible">rma_line_id</attribute>
</xpath>
</field>
</record>
</odoo>