[FIX]Radicale Odoo Storage : should return last modified, event if there is no event in database
This commit is contained in:
parent
3659f811ea
commit
258ccac379
@ -339,5 +339,7 @@ class Collection(BaseCollection):
|
||||
def last_modified(self):
|
||||
""" Return last modified """
|
||||
last = self.odoo.env[self.odoo_model].search([], limit=1, order='write_date desc')
|
||||
last_fields = self.odoo.execute(self.odoo_model, 'read', last, ['write_date'])[0]
|
||||
return str(last_fields['write_date'])
|
||||
if last:
|
||||
last_fields = self.odoo.execute(self.odoo_model, 'read', last, ['write_date'])[0]
|
||||
return str(last_fields['write_date'])
|
||||
return '1970-01-01 00:00:00'
|
||||
|
Loading…
x
Reference in New Issue
Block a user