Can you please help me to solve my problem. The following is my xml code and "user_type" it is my class function.
<template id="user_type" inherit_id="website_sale.products_item" name="Products item standard">
<xpath expr="//span[@itemprop='price']" position="replace">
<span itemprop="price" style="display:none;" t-esc="cost_cp"/>
<span itemprop="priceCurrency" style="display:none;" t-esc="website.currency_id.name"/>
</xpath>
</template>
def user_type(self):
if self.env.user.premium_user == True:
cPrice = self.env['product.product'].browse()
cost_cp = cPrice.standard_price
return cost_cp
else :
return self.env['sale.order'].browse(product.price)