Hello,
My class purchase.order contain the following object :
new_line = {
'order_id': False,
'product_id': line.product.id,
'name': line.product.name,
'product_qty': line.quantity,
'date_planned': i.date_to,
'product_uom': 1,
'price_unit': line.price,
'history_field': [
('first',
str(line.quantity) + ' / ' + str((good_date + datetime.timedelta(hours=2)).strftime("%x")))
]
}
Then in purchase.order.line class I want to display into a selection field the object history field :
history_field = fields.Selection([], string='Historique')
I can retrieve it, I mean when I do a print it shows good values but I've got this error :
File "/odoo/odoo-server/openerp/fields.py", line 1545, in convert_to_cache raise ValueError("Wrong value for %s: %r" % (self, value)) ValueError: Wrong value for purchase.order.line.history_field: [('first', '7.0 / 15/10/2020')]
I can see good values as inside my print in this error, but it still doesn't work.
Thanks