trytond-patches/statement_of_account.diff

43 lines
1.8 KiB
Diff

diff --git a/tryton/modules/account/account.py b/tryton/modules/account/account.py
index 11225ae174..b5f981085f 100644
--- a/tryton/modules/account/account.py
+++ b/tryton/modules/account/account.py
@@ -2123,7 +2123,7 @@ class GeneralLedgerAccountContext(ModelView):
'General Ledger Account Context'
__name__ = 'account.general_ledger.account.context'
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
- required=True,
+ required=False,
domain=[
('company', '=', Eval('company')),
],
@@ -2134,7 +2134,8 @@ class GeneralLedgerAccountContext(ModelView):
('start_date', '<=', (Eval('end_period'), 'start_date')),
],
states={
- 'invisible': Eval('from_date', False) | Eval('to_date', False),
+ 'invisible': (Eval('from_date', False) | Eval('to_date', False)
+ | ~Eval('fiscalyear', False))
})
end_period = fields.Many2One('account.period', 'End Period',
domain=[
@@ -2142,7 +2143,8 @@ class GeneralLedgerAccountContext(ModelView):
('start_date', '>=', (Eval('start_period'), 'start_date'))
],
states={
- 'invisible': Eval('from_date', False) | Eval('to_date', False),
+ 'invisible': (Eval('from_date', False) | Eval('to_date', False)
+ | ~Eval('fiscalyear', False))
})
from_date = fields.Date("From Date",
domain=[
@@ -2378,7 +2380,7 @@ class GeneralLedgerLine(DescriptionOriginMixin, ModelSQL, ModelView):
def __setup__(cls):
super(GeneralLedgerLine, cls).__setup__()
cls.__access__.add('account')
- cls._order.insert(0, ('date', 'ASC'))
+ cls._order = [('date', 'DESC'), ('id', 'DESC')]
cls.description_used.setter = None
@classmethod