Allow filtering general ledger by journal
As general ledger is historically the consolidation of each journal, it may be useful to permit to display the ledger of each journal. issue8757 review335351002
This commit is contained in:
1 parent
20fc4a4bdc
commit
d1395db4d7
5 files changed
+15
-1
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Allow filtering general ledger by journal
|
||||
* Add journal context to Move.query_get
|
||||
* Add reconciliation to general ledger line
|
||||
* Make move's journal read-only once numbered
|
||||
* Add more term units to aged balance
|
||||
|
||||
@@ -1826,6 +1826,9 @@ class GeneralLedgerAccountContext(ModelView):
|
||||
depends=['from_date'])
|
||||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
posted = fields.Boolean('Posted Move', help="Only included posted moves.")
|
||||
journal = fields.Many2One(
|
||||
'account.journal', "Journal",
|
||||
help="Only included moves from the journal.")
|
||||
|
||||
@classmethod
|
||||
def default_fiscalyear(cls):
|
||||
@@ -1852,6 +1855,10 @@ class GeneralLedgerAccountContext(ModelView):
|
||||
def default_posted(cls):
|
||||
return Transaction().context.get('posted', False)
|
||||
|
||||
@classmethod
|
||||
def default_journal(cls):
|
||||
return Transaction().context.get('journal')
|
||||
|
||||
@classmethod
|
||||
def default_from_date(cls):
|
||||
return Transaction().context.get('from_date')
|
||||
|
||||
+1
-1
@@ -298,7 +298,7 @@ class FiscalYear(Workflow, ModelSQL, ModelView):
|
||||
Period.close(periods)
|
||||
|
||||
with Transaction().set_context(fiscalyear=fiscalyear.id,
|
||||
date=None, cumulate=True):
|
||||
date=None, cumulate=True, journal=None):
|
||||
accounts = Account.search([
|
||||
('company', '=', fiscalyear.company.id),
|
||||
])
|
||||
|
||||
@@ -986,6 +986,9 @@ class Line(ModelSQL, ModelView):
|
||||
if context.get('posted'):
|
||||
where &= move.state == 'posted'
|
||||
|
||||
if context.get('journal'):
|
||||
where &= move.journal == context['journal']
|
||||
|
||||
date = context.get('date')
|
||||
from_date, to_date = context.get('from_date'), context.get('to_date')
|
||||
fiscalyear_id = context.get('fiscalyear')
|
||||
|
||||
@@ -17,4 +17,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="from_date"/>
|
||||
<label name="to_date"/>
|
||||
<field name="to_date"/>
|
||||
<label name="journal"/>
|
||||
<field name="journal" widget="selection"/>
|
||||
</form>
|
||||
Reference in new issue
Block a user