Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: RMA Repair

Entity: rma

Compute Method: _compute_can_be_repaired

Inputs Method Outputs
  • repair_id
  • operation_id
  • operation_id.action_create_repair
  • state
"""Compute 'can_be_repaired'. This field controls the visibility
        of the 'repair' button in the rma form
        view and determinate if the product can be repaired
        """
for r in self:
            r.can_be_repaired = not r.repair_id and (
                (
                    r.operation_id.action_create_repair
                    in ("manual_after_receipt", "automatic_after_receipt")
                    and r.state in ["received", "waiting_return"]
                )
                or (
                    r.operation_id.action_create_repair
                    in ("manual_on_confirm", "automatic_on_confirm")
                    and r.state == "confirmed"
                )
            )

Back to entity