From ff948820bfba56f2ff67cbe138eedc64ce03f232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 2 Sep 2018 10:44:38 +0200 Subject: [PATCH] Use dropdown for attachments issue7659 review50551002 --- trytond/ir/attachment.py | 5 +++++ trytond/ir/view/attachment_form.xml | 8 +++++--- trytond/ir/view/attachment_list.xml | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/trytond/ir/attachment.py b/trytond/ir/attachment.py index a2f617a510..c9f92a100c 100644 --- a/trytond/ir/attachment.py +++ b/trytond/ir/attachment.py @@ -51,6 +51,11 @@ class Attachment(ResourceMixin, ModelSQL, ModelView): 'invisible': Eval('type') != 'data', }, depends=['type']), 'get_size') + @classmethod + def __setup__(cls): + super().__setup__() + cls._order.insert(0, ('create_date', 'DESC')) + @classmethod def __register__(cls, module_name): cursor = Transaction().connection.cursor() diff --git a/trytond/ir/view/attachment_form.xml b/trytond/ir/view/attachment_form.xml index 0e8f8794f0..0a14e6e46f 100644 --- a/trytond/ir/view/attachment_form.xml +++ b/trytond/ir/view/attachment_form.xml @@ -6,9 +6,11 @@ this repository contains the full copyright notices and license terms. -->