FIX access rights because by missing readonly=True on related field

This commit is contained in:
Alexis de Lattre
2016-01-21 23:15:00 +01:00
parent 607968983b
commit 2c760935af

View File

@@ -28,3 +28,15 @@ class SaleOrder(models.Model):
warehouse_id = fields.Many2one(track_visibility='onchange')
incoterm = fields.Many2one(track_visibility='onchange')
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
# The sale_stock module defines the field product_tmpl_id as related
# field without readonly=True, which causes some access right issues
# when you change the product on a sale.order.line and you don't have
# write access on product.product
product_tmpl_id = fields.Many2one(
'product.template', related='product_id.product_tmpl_id',
string='Product Template', readonly=True)