Order journal by matching sequence when searching for match

Journals are ordered by default by name instead of matching sequence.

Closes #13001
(grafted from 8208738ff1889474331276024c531f914946856e)

--HG--
branch : 7.0
This commit is contained in:
Maxime Richez
2024-02-12 23:22:23 +01:00
parent f424227dce
commit 8f44c6b46a
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -156,7 +156,12 @@ class Journal(
@classmethod
def find(cls, pattern):
for journal in cls.search([]):
for journal in cls.search(
[],
order=[
('matching_sequence', 'ASC'),
('id', 'ASC'),
]):
if journal.match(pattern):
return journal
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree sequence="matching_sequence">
<tree>
<field name="code"/>
<field name="name" expand="1"/>
<field name="type"/>