Skip to content

Commit f3cf5df

Browse files
committed
[IMP] account: use better management of invalid statements
This commit brings more clarity on invalid statements. The reflected changes are : - Hiding Last Statement if its date is <= Lock Date - "Invalid Statement(s)" alert on the journal dashboard - Red balance amount and warning in the BankRecW when it contains invalid statements (clicking on the warning applies the filter) - Possibility to choose a statement when creating a transaction - Invalid statement warning in the statement creation form - Displays all warnings in the statement form view - When a file generate a statement, it is kept in its attachments - Prevent deletion of transactions if they belong to a valid statement - Empty statement are not taken into account for the dashboard Last Statement and the BankRecW balance task-4413473 closes odoo#232184 X-original-commit: bdf843a Related: odoo/enterprise#97552 Signed-off-by: Maximilien La Barre (malb) <[email protected]> Signed-off-by: Pierre-Rodéric Roose (prro) <[email protected]>
1 parent c0c0130 commit f3cf5df

File tree

6 files changed

+126
-85
lines changed

6 files changed

+126
-85
lines changed

addons/account/i18n/account.pot

Lines changed: 81 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 19.0\n"
7+
"Project-Id-Version: Odoo Server 19.0+e\n"
88
"Report-Msgid-Bugs-To: \n"
9-
"POT-Creation-Date: 2025-10-08 18:37+0000\n"
10-
"PO-Revision-Date: 2025-10-08 18:37+0000\n"
9+
"POT-Creation-Date: 2025-10-18 14:56+0000\n"
10+
"PO-Revision-Date: 2025-10-18 14:56+0000\n"
1111
"Last-Translator: \n"
1212
"Language-Team: \n"
1313
"MIME-Version: 1.0\n"
@@ -1014,8 +1014,8 @@ msgstr ""
10141014
#: model_terms:ir.ui.view,arch_db:account.portal_my_details
10151015
msgid ""
10161016
"<small class=\"form-text text-muted\">\n"
1017-
" You can choose how you want us to send your invoices, and with which electronic format.\n"
1018-
" </small>"
1017+
" You can choose how you want us to send your invoices, and with which electronic format.\n"
1018+
" </small>"
10191019
msgstr ""
10201020

10211021
#. module: account
@@ -3509,6 +3509,11 @@ msgstr ""
35093509
msgid "Automatic Entry Default Journal"
35103510
msgstr ""
35113511

3512+
#. module: account
3513+
#: model:account.fiscal.position,name:account.1_account_fiscal_position_avatax_us
3514+
msgid "Automatic Tax Mapping (AvaTax)"
3515+
msgstr ""
3516+
35123517
#. module: account
35133518
#: model:ir.model,name:account.model_sequence_mixin
35143519
msgid "Automatic sequence"
@@ -3935,11 +3940,6 @@ msgstr ""
39353940
msgid "Based on Payment"
39363941
msgstr ""
39373942

3938-
#. module: account
3939-
#: model:res.groups,name:account.group_account_basic
3940-
msgid "Basic"
3941-
msgstr ""
3942-
39433943
#. module: account
39443944
#: model:ir.model.fields,field_description:account.field_res_company__batch_payment_sequence_id
39453945
msgid "Batch Payment Sequence"
@@ -4080,6 +4080,11 @@ msgstr ""
40804080
msgid "Body content is the same as the template"
40814081
msgstr ""
40824082

4083+
#. module: account
4084+
#: model:res.groups,name:account.group_account_user
4085+
msgid "Bookkeeper"
4086+
msgstr ""
4087+
40834088
#. module: account
40844089
#: model:ir.model.fields.selection,name:account.selection__account_report_column__figure_type__boolean
40854090
#: model:ir.model.fields.selection,name:account.selection__account_report_expression__figure_type__boolean
@@ -4349,7 +4354,6 @@ msgstr ""
43494354
#. module: account
43504355
#. odoo-python
43514356
#: code:addons/account/models/account_journal.py:0
4352-
#: model:account.account,name:account.1_cash_journal_default_account_160
43534357
#: model:ir.model.fields.selection,name:account.selection__account_journal__type__cash
43544358
#: model_terms:ir.ui.view,arch_db:account.view_account_move_filter
43554359
#: model_terms:ir.ui.view,arch_db:account.view_account_move_line_filter
@@ -4361,16 +4365,6 @@ msgstr ""
43614365
msgid "Cash Account"
43624366
msgstr ""
43634367

