Skip to Content
Menu
This question has been flagged
4 Replies
1913 Views

Dear all,

I created an extra view (sales history) for sale.order.line and now want to get the field date_order from sale.order and put it into my in sale.order.line inherited field order_date. Coudl anyone help a newbie with the code?

Best regards

Paul

Avatar
Discard
Best Answer
order_date = fields.Datetime(
        string='Order Date',
        related='order_id.date_order',
    )
Avatar
Discard
Author

Hi Ray, thank you very much! It works perfect! Best regards, Paul

Author

Is it posible only to have the date without the time in order_date? Changing to Date instead Datetime throws an error. Formating the view makes it complicated to search by date.

Author Best Answer

Is it posible only to have the date without the time in order_date? Changing to Date instead Datetime throws an error. Formating the view makes it complicated to search by date (you have to take care of the time).

Avatar
Discard