mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
diff --git a/account.py b/account.py
|
|
index 974a027..60b320f 100644
|
|
--- a/tryton/modules/account/account.py
|
|
+++ a/tryton/modules/account/account.py
|
|
@@ -2035,7 +2035,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')),
|
|
],
|
|
@@ -2046,7 +2046,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=[
|
|
@@ -2054,7 +2055,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=[
|
|
@@ -2262,7 +2264,7 @@ class GeneralLedgerLine(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')]
|
|
|
|
@classmethod
|
|
def table_query(cls):
|