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:23 +02:00
1 parent be2fa6fa5b
commit 6db7feaea2
1 file changed
+3 -1
+3 -1
View File
@@ -22,7 +22,6 @@ class ProductCostPrice:
class ProductCostHistory(ModelSQL, ModelView):
'History of Product Cost'
__name__ = 'product.product.cost_history'
_rec_name = 'date'
product = fields.Many2One('product.product', "Product")
date = fields.DateTime('Date')
cost_price = fields.Numeric('Cost Price')
@@ -50,6 +49,9 @@ class ProductCostHistory(ModelSQL, ModelView):
Coalesce(history.write_date, history.create_date),
history.product, history.cost_price))
def get_rec_name(self, name):
return str(self.date)
class OpenProductCostHistory(Wizard):
'Open Product Cost History'