-
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"
)
)
|
|