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

Module: MRP Subcontracting

Entity: stock.move

Compute Method: _compute_show_subcontracting_details_visible

Inputs Method Outputs
""" Compute if the action button in order to see moves raw is visible """
self.show_subcontracting_details_visible = False
for move in self:
            if not move.is_subcontract:
                continue
            if float_is_zero(move.quantity, precision_rounding=move.product_uom.rounding):
                continue
            productions = move._get_subcontract_production()
            if not productions or (productions[:1].consumption == 'strict' and not productions[:1]._has_tracked_component()):
                continue
            move.show_subcontracting_details_visible = move.state == 'done' or any(prod.subcontracting_has_been_recorded and prod.state != 'done' for prod in productions)

Back to entity