Order first by length field filled by sequence
issue11638 review437311003
This commit is contained in:
+6
-1
@@ -8,7 +8,7 @@ from itertools import chain, combinations, groupby
|
||||
from sql import Null
|
||||
from sql.aggregate import Sum
|
||||
from sql.conditionals import Case, Coalesce
|
||||
from sql.functions import Round
|
||||
from sql.functions import CharLength, Round
|
||||
|
||||
from trytond import backend
|
||||
from trytond.config import config
|
||||
@@ -419,6 +419,11 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
# Migration from 5.8: drop foreign key for sequence
|
||||
table.drop_fk('sequence')
|
||||
|
||||
@classmethod
|
||||
def order_number(cls, tables):
|
||||
table, _ = tables[None]
|
||||
return [CharLength(table.number), table.number]
|
||||
|
||||
@staticmethod
|
||||
def default_type():
|
||||
return Transaction().context.get('type', 'out')
|
||||
|
||||
Reference in New Issue
Block a user