from odoo import models


class ProductProduct(models.Model):
    _inherit = "product.product"

    def price_compute(
        self, price_type, uom=None, currency=None, company=None, date=False
    ):
        """Return dummy not falsy prices when computation is done from supplier
        info for avoiding error on super method. We will later fill these with
        correct values.
        """
        if price_type == "last_purchase_price":
            return dict.fromkeys(self.ids, 1.0)
        return super().price_compute(
            price_type,
            uom=uom,
            currency=currency,
            company=company,
            date=date,
        )