4364-
#. module: account
4365-
#: model:account.account,name:account.1_cash_journal_default_account_157
4366-
msgid "Cash Bakery"
4367-
msgstr ""
4368-
4369-
#. module: account
4370-
#: model:account.account,name:account.1_cash_journal_default_account_159
4371-
msgid "Cash Bar"
4372-
msgstr ""
4373-
43744368
#. module: account
43754369
#: model:ir.model.fields,field_description:account.field_res_config_settings__tax_exigibility
43764370
msgid "Cash Basis"
@@ -4408,11 +4402,6 @@ msgstr ""
44084402
msgid "Cash Basis Transition Account"
44094403
msgstr ""
44104404

4411-
#. module: account
4412-
#: model:account.account,name:account.1_cash_journal_default_account_156
4413-
msgid "Cash Clothes Shop"
4414-
msgstr ""
4415-
44164405
#. module: account
44174406
#: model:ir.model.fields,field_description:account.field_res_company__default_cash_difference_expense_account_id
44184407
msgid "Cash Difference Expense"
@@ -4470,22 +4459,12 @@ msgstr ""
44704459
msgid "Cash Discount Write-Off Loss Account"
44714460
msgstr ""
44724461

4473-
#. module: account
4474-
#: model:account.account,name:account.1_cash_journal_default_account_155
4475-
msgid "Cash Furn. Shop"
4476-
msgstr ""
4477-
44784462
#. module: account
44794463
#: model:ir.actions.act_window,name:account.action_view_bank_statement_tree
44804464
#: model_terms:ir.ui.view,arch_db:account.account_journal_dashboard_kanban_view
44814465
msgid "Cash Registers"
44824466
msgstr ""
44834467

4484-
#. module: account
4485-
#: model:account.account,name:account.1_cash_journal_default_account_158
4486-
msgid "Cash Restaurant"
4487-
msgstr ""
4488-
44894468
#. module: account
44904469
#: model:ir.model.fields,field_description:account.field_res_config_settings__group_cash_rounding
44914470
msgid "Cash Rounding"
@@ -4720,6 +4699,7 @@ msgstr ""
47204699
#: model:ir.model.fields,field_description:account.field_account_payment__payment_method_code
47214700
#: model:ir.model.fields,field_description:account.field_account_payment_method__code
47224701
#: model:ir.model.fields,field_description:account.field_account_payment_method_line__code
4702+
#: model:ir.model.fields,field_description:account.field_account_payment_register__payment_method_code
47234703
#: model:ir.model.fields,field_description:account.field_account_report_line__code
47244704
#: model_terms:ir.ui.view,arch_db:account.view_account_form
47254705
#: model_terms:ir.ui.view,arch_db:account.view_account_list
@@ -5269,11 +5249,6 @@ msgstr ""
52695249
msgid "Create Payments"
52705250
msgstr ""
52715251

5272-
#. module: account
5273-
#: model:ir.model,website_form_label:account.model_res_partner
5274-
msgid "Create a Customer"
5275-
msgstr ""
5276-
52775252
#. module: account
52785253
#. odoo-python
52795254
#: code:addons/account/wizard/account_move_send_wizard.py:0
@@ -6283,6 +6258,12 @@ msgstr ""
62836258
msgid "Default taxes used when selling the product"
62846259
msgstr ""
62856260

6261+
#. module: account
6262+
#. odoo-python
6263+
#: code:addons/account/models/account_move.py:0
6264+
msgid "Default value for 'company_id' for %(record)s is not an integer"
6265+
msgstr ""
6266+
62866267
#. module: account
62876268
#: model:account.account,name:account.1_deferred_revenue
62886269
#: model:account.account,name:account.2_account_account_us_deferred_revenue
@@ -8490,6 +8471,12 @@ msgstr ""
84908471
msgid "Has Iban Warning"
84918472
msgstr ""
84928473

8474+
#. module: account
8475+
#: model:ir.model.fields,field_description:account.field_account_bank_statement__journal_has_invalid_statements
8476+
#: model:ir.model.fields,field_description:account.field_account_journal__has_invalid_statements
8477+
msgid "Has Invalid Statements"
8478+
msgstr ""
8479+
84938480
#. module: account
84948481
#: model:ir.model.fields,field_description:account.field_account_account__has_message
84958482
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__has_message
@@ -9408,6 +9395,11 @@ msgid ""
94089395
" for the zip range and \"To\" should be greater than \"From\"."
94099396
msgstr ""
94109397

9398+
#. module: account
9399+
#: model_terms:ir.ui.view,arch_db:account.account_journal_dashboard_kanban_view
9400+
msgid "Invalid Statement(s)"
9401+
msgstr ""
9402+
94119403
#. module: account
94129404
#. odoo-python
94139405
#: code:addons/account/models/account_report.py:0
@@ -9423,8 +9415,6 @@ msgstr ""
94239415

