From a6c836cc00ef193d0c517081e53af7f9453ad12c Mon Sep 17 00:00:00 2001 From: Jared Esparza Date: Mon, 7 Mar 2022 15:48:51 +0100 Subject: [PATCH] Add statement_of_account and statement_of_account_2 | #049616 --- series | 6 ++-- statement_of_account.diff | 64 ++++++++++++++++++++----------------- statement_of_account_2.diff | 27 ++++++++++++++++ 3 files changed, 65 insertions(+), 32 deletions(-) create mode 100644 statement_of_account_2.diff diff --git a/series b/series index 6881faa..67593f4 100644 --- a/series +++ b/series @@ -17,8 +17,6 @@ search_warehouse.diff # [stock] search function for warehouse issue10467.diff # [stock_lot] add lot to grouping when assign try if lot it's required on product issue8702.diff # [stock_supply_forecast] Support production forecast -statement_of_account.diff # [account] Cumulate balance of previous fiscal years - model.diff # [trytond] Allows dynamic fields in Model as required by the wizard in sale_pos_template_quantities issue9802.diff # [stock] Improve performance when partially assigning moves @@ -32,3 +30,7 @@ sao_remove_email.diff # [sao] Removes the email button from the toolbar worker_logger.diff #[trytond] Move exception handling into transaction to keep the database name issue8952.diff # [country] Use Tryton's CDN to download postal codes Remove on 6.4 + +statement_of_account.diff # [account] Cumulate balance of previous fiscal years + +statement_of_account_2.diff # [account] Use from_date and to_date from context in _debit_credit_context() (pending core) diff --git a/statement_of_account.diff b/statement_of_account.diff index 403f37f..ba43d7c 100644 --- a/statement_of_account.diff +++ b/statement_of_account.diff @@ -1,37 +1,41 @@ -diff -r 62f81d7eb78b account.py ---- a/trytond/trytond/modules/account/account.py Fri Jul 07 10:04:01 2017 +0200 -+++ b/trytond/trytond/modules/account/account.py Fri Jul 07 10:30:29 2017 +0200 -@@ -2009,7 +2009,7 @@ +diff --git a/account.py b/account.py +index 6c17998..e463b58 100644 +--- a/trytond/trytond/modules/account/account.py ++++ b/trytond/trytond/modules/account/account.py +@@ -1917,14 +1917,15 @@ class GeneralLedgerAccountContext(ModelView): + 'General Ledger Account Context' + __name__ = 'account.general_ledger.account.context' + fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year', +- required=True) ++ required=False) + start_period = fields.Many2One('account.period', 'Start Period', + domain=[ + ('fiscalyear', '=', Eval('fiscalyear')), + ('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)), + }, + depends=['fiscalyear', 'end_period', 'from_date', 'to_date']) + end_period = fields.Many2One('account.period', 'End Period', +@@ -1933,7 +1934,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)), + }, + depends=['fiscalyear', 'start_period', 'from_date', 'to_date']) + from_date = fields.Date("From Date", +@@ -2145,7 +2147,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): -@@ -2057,7 +2057,7 @@ - line_query, fiscalyear_ids = Line.query_get(line) - return line.join(move, condition=line.move == move.id - ).join(account, condition=line.account == account.id -- ).select(*columns, where=line_query) -+ ).select(*columns) - - def get_party_required(self, name): - return self.account.party_required -diff -r 62f81d7eb78b view/general_ledger_line_context_form.xml ---- a/trytond/trytond/modules/account/view/general_ledger_line_context_form.xml Fri Jul 07 10:04:01 2017 +0200 -+++ b/trytond/trytond/modules/account/view/general_ledger_line_context_form.xml Fri Jul 07 10:30:29 2017 +0200 -@@ -6,4 +6,12 @@ -