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

Module: Project Task Stock

Entity: stock.move

Compute Method: _compute_show_cancel_button_in_task

Inputs Method Outputs
dp = self.env["decimal.precision"].precision_get("Product Unit of Measure")
for item in self:
            item.show_cancel_button_in_task = bool(
                item.raw_material_task_id
                and item.raw_material_task_id.stock_moves_is_locked
                and item.raw_material_task_id.done_stock_moves
                and item.state not in ("draft", "cancel")
                and (
                    (
                        item.state == "done"
                        and not float_is_zero(item.quantity, precision_digits=dp)
                    )
                    or (
                        item.state != "done"
                        and not float_is_zero(item.product_uom_qty, precision_digits=dp)
                    )
                )
            )

Back to entity