I use the get_product_price_rule() function from 'product.pricelist' model. My code is:
price = self._get_display_price(product)
The error log is:
File "/odoo/addons/sale/models/sale.py", line 875, in _get_display_price
final_price1, rule_id1 = self.order_id.pricelist_id.with_context(product_context).get_product_price_rule(product,self.product_uom_qty or 1.0, self.order_id.partner_id)
File "/odoo/addons/product/models/product_pricelist.py", line 264, in get_product_price_rule
self.ensure_one()
File "/odoo/odoo/models.py", line 4844, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: product.pricelist()
How to solve this error? My goal is to get the product display price. I need a solution and advice.