From a7b9af3a2e45b94e78b50ea66236cd613996a2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 26 Jul 2017 23:43:29 +0200 Subject: [PATCH] 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 --- company.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/company.py b/company.py index 1872a0c48b..6dacf4556a 100644 --- a/company.py +++ b/company.py @@ -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')