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

Module: DDMRP

Entity: stock.buffer

Compute Method: _compute_product_vendor_code

Inputs Method Outputs
for rec in self:
            if not rec.main_supplier_id:
                rec.product_vendor_code = False
                continue
            supplier_info = rec._get_product_sellers().filtered(
                lambda r: r.partner_id == rec.main_supplier_id  # noqa: B023
                and (not r.product_id or r.product_id == rec.product_id)  # noqa: B023
            )
            rec.product_vendor_code = (
                supplier_info[0].product_code if supplier_info else False
            )

Back to entity