Ensure rec_name is a char, text type

Model.default_get with 'default_rec_name' context relies on the fact that
rec_name is a string base field.

issue6630
review36501002
This commit is contained in:
Cédric Krier committed 2017-07-26 23:43:29 +02:00
1 parent d899993a3a
commit a7b9af3a2e
1 file changed
+3 -1
+3 -1
View File
@@ -73,7 +73,6 @@ class Employee:
class EmployeeCostPrice(ModelSQL, ModelView):
'Employee Cost Price'
__name__ = 'company.employee_cost_price'
_rec_name = 'date'
date = fields.Date('Date', required=True, select=True)
cost_price = fields.Numeric('Cost Price',
digits=price_digits, required=True, help="Hourly cost price")
@@ -108,6 +107,9 @@ class EmployeeCostPrice(ModelSQL, ModelView):
Date = Pool().get('ir.date')
return Date.today()
def get_rec_name(self, name):
return str(self.date)
@classmethod
def delete(cls, prices):
Employee = Pool().get('company.employee')