Hello. I extend sale.order model with a field. As result I want to get a tree view with a char field that contains a string made of all product names of an order.
class SaleOrderInherit(models.Model):
_inherit = 'sale.order'
order_products = fields.Char(string='Order products', compute='_compute_order_products')
@api.depends('order_line.product_id')
def _compute_order_products(self):
for _order in self:
s_order_products = ''
for _order_line in _order.order_line:
s_order_products += str(_order_line.product_id.name) + ', '
_order.order_products = s_order_products[:-2]
I get this error:
The requested operation ("read" on "Product" (product.product)) was rejected because of the following rules:
(Records: False (id=3), User: Administrator (id=2))
Implicitly accessed through 'Product' (product.product).
Set permission in Odoo: https://goo.gl/8DZYRT