Skip to Content
Menu
This question has been flagged

Hello Community,

I am using odoo 14 and i want to sort hours(desc) withing datetime(desc).

i am using  _order = 'start_datetime desc, unit_amount desc' by this date is work but hours not working desc within this datetime field.


My Code is:-

class AccountAnalyticLine(models.Model):
    _inherit = 'account.analytic.line'
    _order = 'start_datetime desc, unit_amount desc'


    start_datetime = fields.Datetime("Start Time", required=True)
    unit_amount = fields.Float('Duration', default=0.0)

Thanks in advance.


Avatar
Discard
Related Posts Replies Views Activity
1
Mar 22
1504
1
May 24
1435
1
Apr 24
23290
1
Nov 22
1411
2
Jul 22
1809