Order first by length field filled by sequence
issue11638 review437311003
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
from decimal import Decimal
|
||||
from itertools import chain
|
||||
|
||||
from sql.functions import CharLength
|
||||
|
||||
from trytond import backend
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
@@ -213,6 +215,11 @@ class PurchaseRequisition(Workflow, ModelSQL, ModelView):
|
||||
[table.state], ['cancelled'],
|
||||
where=table.state == 'cancel'))
|
||||
|
||||
@classmethod
|
||||
def order_number(cls, tables):
|
||||
table, _ = tables[None]
|
||||
return [CharLength(table.number), table.number]
|
||||
|
||||
@classmethod
|
||||
def default_state(cls):
|
||||
return 'draft'
|
||||
|
||||
Reference in New Issue
Block a user