diff --git a/account_banking_reconciliation/__manifest__.py b/account_banking_reconciliation/__manifest__.py index 527bba53..02569508 100644 --- a/account_banking_reconciliation/__manifest__.py +++ b/account_banking_reconciliation/__manifest__.py @@ -5,13 +5,16 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Bank Account Reconciliation", + "summary": "Check transactions that cleared the bank", "version": "11.0.1.0.0", "license": "AGPL-3", "category": "Accounting and Financial Management", - "author": "NovaPoint Group LLC, Open Source Integrators, " + "author": "NovaPoint Group LLC, " + "Open Source Integrators, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-reconcile", "depends": [ + "account_invoicing", "account_voucher", ], "data": [ @@ -20,7 +23,9 @@ "views/account_banking_reconciliation.xml", "views/account_move_line.xml", "report/bank_statement_report.xml", - "views/report_bank_statement_summary.xml", - "views/report_bank_statement_detail.xml"], + "report/report_bank_statement_summary.xml", + "report/report_bank_statement_detail.xml"], "installable": True, + "development_status": "Stable", + "maintainers": ["max3903"], } diff --git a/account_banking_reconciliation/models/account_banking_reconciliation.py b/account_banking_reconciliation/models/account_banking_reconciliation.py index 169b2741..1b1b8bf4 100644 --- a/account_banking_reconciliation/models/account_banking_reconciliation.py +++ b/account_banking_reconciliation/models/account_banking_reconciliation.py @@ -54,9 +54,8 @@ class BankAccRecStatement(models.Model): @api.multi def unlink(self): - """Reset the related account.move.line to be re-assigned later - to statement.""" - self.check_group() # Check if user is allowed to perform the action + """Check if the user is allowed to perform the action""" + self.check_group() return super(BankAccRecStatement, self).unlink() @api.multi @@ -188,7 +187,7 @@ class BankAccRecStatement(models.Model): line.cleared_bank_account and \ float_round(line.amountcur, account_precision) or 0.0 statement.sum_of_credits_lines += \ - line.cleared_bank_account and 1.0 or 0.0 + line.cleared_bank_account and 1 or 0 statement.sum_of_ucredits += \ (not line.cleared_bank_account) and \ float_round(line.amount, account_precision) or 0.0 @@ -196,7 +195,7 @@ class BankAccRecStatement(models.Model): (not line.cleared_bank_account) and \ float_round(line.amountcur, account_precision) or 0.0 statement.sum_of_ucredits_lines += \ - (not line.cleared_bank_account) and 1.0 or 0.0 + (not line.cleared_bank_account) and 1 or 0 for line in statement.debit_move_line_ids: statement.sum_of_debits += \ line.cleared_bank_account and \ @@ -205,7 +204,7 @@ class BankAccRecStatement(models.Model): line.cleared_bank_account and \ float_round(line.amountcur, account_precision) or 0.0 statement.sum_of_debits_lines += \ - line.cleared_bank_account and 1.0 or 0.0 + line.cleared_bank_account and 1 or 0 statement.sum_of_udebits += \ (not line.cleared_bank_account) and \ float_round(line.amount, account_precision) or 0.0 @@ -213,7 +212,7 @@ class BankAccRecStatement(models.Model): (not line.cleared_bank_account) and \ float_round(line.amountcur, account_precision) or 0.0 statement.sum_of_udebits_lines += \ - (not line.cleared_bank_account) and 1.0 or 0.0 + (not line.cleared_bank_account) and 1 or 0 statement.cleared_balance = float_round( statement.sum_of_debits - statement.sum_of_credits, account_precision) @@ -288,9 +287,8 @@ class BankAccRecStatement(models.Model): reslist = [] statement_obj = self.env['bank.acc.rec.statement'] domain = [('account_id', '=', account_id), ('state', '=', 'done')] - statement_ids = statement_obj.search(domain) # get all statements for this account in the past - for statement in statement_ids: + for statement in statement_obj.search(domain): if statement.ending_date < ending_date: reslist.append( (statement.ending_date, statement.ending_balance)) @@ -306,7 +304,7 @@ class BankAccRecStatement(models.Model): statement_line_obj = self.env['bank.acc.rec.statement.line'] val = { 'value': {'credit_move_line_ids': [], 'debit_move_line_ids': []}} - if self.account_id: + if self.ending_date and self.account_id: for statement in self: statement_line_ids = statement_line_obj.search( [('statement_id', '=', statement.id)]) @@ -326,8 +324,7 @@ class BankAccRecStatement(models.Model): ('cleared_bank_account', '=', False)] if not self.suppress_ending_date_filter: domain += [('date', '<=', self.ending_date)] - line_ids = account_move_line_obj.search(domain) - for line in line_ids: + for line in account_move_line_obj.search(domain): amount_currency = (line.amount_currency < 0) and ( -1 * line.amount_currency) or line.amount_currency res = { @@ -355,7 +352,7 @@ class BankAccRecStatement(models.Model): def get_default_company_id(self): return self.env['res.users'].browse([self.env.uid]).company_id.id - name = fields.Char('Name', required=True, size=64, copy=False, default='', + name = fields.Char('Name', required=True, size=64, states={'done': [('readonly', True)]}, help="This is a unique name identifying " "the statement (e.g. Bank X January 2012).") @@ -388,11 +385,13 @@ class BankAccRecStatement(models.Model): notes = fields.Text('Notes') verified_date = fields.Date('Verified Date', states={'done': [('readonly', True)]}, + copy=False, help="Date in which Deposit " "Ticket was verified.") verified_by_user_id = fields.Many2one('res.users', 'Verified By', states={ 'done': [('readonly', True)]}, + copy=False, help="Entered automatically by " "the “last user” who saved it. " "System generated.") @@ -472,17 +471,17 @@ class BankAccRecStatement(models.Model): digits=dp.get_precision('Account'), help="Total SUM of Amts of lines " "with Cleared = True") - sum_of_credits_lines = fields.Float(compute='_compute_get_balance', - string='Checks, Withdrawals, Debits, ' - 'and Service Charges # of ' - 'Items', - help="Total of number of lines with " - "Cleared = True") - sum_of_debits_lines = fields.Float(compute='_compute_get_balance', - string='Deposits, Credits, and Interest' - ' # of Items', - help="Total of number of lines with" - " Cleared = True") + sum_of_credits_lines = fields.Integer(compute='_compute_get_balance', + string='''Checks, Withdrawals, + Debits, and Service Charges # of + Items''', + help="Total of number of lines with " + "Cleared = True") + sum_of_debits_lines = fields.Integer(compute='_compute_get_balance', + string='''Deposits, Credits, and + Interest # of Items''', + help="Total of number of lines with" + " Cleared = True") sum_of_ucredits = fields.Float(compute='_compute_get_balance', string='Uncleared - Checks, Withdrawals, ' 'Debits, and Service Charges Amount', @@ -508,17 +507,17 @@ class BankAccRecStatement(models.Model): digits=dp.get_precision('Account'), help="Total SUM of Amts of lines with" " Cleared = False") - sum_of_ucredits_lines = fields.Float(compute='_compute_get_balance', - string='Uncleared - Checks, ' - 'Withdrawals, Debits, and ' - 'Service Charges # of Items', - help="Total of number of lines with" - " Cleared = False") - sum_of_udebits_lines = fields.Float(compute='_compute_get_balance', - string='Uncleared - Deposits, Credits,' - ' and Interest # of Items', - help="Total of number of lines " - "with Cleared = False") + sum_of_ucredits_lines = fields.Integer(compute='_compute_get_balance', + string='Uncleared - Checks, ' + 'Withdrawals, Debits, and ' + 'Service Charges # of Items', + help="Total of number of lines with" + " Cleared = False") + sum_of_udebits_lines = fields.Integer(compute='_compute_get_balance', + string='''Uncleared - Deposits, + Credits, and Interest # of Items''', + help="Total of number of lines " + "with Cleared = False") suppress_ending_date_filter = fields.Boolean('Remove Ending Date Filter', help="If this is checked then" " the Statement End Date" @@ -531,7 +530,7 @@ class BankAccRecStatement(models.Model): ('draft', 'Draft'), ('to_be_reviewed', 'Ready for Review'), ('done', 'Done'), - ('cancel', 'Cancel') + ('cancel', 'Cancelled') ], 'State', index=True, readonly=True, default='draft') _sql_constraints = [ @@ -540,6 +539,15 @@ class BankAccRecStatement(models.Model): 'company and G/L account!') ] + @api.multi + def copy(self, default=None): + for rec in self: + if default is None: + default = {} + if 'name' not in default: + default['name'] = _("%s (copy)") % rec.name + return super(BankAccRecStatement, self).copy(default=default) + class BankAccRecStatementLine(models.Model): _name = "bank.acc.rec.statement.line" diff --git a/account_banking_reconciliation/readme/CONFIGURE.rst b/account_banking_reconciliation/readme/CONFIGURE.rst new file mode 100644 index 00000000..4907499f --- /dev/null +++ b/account_banking_reconciliation/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +To configure this module + +* Go to Settings and activate the developer mode +* Go to Settings > Users and Companies > Users +* Add users who will prepare the bank statements to the "Bank Statement Preparer" +* Add users who will verify them to the "Bank Statement Manager" group diff --git a/account_banking_reconciliation/readme/CONTRIBUTORS.rst b/account_banking_reconciliation/readme/CONTRIBUTORS.rst index f807082c..ba398eb5 100644 --- a/account_banking_reconciliation/readme/CONTRIBUTORS.rst +++ b/account_banking_reconciliation/readme/CONTRIBUTORS.rst @@ -2,4 +2,4 @@ * Balaji Kannan * Bhavesh Odedra * Sandeep Mangukiya -* Serpent Consulting Services Pvt. Ltd. +* Murtuza Saleh diff --git a/account_banking_reconciliation/readme/CREDITS.rst b/account_banking_reconciliation/readme/CREDITS.rst new file mode 100644 index 00000000..36ef7743 --- /dev/null +++ b/account_banking_reconciliation/readme/CREDITS.rst @@ -0,0 +1,3 @@ +* Nova Point Group +* Open Source Integrators +* Serpent Consulting Services Pvt. Ltd. diff --git a/account_banking_reconciliation/readme/USAGE.rst b/account_banking_reconciliation/readme/USAGE.rst new file mode 100644 index 00000000..c38984e9 --- /dev/null +++ b/account_banking_reconciliation/readme/USAGE.rst @@ -0,0 +1,11 @@ +To use this module: + +* Go to Accounting > Adviser > Bank Statements +* Create a new bank statement +* Select the account and provide a name +* Enter the ending balance from the bank statement +* Check the transactions that cleared the bank +* Check the balances +* Save and submit for review +* As a reviewer, check the transactions, totals and balances +* Click on Process diff --git a/account_banking_reconciliation/views/report_bank_statement_detail.xml b/account_banking_reconciliation/report/report_bank_statement_detail.xml similarity index 95% rename from account_banking_reconciliation/views/report_bank_statement_detail.xml rename to account_banking_reconciliation/report/report_bank_statement_detail.xml index 51a12388..99daf24f 100644 --- a/account_banking_reconciliation/views/report_bank_statement_detail.xml +++ b/account_banking_reconciliation/report/report_bank_statement_detail.xml @@ -6,14 +6,13 @@
-

+

Reconciliation Detail -

+

Period Ending
-
@@ -23,8 +22,8 @@ - - + + @@ -42,11 +41,12 @@ - - + + +
Date Comment PartnerReferenceClearedReferenceCleared Date Comment PartnerReferenceClearedReferenceCleared Cleared
@@ -141,7 +141,9 @@ - + + + - + + + - + + + - + + +
-

+

Reconciliation Summary -

+

Period Ending
-
diff --git a/account_banking_reconciliation/security/account_banking_reconciliation.xml b/account_banking_reconciliation/security/account_banking_reconciliation.xml index 11371b4f..24363fa2 100644 --- a/account_banking_reconciliation/security/account_banking_reconciliation.xml +++ b/account_banking_reconciliation/security/account_banking_reconciliation.xml @@ -1,12 +1,18 @@ + Bank Statement Preparer + + Bank Statement Verifier + + + @@ -15,7 +21,9 @@ - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + ['|', + ('company_id', '=', False), + ('company_id', 'child_of', [user.company_id.id])] diff --git a/account_banking_reconciliation/views/account_banking_reconciliation.xml b/account_banking_reconciliation/views/account_banking_reconciliation.xml index e1aa20be..7d045138 100644 --- a/account_banking_reconciliation/views/account_banking_reconciliation.xml +++ b/account_banking_reconciliation/views/account_banking_reconciliation.xml @@ -26,39 +26,49 @@
-
- - - - - - - - - +
+

+ +

+
+ + + + + + + + + + + + @@ -69,34 +79,36 @@ nolabel="1" widget="one2many_list" height="300"> - - - - - - - - - + + + + + + + + + + + + mute_additem="draft,to_be_reviewed,done, cancel" + create="0"> - +
- - - - - - - - - + + + + + + + + + + + + mute_additem="draft,to_be_reviewed,done, cancel" + create="0"> @@ -173,12 +188,8 @@ string="Unselect All" icon="fa-close"/>
- - - - - + + @@ -186,7 +197,7 @@ - + @@ -195,11 +206,8 @@ - - - - + + @@ -207,7 +215,7 @@ - + @@ -215,15 +223,17 @@ - - - - - - + + + + + + + @@ -262,7 +272,8 @@
- + - account.move.line.bank.acc.rec.statement.id + account.move.line account.move.line search @@ -24,8 +24,7 @@ - account.move.line.bank.acc.rec.statement.id.form - + account.move.line.form account.move.line form