Order journal by matching sequence when searching for match
Journals are ordered by default by name instead of matching sequence. Closes #13001
This commit is contained in:
@@ -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,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"/>
|
||||
|
||||
Reference in New Issue
Block a user