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

Module: Return Merchandise Authorization Management

Entity: rma

Compute Method: _compute_can_be_replaced

Inputs Method Outputs
"""Compute 'can_be_replaced'. This field controls the visibility
        of 'Replace' button in the rma form
        view and determinates if an rma can be replaced.
        This field is used in:
        rma._compute_can_be_split
        rma._ensure_can_be_replaced.
        """
for r in self:
            r.can_be_replaced = (
                r.operation_id.action_create_delivery
                in ("manual_after_receipt", "automatic_after_receipt")
                and r.state == "received"
            ) or (
                r.operation_id.action_create_delivery
                in ("manual_on_confirm", "automatic_on_confirm")
                and r.state == "confirmed"
            )

Back to entity