Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Purchase Agreements
Entity: purchase.requisition.line
Compute Method: _compute_parent_id
| Inputs | Method | Outputs |
|---|---|---|
|
+ purchase_requisition_lines = set(self) + for requisition, lines in self.grouped('requisition_id').items(): + if not requisition: + lines.parent_id = False + continue + last_section = False + last_subsection = False + for line in requisition.line_ids.sorted('sequence'): + if line.display_type == 'line_section': + last_section = line + if line in purchase_requisition_lines: + line.parent_id = False + last_subsection = False + elif line.display_type == 'line_subsection': + if line in purchase_requisition_lines: + line.parent_id = last_section + last_subsection = line + elif line in purchase_requisition_lines: + line.parent_id = last_subsection or last_section |
|
