diff --git a/account_check_deposit/README.rst b/account_check_deposit/README.rst index e77b07505..fb59e752d 100644 --- a/account_check_deposit/README.rst +++ b/account_check_deposit/README.rst @@ -14,13 +14,13 @@ Account Check Deposit :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github - :target: https://github.com/OCA/account-financial-tools/tree/14.0/account_check_deposit + :target: https://github.com/OCA/account-financial-tools/tree/15.0/account_check_deposit :alt: OCA/account-financial-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-financial-tools-14-0/account-financial-tools-14-0-account_check_deposit + :target: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_check_deposit :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/92/14.0 + :target: https://runbot.odoo-community.org/runbot/92/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -45,9 +45,9 @@ journal: * Name: Checks Received * Type: Bank * Short Code: CHK (or any code you want) -* Outstanding Receipts Account: select an account for checks received +* in the tab *Incoming Payments*, add a line with *Payment Method* = *Manual* and *Outstanding receipts account* set to the account for the checks in hand. -Note that, on this *Checks Received* journal, the bank account and suspense account will not be used, so don't worry about these parameters. +Note that, on this *Checks Received* journal, the bank account and suspense account will not be used, so don't worry about these parameters. The field *Account number* must be empty. This bank journal will be available as a payment method in Odoo. The account you configured as *Outstanding Receipts Account* is the @@ -78,7 +78,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -122,6 +122,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/account-financial-tools `_ project on GitHub. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_check_deposit/i18n/de.po b/account_check_deposit/i18n/de.po index ba0d802f2..1af77b941 100644 --- a/account_check_deposit/i18n/de.po +++ b/account_check_deposit/i18n/de.po @@ -512,62 +512,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Check Deposit - Ref. Check %s" -#~ msgstr "Scheck-Konto - Scheckref. %s" - -#~ msgid "Check Deposit Offsetting Account" -#~ msgstr "Gegenkonto zu Scheckeinzahlung" - -#, fuzzy -#~ msgid "Check Deposits" -#~ msgstr "Scheck-Konten" - -#~ msgid "Companies" -#~ msgstr "Unternehmen" - -#, fuzzy -#~ msgid "Config Settings" -#~ msgstr "account.config.settings" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Währung (Falsch wenn gleich wie Unternehmenswährung)" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Standard Aufwandskonto des Journals" - -#~ msgid "It acts as a default account for debit amount" -#~ msgstr "Es dient als Standardkonto bei Sollbeträgen" - -#, fuzzy -#~ msgid "Missing 'Check Deposit Offsetting Account' on the company '%s'." -#~ msgstr "'Konto zu Scheckeinzahlungen' fehlt im Unternehmen '%s'." - -#~ msgid "Missing 'Default Debit Account' on bank journal '%s'" -#~ msgstr "'Vorgabe-Soll-Konto' fehlt im Bank-Journal '%s'" - -#, fuzzy -#~ msgid "Post Move for Check Deposits" -#~ msgstr "Transferkonto bei Scheckeinreichern" - -#~ msgid "Total Credit" -#~ msgstr "Gesamt-Soll" - -#~ msgid "Total Debit" -#~ msgstr "Gesamt-Haben" - -#~ msgid "Transfer Account" -#~ msgstr "Transfer-Konto" - -#~ msgid "Transfer Account for Check Deposits" -#~ msgstr "Transferkonto bei Scheckeinreichern" - -#~ msgid "" -#~ "You must configure the 'Check Deposit Offsetting Account' on the " -#~ "Accounting Settings page" -#~ msgstr "" -#~ "Sie müssen das 'Scheckeinzahlungs-Gegenkonto' in den Konteneinstellungen " -#~ "pflegen" - -#~ msgid "Checks Deposit Search" -#~ msgstr "Scheckdepotsuche" diff --git a/account_check_deposit/i18n/el_GR.po b/account_check_deposit/i18n/el_GR.po index 225c33cd5..2be89174b 100644 --- a/account_check_deposit/i18n/el_GR.po +++ b/account_check_deposit/i18n/el_GR.po @@ -507,6 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Εταιρείες" diff --git a/account_check_deposit/i18n/en_GB.po b/account_check_deposit/i18n/en_GB.po index 8f08f0893..dd02736bc 100644 --- a/account_check_deposit/i18n/en_GB.po +++ b/account_check_deposit/i18n/en_GB.po @@ -507,12 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Currency (False if same as company)" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Default Debit Account of the Journal" - -#~ msgid "It acts as a default account for debit amount" -#~ msgstr "It acts as a default account for debit amount" diff --git a/account_check_deposit/i18n/es.po b/account_check_deposit/i18n/es.po index e7853d484..8c201b332 100644 --- a/account_check_deposit/i18n/es.po +++ b/account_check_deposit/i18n/es.po @@ -507,6 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Compañías" diff --git a/account_check_deposit/i18n/es_EC.po b/account_check_deposit/i18n/es_EC.po index e09c2fd33..4d2f5fd04 100644 --- a/account_check_deposit/i18n/es_EC.po +++ b/account_check_deposit/i18n/es_EC.po @@ -508,54 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Check Deposit - Ref. Check %s" -#~ msgstr "Depósito de Cheque - Ref. Cheque %s" - -#~ msgid "Check Deposit Offsetting Account" -#~ msgstr "Cuenta Cheque deposito" - -#, fuzzy -#~ msgid "Check Deposits" -#~ msgstr "Depósitos" - -#~ msgid "Companies" -#~ msgstr "Compañías" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Moneda" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Cta. por defecto para Débito del Diario" - -#~ msgid "It acts as a default account for debit amount" -#~ msgstr "Actua como cuenta por defecto para el débito" - -#, fuzzy -#~ msgid "Missing 'Check Deposit Offsetting Account' on the company '%s'." -#~ msgstr "Sin configurar 'Cta. para Depósito de cheques' en la compañía '%s'." - -#, fuzzy -#~ msgid "Post Move for Check Deposits" -#~ msgstr "Cta. de Transferencia para Depósitos" - -#~ msgid "Total Credit" -#~ msgstr "Total Crédito" - -#~ msgid "Total Debit" -#~ msgstr "Total Débito" - -#~ msgid "Transfer Account" -#~ msgstr "Cuenta de Transferencia" - -#~ msgid "Transfer Account for Check Deposits" -#~ msgstr "Cta. de Transferencia para Depósitos" - -#~ msgid "" -#~ "You must configure the 'Check Deposit Offsetting Account' on the " -#~ "Accounting Settings page" -#~ msgstr "" -#~ "Debe configurar la 'Cta. de Depósitos' en la configuración Financiera" - -#~ msgid "Checks Deposit Search" -#~ msgstr "Buscar Depósitos" diff --git a/account_check_deposit/i18n/fi.po b/account_check_deposit/i18n/fi.po index dec35cf52..bbe5a007f 100644 --- a/account_check_deposit/i18n/fi.po +++ b/account_check_deposit/i18n/fi.po @@ -506,6 +506,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Yritykset" diff --git a/account_check_deposit/i18n/fr.po b/account_check_deposit/i18n/fr.po index 6c97409ba..ededccd2c 100644 --- a/account_check_deposit/i18n/fr.po +++ b/account_check_deposit/i18n/fr.po @@ -522,30 +522,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Check Deposit - Ref. Check %s" -#~ msgstr "Remise - Ref. Cheque %s" - -#~ msgid "Check Deposits" -#~ msgstr "Remises de chèques" - -#~ msgid "Companies" -#~ msgstr "Sociétés" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Devise (False s'il s'agit de la même que la société)" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Compte de débit par défaut du journal" - -#~ msgid "Post Move for Check Deposits" -#~ msgstr "Comptabiliser les écritures des remises de chèques" - -#~ msgid "Transfer Account" -#~ msgstr "Compte de transfert" - -#~ msgid "Transfer Account for Check Deposits" -#~ msgstr "Compte de transfert pour les remises de chèques" - -#~ msgid "Checks Deposit Search" -#~ msgstr "Rechercher une Remise de Chèques" diff --git a/account_check_deposit/i18n/hr.po b/account_check_deposit/i18n/hr.po index 85dc83c71..4b75c9961 100644 --- a/account_check_deposit/i18n/hr.po +++ b/account_check_deposit/i18n/hr.po @@ -508,10 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Poduzeća" - -#, fuzzy -#~ msgid "Config Settings" -#~ msgstr "account.config.settings" diff --git a/account_check_deposit/i18n/hr_HR.po b/account_check_deposit/i18n/hr_HR.po index 8f136a322..a09310476 100644 --- a/account_check_deposit/i18n/hr_HR.po +++ b/account_check_deposit/i18n/hr_HR.po @@ -508,10 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Poduzeća" - -#, fuzzy -#~ msgid "Config Settings" -#~ msgstr "account.config.settings" diff --git a/account_check_deposit/i18n/it.po b/account_check_deposit/i18n/it.po index 975b7a317..4b5e596b2 100644 --- a/account_check_deposit/i18n/it.po +++ b/account_check_deposit/i18n/it.po @@ -509,6 +509,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Azienda" diff --git a/account_check_deposit/i18n/lt.po b/account_check_deposit/i18n/lt.po index f91b2385e..2d5fed215 100644 --- a/account_check_deposit/i18n/lt.po +++ b/account_check_deposit/i18n/lt.po @@ -508,6 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Įmonės" diff --git a/account_check_deposit/i18n/nl.po b/account_check_deposit/i18n/nl.po index 93e350883..968e36daf 100644 --- a/account_check_deposit/i18n/nl.po +++ b/account_check_deposit/i18n/nl.po @@ -507,6 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Bedrijven" diff --git a/account_check_deposit/i18n/nl_NL.po b/account_check_deposit/i18n/nl_NL.po index 631628a18..a0e3c4228 100644 --- a/account_check_deposit/i18n/nl_NL.po +++ b/account_check_deposit/i18n/nl_NL.po @@ -507,6 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Bedrijven" diff --git a/account_check_deposit/i18n/pt.po b/account_check_deposit/i18n/pt.po index d64ca17d8..2a0c76088 100644 --- a/account_check_deposit/i18n/pt.po +++ b/account_check_deposit/i18n/pt.po @@ -525,57 +525,3 @@ msgstr "Mensagens do Website" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "Histórico de Comunicação do Website" - -#~ msgid "Check Deposit - Ref. Check %s" -#~ msgstr "Depósito de Cheque - Ref. do Cheque %s" - -#~ msgid "Check Deposit Offsetting Account" -#~ msgstr "Conta de Compensação do Depósito de Cheque" - -#~ msgid "Check Deposits" -#~ msgstr "Depósitos de Cheques" - -#~ msgid "Companies" -#~ msgstr "Empresas" - -#~ msgid "Config Settings" -#~ msgstr "Configurações" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Moeda (Falso se for a mesma da empresa)" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Conta de Débito pré-definida do Diário" - -#~ msgid "It acts as a default account for debit amount" -#~ msgstr "Atua como a conta predefinida para o valor a débito" - -#~ msgid "Missing 'Check Deposit Offsetting Account' on the company '%s'." -#~ msgstr "" -#~ "A 'Conta de Offsetting de Depósitos de Cheques' está em falta na empresa " -#~ "'%s'." - -#~ msgid "Missing 'Default Debit Account' on bank journal '%s'" -#~ msgstr "Em falta 'Conta Pré-definida para Débito' no diário '%s'" - -#~ msgid "Post Move for Check Deposits" -#~ msgstr "Movimento publicado o Depósito de Cheques" - -#~ msgid "Total Credit" -#~ msgstr "Crédito Total" - -#~ msgid "Total Debit" -#~ msgstr "Débito Total" - -#~ msgid "Transfer Account" -#~ msgstr "Conta de Transferência" - -#~ msgid "Transfer Account for Check Deposits" -#~ msgstr "Conta de Transferência para Depósito de Cheques" - -#~ msgid "" -#~ "You must configure the 'Check Deposit Offsetting Account' on the " -#~ "Accounting Settings page" -#~ msgstr "" -#~ "Deve configurar a 'Conta de Compensação do Depósito de Cheques' na página " -#~ "de Configuração da Contabilidade" diff --git a/account_check_deposit/i18n/pt_BR.po b/account_check_deposit/i18n/pt_BR.po index bff01677c..3e66b20ca 100644 --- a/account_check_deposit/i18n/pt_BR.po +++ b/account_check_deposit/i18n/pt_BR.po @@ -508,6 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Empresas" diff --git a/account_check_deposit/i18n/sk.po b/account_check_deposit/i18n/sk.po index 445eb40d3..2ec2bc3fe 100644 --- a/account_check_deposit/i18n/sk.po +++ b/account_check_deposit/i18n/sk.po @@ -506,6 +506,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Spoločnosti" diff --git a/account_check_deposit/i18n/sl.po b/account_check_deposit/i18n/sl.po index 8486d0ca7..c44d50293 100644 --- a/account_check_deposit/i18n/sl.po +++ b/account_check_deposit/i18n/sl.po @@ -510,29 +510,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Check Deposit - Ref. Check %s" -#~ msgstr "Čekovni depozit - sklic čeka %s" - -#, fuzzy -#~ msgid "Check Deposits" -#~ msgstr "Čekovni depoziti" - -#~ msgid "Companies" -#~ msgstr "Družbe" - -#~ msgid "Currency (False if same as company)" -#~ msgstr "Valuta (neveljavno če je ista kot valuta družbe)" - -#~ msgid "Default Debit Account of the Journal" -#~ msgstr "Privzeti konto obveznosti za dnevnik" - -#~ msgid "It acts as a default account for debit amount" -#~ msgstr "Deluje kot privzeti konto za znesek obveznosti" - -#, fuzzy -#~ msgid "Post Move for Check Deposits" -#~ msgstr "Čekovni depoziti" - -#~ msgid "Checks Deposit Search" -#~ msgstr "Iskalnik čekovnih depozitov" diff --git a/account_check_deposit/i18n/tr.po b/account_check_deposit/i18n/tr.po index fc3666676..73f97877c 100644 --- a/account_check_deposit/i18n/tr.po +++ b/account_check_deposit/i18n/tr.po @@ -507,6 +507,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Firmalar" diff --git a/account_check_deposit/i18n/tr_TR.po b/account_check_deposit/i18n/tr_TR.po index f877da525..48366799c 100644 --- a/account_check_deposit/i18n/tr_TR.po +++ b/account_check_deposit/i18n/tr_TR.po @@ -508,6 +508,3 @@ msgstr "" #: model:ir.model.fields,help:account_check_deposit.field_account_check_deposit__website_message_ids msgid "Website communication history" msgstr "" - -#~ msgid "Companies" -#~ msgstr "Firmalar" diff --git a/account_check_deposit/models/account_check_deposit.py b/account_check_deposit/models/account_check_deposit.py index bdc7ef7fa..34419d379 100644 --- a/account_check_deposit/models/account_check_deposit.py +++ b/account_check_deposit/models/account_check_deposit.py @@ -99,9 +99,6 @@ class AccountCheckDeposit(models.Model): string="Number of Checks", tracking=True, ) - is_reconcile = fields.Boolean( - compute="_compute_check_deposit", store=True, string="Reconcile" - ) _sql_constraints = [ ( @@ -134,36 +131,23 @@ class AccountCheckDeposit(models.Model): } for deposit in self: - reconcile = False - company_cur = deposit.company_id.currency_id - if company_cur != deposit.currency_id: + if deposit.company_id.currency_id != deposit.currency_id: total = mapped_data.get(deposit.id, {"amount_currency": 0.0})[ "amount_currency" ] else: total = mapped_data.get(deposit.id, {"debit": 0.0})["debit"] count = mapped_data.get(deposit.id, {"count": 0})["count"] - if deposit.move_id: - for line in deposit.move_id.line_ids: - if not company_cur.is_zero(line.debit) and line.reconciled: - reconcile = True deposit.total_amount = total - deposit.is_reconcile = reconcile deposit.check_count = count @api.depends("journal_id") def _compute_in_hand_check_account_id(self): for rec in self: - in_hand_check_account_id = False - if rec.journal_id: - for line in rec.journal_id.inbound_payment_method_line_ids: - if ( - line.payment_method_id.code == "manual" - and line.payment_account_id - ): - in_hand_check_account_id = line.payment_account_id.id - break - rec.in_hand_check_account_id = in_hand_check_account_id + account = rec.journal_id.inbound_payment_method_line_ids.filtered( + lambda line: line.payment_method_id.code == "manual" + ).payment_account_id + rec.in_hand_check_account_id = account @api.model def default_get(self, fields_list): @@ -200,15 +184,14 @@ class AccountCheckDeposit(models.Model): ) def unlink(self): - for deposit in self: - if deposit.state == "done": - raise UserError( - _( - "The deposit '%s' is in valid state, so you must " - "cancel it before deleting it." - ) - % deposit.name + for deposit in self.filtered(lambda x: x.state == "done"): + raise UserError( + _( + "The deposit '%s' is in valid state, so you must " + "cancel it before deleting it." ) + % deposit.name + ) return super().unlink() def backtodraft(self): @@ -285,8 +268,7 @@ class AccountCheckDeposit(models.Model): am_obj = self.env["account.move"] move_line_obj = self.env["account.move.line"] for deposit in self: - move_vals = deposit._prepare_account_move_vals() - move = am_obj.create(move_vals) + move = am_obj.create(deposit._prepare_account_move_vals()) total_debit = 0.0 total_amount_currency = 0.0 to_reconcile_lines = [] @@ -316,25 +298,22 @@ class AccountCheckDeposit(models.Model): @api.onchange("company_id") def onchange_company_id(self): if self.company_id: - bank_journals = self.env["account.journal"].search( + self.bank_journal_id = self.env["account.journal"].search( [ ("company_id", "=", self.company_id.id), ("type", "=", "bank"), ("bank_account_id", "!=", False), - ] + ], + limit=1, ) - if len(bank_journals) == 1: - self.bank_journal_id = bank_journals[0] else: self.bank_journal_id = False @api.onchange("journal_id") def onchange_journal_id(self): - if self.journal_id: - if self.journal_id.currency_id: - self.currency_id = self.journal_id.currency_id - else: - self.currency_id = self.journal_id.company_id.currency_id + self.currency_id = ( + self.journal_id.currency_id or self.journal_id.company_id.currency_id + ) def get_report(self): report = self.env.ref("account_check_deposit.report_account_check_deposit") diff --git a/account_check_deposit/report/report.xml b/account_check_deposit/report/report.xml index a2e84594d..15e563402 100644 --- a/account_check_deposit/report/report.xml +++ b/account_check_deposit/report/report.xml @@ -5,16 +5,16 @@ The licence is in the file __manifest__.py --> - - Check Deposit - account.check.deposit - qweb-pdf - account_check_deposit.report_checkdeposit - account_check_deposit.report_checkdeposit - + Check Deposit + account.check.deposit + qweb-pdf + account_check_deposit.report_checkdeposit + account_check_deposit.report_checkdeposit + 'check_deposit-%s%s' % (object.name, object.state == 'draft' and '-draft' or '') - - report - + + report + diff --git a/account_check_deposit/report/report_checkdeposit.xml b/account_check_deposit/report/report_checkdeposit.xml index 46f7a451d..892381203 100644 --- a/account_check_deposit/report/report_checkdeposit.xml +++ b/account_check_deposit/report/report_checkdeposit.xml @@ -8,7 +8,7 @@