94249416
#. module: account
94259417
#: model:account.account,name:account.2_account_account_us_inventory_valuation
9426-
#: model:account.journal,name:account.1_inventory_valuation
9427-
#: model:account.journal,name:account.2_inventory_valuation
94289418
msgid "Inventory Valuation"
94299419
msgstr ""
94309420

@@ -9802,6 +9792,11 @@ msgstr ""
98029792
msgid "Invoicing"
98039793
msgstr ""
98049794

9795+
#. module: account
9796+
#: model:res.groups,name:account.group_account_basic
9797+
msgid "Invoicing & Banks"
9798+
msgstr ""
9799+
98059800
#. module: account
98069801
#: model:ir.model.fields.selection,name:account.selection__account_invoice_report__payment_state__invoicing_legacy
98079802
#: model:ir.model.fields.selection,name:account.selection__account_move__payment_state__invoicing_legacy
@@ -11405,17 +11400,6 @@ msgstr ""
1140511400
msgid "Next Activity"
1140611401
msgstr ""
1140711402

11408-
#. module: account
11409-
#: model:ir.model.fields,field_description:account.field_account_account__activity_calendar_event_id
11410-
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__activity_calendar_event_id
11411-
#: model:ir.model.fields,field_description:account.field_account_journal__activity_calendar_event_id
11412-
#: model:ir.model.fields,field_description:account.field_account_move__activity_calendar_event_id
11413-
#: model:ir.model.fields,field_description:account.field_account_payment__activity_calendar_event_id
11414-
#: model:ir.model.fields,field_description:account.field_account_setup_bank_manual_config__activity_calendar_event_id
11415-
#: model:ir.model.fields,field_description:account.field_res_partner_bank__activity_calendar_event_id
11416-
msgid "Next Activity Calendar Event"
11417-
msgstr ""
11418-
1141911403
#. module: account
1142011404
#: model:ir.model.fields,field_description:account.field_account_account__activity_date_deadline
1142111405
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__activity_date_deadline
@@ -12874,6 +12858,12 @@ msgid ""
1287412858
"Payments related to partners with no bank account specified will be skipped."
1287512859
msgstr ""
1287612860

12861+
#. module: account
12862+
#: model:ir.model.fields,help:account.field_account_bank_statement_line__reconciled_payment_ids
12863+
#: model:ir.model.fields,help:account.field_account_move__reconciled_payment_ids
12864+
msgid "Payments that have been reconciled with this invoice."
12865+
msgstr ""
12866+
1287712867
#. module: account
1287812868
#: model:account.group,name:account.2_us_group_61
1287912869
msgid "Payroll Expenses"
@@ -13542,20 +13532,6 @@ msgstr ""
1354213532
msgid "RD Expenses"
1354313533
msgstr ""
1354413534

13545-
#. module: account
13546-
#: model:ir.model.fields,field_description:account.field_account_account__rating_ids
13547-
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__rating_ids
13548-
#: model:ir.model.fields,field_description:account.field_account_journal__rating_ids
13549-
#: model:ir.model.fields,field_description:account.field_account_move__rating_ids
13550-
#: model:ir.model.fields,field_description:account.field_account_payment__rating_ids
13551-
#: model:ir.model.fields,field_description:account.field_account_reconcile_model__rating_ids
13552-
#: model:ir.model.fields,field_description:account.field_account_setup_bank_manual_config__rating_ids
13553-
#: model:ir.model.fields,field_description:account.field_account_tax__rating_ids
13554-
#: model:ir.model.fields,field_description:account.field_res_company__rating_ids
13555-
#: model:ir.model.fields,field_description:account.field_res_partner_bank__rating_ids
13556-
msgid "Ratings"
13557-
msgstr ""
13558-
1355913535
#. module: account
1356013536
#: model:account.account,name:account.2_account_account_us_raw_materials
1356113537
msgid "Raw Materials"
@@ -13566,6 +13542,11 @@ msgstr ""
1356613542
msgid "Re-Sequence"
1356713543
msgstr ""
1356813544

13545+
#. module: account
13546+
#: model:res.groups,name:account.group_account_readonly
13547+
msgid "Read-only"
13548+
msgstr ""
13549+
1356913550
#. module: account
1357013551
#: model:ir.model.fields,field_description:account.field_account_lock_exception__reason
1357113552
msgid "Reason"
@@ -13675,6 +13656,12 @@ msgstr ""
1367513656
msgid "Reconciled Lines Excluding Exchange Diff"
1367613657
msgstr ""
1367713658

