I have this error Expected singleton: salesman.period.kpi.line
this is my py file
class KpiLine(models.Model):
_name='salesman.period.kpi.line'
kpi_by_hr = fields.Float('KPI By Header')
check_field_line = fields.Boolean('Check', compute='get_user_line')
def get_user_line(self):
for line in self:
if self.env.user == line.kpi_id.user_id:
self.check_field_line = False
else:
self.check_field_line = True
This is my xml
<field name="kpi_by_hr" attrs="{'readonly': [('check_field_line', '!=', True)]}" />
My goal is to make kpi_by_hr readonly only when the creator open the document, but not for others