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

Module: Purchase Requisition Line Description

Entity: purchase.requisition.line

Compute Method: _compute_name

View 18.0
Inputs Method Outputs
  • requisition_id
  • requisition_id.purchase_ids
  • product_id
- """
-         New method is triggered when the `product_id` field is changed.
-         It updates the `name` field (description) based on the selected product
-         and the partner's language and purchase description.
-         """
- for line in self:
-             partner = first(line.requisition_id.purchase_ids).partner_id
-             product_lang = line.product_id.with_context(
-                 lang=partner.lang, partner_id=partner.id
-             )
-             name = product_lang.display_name
-             if product_lang.description_purchase:
-                 name += f"\n{product_lang.description_purchase}"
-             line.name = name
  • name

Back to entity