13659+
#. module: account
13660+
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__reconciled_payment_ids
13661+
#: model:ir.model.fields,field_description:account.field_account_move__reconciled_payment_ids
13662+
msgid "Reconciled Payments"
13663+
msgstr ""
13664+
1367813665
#. module: account
1367913666
#: model:ir.model.fields,field_description:account.field_account_payment__reconciled_statement_line_ids
1368013667
msgid "Reconciled Statement Lines"
@@ -14999,11 +14986,6 @@ msgstr ""
1499914986
msgid "Show Aba Routing"
1500014987
msgstr ""
1500114988

15002-
#. module: account
15003-
#: model:res.groups,name:account.group_account_readonly
15004-
msgid "Show Accounting Features - Readonly"
15005-
msgstr ""
15006-
1500714989
#. module: account
1500814990
#: model:ir.model.fields,field_description:account.field_res_partner__show_credit_limit
1500914991
#: model:ir.model.fields,field_description:account.field_res_users__show_credit_limit
@@ -15032,11 +15014,6 @@ msgstr ""
1503215014
msgid "Show E-Invoice Status Buttons"
1503315015
msgstr ""
1503415016

15035-
#. module: account
15036-
#: model:res.groups,name:account.group_account_user
15037-
msgid "Show Full Accounting Features"
15038-
msgstr ""
15039-
1504015017
#. module: account
1504115018
#: model:res.groups,name:account.group_account_secured
1504215019
msgid "Show Inalterability Features"
@@ -18537,12 +18514,6 @@ msgid ""
1853718514
"vendor ?"
1853818515
msgstr ""
1853918516

18540-
#. module: account
18541-
#. odoo-javascript
18542-
#: code:addons/account/static/src/components/json_checkboxes/json_checkboxes.xml:0
18543-
msgid "Warning"
18544-
msgstr ""
18545-
1854618517
#. module: account
1854718518
#. odoo-python
1854818519
#: code:addons/account/models/account_move.py:0
@@ -18759,6 +18730,14 @@ msgid ""
1875918730
"3/ select them all and post or delete them through the action menu"
1876018731
msgstr ""
1876118732

18733+
#. module: account
18734+
#. odoo-python
18735+
#: code:addons/account/models/account_bank_statement_line.py:0
18736+
msgid ""
18737+
"You can not delete a transaction from a valid statement.\n"
18738+
"If you want to delete it, please remove the statement first."
18739+
msgstr ""
18740+
1876218741
#. module: account
1876318742
#. odoo-python
1876418743
#: code:addons/account/models/account_move_line.py:0
@@ -19462,6 +19441,19 @@ msgstr ""
1946219441
msgid "[Partner id]"
1946319442
msgstr ""
1946419443

19444+
#. module: account
19445+
#: model:res.groups,comment:account.group_account_user
19446+
msgid ""
19447+
"access to all Accounting features, including reporting, asset management, "
19448+
"analytic accounting, without configuration rights."
19449+
msgstr ""
19450+
19451+
#. module: account
19452+
#: model:res.groups,comment:account.group_account_readonly
19453+
msgid ""
19454+
"access to all the accounting data but in readonly mode, no actions allowed."
19455+
msgstr ""
19456+
1946519457
#. module: account
1946619458
#. odoo-python
1946719459
#: code:addons/account/models/account_move.py:0
@@ -19478,6 +19470,11 @@ msgstr ""
1947819470
msgid "activate the currency of the invoice"
1947919471
msgstr ""
1948019472

19473+
#. module: account
19474+
#: model:res.groups,comment:account.group_account_basic
19475+
msgid "adds the accounting dashboard, bank management and follow-up reports."
19476+
msgstr ""
19477+
1948119478
#. module: account
1948219479
#: model_terms:ir.ui.view,arch_db:account.view_account_journal_form
1948319480
msgid "alias"

addons/account/models/account_bank_statement.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class AccountBankStatement(models.Model):
9494
search='_search_is_valid',
9595
)
9696

97+
journal_has_invalid_statements = fields.Boolean(
98+
related='journal_id.has_invalid_statements',
99+
)
100+
97101
problem_description = fields.Text(
98102
compute='_compute_problem_description',
99103
)

addons/account/models/account_bank_statement_line.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ def action_undo_reconciliation(self):
475475
# HELPERS
476476
# -------------------------------------------------------------------------
477477

478+
@api.ondelete(at_uninstall=False)
479+
def _check_allow_unlink(self):
480+
if self.statement_id.filtered(lambda stmt: stmt.is_valid and stmt.is_complete):
481+
raise UserError(_("You can not delete a transaction from a valid statement.\n"
482+
"If you want to delete it, please remove the statement first."))
483+
478484
def _find_or_create_bank_account(self):
479485
self.ensure_one()
480486

0 commit comments

Comments
 (0)