diff --git a/account_cash_deposit/README.rst b/account_cash_deposit/README.rst new file mode 100644 index 00000000..262ac821 --- /dev/null +++ b/account_cash_deposit/README.rst @@ -0,0 +1 @@ +Will be auto-generated from readme subdir diff --git a/account_cash_deposit/__init__.py b/account_cash_deposit/__init__.py new file mode 100644 index 00000000..aee8895e --- /dev/null +++ b/account_cash_deposit/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/account_cash_deposit/__manifest__.py b/account_cash_deposit/__manifest__.py new file mode 100644 index 00000000..160692c8 --- /dev/null +++ b/account_cash_deposit/__manifest__.py @@ -0,0 +1,30 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Cash Deposit", + "version": "14.0.1.0.0", + "category": "Accounting", + "license": "AGPL-3", + "summary": "Manage cash deposits and cash orders", + "author": "Akretion, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-financial-tools", + "depends": ["account"], + "data": [ + "security/ir.model.access.csv", + "security/security.xml", + "wizards/account_cash_order_reception_view.xml", + "data/sequence.xml", + "data/cash_unit_eur.xml", + "data/cash_unit_usd.xml", + "data/cash_unit_chf.xml", + "data/cash_unit_cad.xml", + "views/account_cash_deposit.xml", + "views/cash_unit.xml", + "views/res_currency.xml", + "report/report.xml", + "report/report_cashdeposit.xml", + ], + "installable": True, +} diff --git a/account_cash_deposit/data/cash_unit_cad.xml b/account_cash_deposit/data/cash_unit_cad.xml new file mode 100644 index 00000000..7c08897a --- /dev/null +++ b/account_cash_deposit/data/cash_unit_cad.xml @@ -0,0 +1,96 @@ + + + + + + + note + 100 + + + + note + 50 + deposit + + + + note + 20 + deposit + + + + note + 10 + deposit + + + + note + 5 + deposit + + + + coin + 2 + + + + coin + 1 + + + + coin + 0.25 + + + + coin + 0.1 + + + + coin + 0.05 + + + + + coinroll + 2 + 25 + + + + coinroll + 1 + 25 + + + + coinroll + 0.25 + 40 + + + + coinroll + 0.1 + 50 + + + + coinroll + 0.05 + 40 + + diff --git a/account_cash_deposit/data/cash_unit_chf.xml b/account_cash_deposit/data/cash_unit_chf.xml new file mode 100644 index 00000000..f9aab062 --- /dev/null +++ b/account_cash_deposit/data/cash_unit_chf.xml @@ -0,0 +1,122 @@ + + + + + + + note + 1000 + + + + note + 200 + + + + note + 100 + + + + note + 50 + deposit + + + + note + 20 + deposit + + + + note + 10 + deposit + + + + coin + 5 + + + + coin + 2 + + + + coin + 1 + + + + coin + 0.5 + + + + coin + 0.2 + + + + coin + 0.1 + + + + coin + 0.05 + + + + + coinroll + 5 + 50 + + + + coinroll + 2 + 50 + + + + coinroll + 1 + 50 + + + + coinroll + 0.5 + 50 + + + + coinroll + 0.2 + 50 + + + + coinroll + 0.1 + 50 + + + + coinroll + 0.05 + 50 + + + diff --git a/account_cash_deposit/data/cash_unit_eur.xml b/account_cash_deposit/data/cash_unit_eur.xml new file mode 100644 index 00000000..a02195db --- /dev/null +++ b/account_cash_deposit/data/cash_unit_eur.xml @@ -0,0 +1,139 @@ + + + + + + + note + 500 + + + + note + 200 + + + + note + 100 + + + + note + 50 + deposit + + + + note + 20 + deposit + + + + note + 10 + deposit + + + + note + 5 + deposit + + + + coin + 2 + + + + coin + 1 + + + + coin + 0.5 + + + + coin + 0.2 + + + + coin + 0.1 + + + + coin + 0.05 + + + + coin + 0.02 + + + + coin + 0.01 + + + + + coinroll + 2 + 25 + + + + coinroll + 1 + 25 + + + + coinroll + 0.5 + 40 + + + + coinroll + 0.2 + 40 + + + + coinroll + 0.1 + 40 + + + + coinroll + 0.05 + 50 + + + + coinroll + 0.02 + 50 + + + + coinroll + 0.01 + 50 + + + diff --git a/account_cash_deposit/data/cash_unit_usd.xml b/account_cash_deposit/data/cash_unit_usd.xml new file mode 100644 index 00000000..4c844c56 --- /dev/null +++ b/account_cash_deposit/data/cash_unit_usd.xml @@ -0,0 +1,122 @@ + + + + + + + note + 100 + + + + note + 50 + deposit + + + + note + 20 + deposit + + + + note + 10 + deposit + + + + note + 5 + deposit + + + + note + 2 + deposit + + + + note + 1 + deposit + + + + + + + coin + 1 + + + + coin + 0.5 + + + + coin + 0.25 + + + + coin + 0.1 + + + + coin + 0.05 + + + + coin + 0.01 + + + + + coinroll + 1 + 25 + + + + coinroll + 0.5 + 20 + + + + coinroll + 0.25 + 40 + + + + coinroll + 0.1 + 50 + + + + coinroll + 0.05 + 40 + + + + coinroll + 0.01 + 50 + + + diff --git a/account_cash_deposit/data/sequence.xml b/account_cash_deposit/data/sequence.xml new file mode 100644 index 00000000..054307fb --- /dev/null +++ b/account_cash_deposit/data/sequence.xml @@ -0,0 +1,22 @@ + + + + + Account Cash Deposit + account.cash.deposit + CASH-DEP- + 3 + + + + Account Cash Order + account.cash.order + CASH-ORDER- + 3 + + + diff --git a/account_cash_deposit/i18n/account_cash_deposit.pot b/account_cash_deposit/i18n/account_cash_deposit.pot new file mode 100644 index 00000000..144d1b9a --- /dev/null +++ b/account_cash_deposit/i18n/account_cash_deposit.pot @@ -0,0 +1,672 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_cash_deposit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-03-03 17:51+0000\n" +"PO-Revision-Date: 2022-03-03 17:51+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Currency:" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Date:" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Order Date:" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Total:" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_name_company_unique +msgid "" +"A cash deposit/order with this reference already exists in this company." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_line_cash_unit_unique +msgid "A line already exists for this cash unit." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__active +msgid "Active" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_ids +msgid "Activities" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_state +msgid "Activity State" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.cash_unit_form +msgid "Archived" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_attachment_count +msgid "Attachment Count" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__auto_create +msgid "Auto Create" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Back to Draft" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__bank_journal_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Bank Account" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank Account Number to Credit:" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank Account Number to Debit:" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank:" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__both +msgid "Both" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_order_reception_form +msgid "Cancel" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__cash_journal_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Cash Box" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__operation_type__deposit +msgid "Cash Deposit" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_account_cash_deposit_line +msgid "Cash Deposit Lines" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.actions.report,name:account_cash_deposit.report_account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_account_cash_deposit +msgid "Cash Deposit/Order" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_deposit_action +#: model:ir.ui.menu,name:account_cash_deposit.account_cash_deposit_menu +msgid "Cash Deposits" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__order_id +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__operation_type__order +msgid "Cash Order" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_order_reception_action +#: model:ir.model,name:account_cash_deposit.model_account_cash_order_reception +msgid "Cash Order Reception" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_order_action +#: model:ir.ui.menu,name:account_cash_deposit.account_cash_order_menu +msgid "Cash Orders" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Cash Received" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__date +msgid "Cash Reception Date" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.cash_unit_action +#: model:ir.model,name:account_cash_deposit.model_cash_unit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__cash_unit_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Cash Unit" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__cash_unit_ids +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.view_currency_form +msgid "Cash Units" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/wizards/account_cash_order_reception.py:0 +#, python-format +msgid "Cash reception confirmed on %s." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__coin +msgid "Coin" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__coinroll_qty +msgid "Coin Quantity" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__coinroll +msgid "Coin Roll" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__company_id +msgid "Company" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_order_reception_form +msgid "Confirm Cash Reception" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Confirm Order" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__confirmed +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Confirmed" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__create_uid +msgid "Created by" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__create_date +msgid "Created on" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_res_currency +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__currency_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Currency" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__date +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Date" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__deposit +msgid "Deposit" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__display_name +msgid "Display Name" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__done +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Done" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__draft +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Draft" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_channel_ids +msgid "Followers (Channels)" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/cash_unit.py:0 +#, python-format +msgid "For a coin roll, the coin quantity must be strictly positive." +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Group By" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__id +msgid "ID" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_needaction +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_has_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__auto_create +msgid "" +"If set, a line for this cash unit will be created by default on a new cash " +"deposit or a new cash order or both." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__move_id +msgid "Journal Entry" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__line_ids +msgid "Lines" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_ids +msgid "Messages" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "Missing Outstanding Payments Account on bank journal '%s'." +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "Missing Outstanding Receipts Account on bank journal '%s'." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__note +msgid "Note" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__notes +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Notes" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "" +"On {deposit}, the cash journal {cash_journal} is not in the selected " +"currency {currency}." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__operation_type +msgid "Operation Type" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__order +msgid "Order" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__order_date +msgid "Order Date" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__parent_id +msgid "Parent" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Print" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__qty +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Quantity" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__is_reconcile +msgid "Reconcile" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__name +msgid "Reference" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__state +msgid "Status" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__subtotal +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Subtotal" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "The %s is not in draft state, so you cannot delete it." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_cash_unit_coinroll_qty_positive +msgid "The coin quantity must be positive." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_line_qty_positive +msgid "The quantity must be positive or null." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_cash_unit_value_positive +msgid "The value must be strictly positive." +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "There are no non-zero lines on %s!" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__cash_type +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__coinroll_qty +msgid "This field should never be modified." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__value +msgid "" +"This field should never be modified. For a coin roll, you must enter the " +"value of the coin." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__total_amount +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__total_amount +msgid "Total Amount" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__total_value +msgid "Total Value" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__tree_order +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__tree_order +msgid "Tree Order" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__cash_type +msgid "Type" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__date +msgid "Used as date for the journal entry." +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Validate" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__value +msgid "Value" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__website_message_ids +msgid "Website communication history" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "" +"You must delete cash lines that are linked to a currency other than %s." +msgstr "" diff --git a/account_cash_deposit/i18n/fr.po b/account_cash_deposit/i18n/fr.po new file mode 100644 index 00000000..db138319 --- /dev/null +++ b/account_cash_deposit/i18n/fr.po @@ -0,0 +1,675 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_cash_deposit +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-03-03 11:19+0000\n" +"PO-Revision-Date: 2022-03-03 11:19+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Currency:" +msgstr "Devise :" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Date:" +msgstr "Date :" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Order Date:" +msgstr "Date de commande :" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Total:" +msgstr "Total :" + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_name_company_unique +msgid "" +"A cash deposit/order with this reference already exists in this company." +msgstr "Une commande/remise d'espèces existe déjà avec cette référence dans la même société." + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_line_cash_unit_unique +msgid "A line already exists for this cash unit." +msgstr "Une ligne existe déjà avec cette unité d'espèces." + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__active +msgid "Active" +msgstr "Actif" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_ids +msgid "Activities" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_state +msgid "Activity State" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.cash_unit_form +msgid "Archived" +msgstr "Archivé" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_attachment_count +msgid "Attachment Count" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__auto_create +msgid "Auto Create" +msgstr "Création automatique" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Back to Draft" +msgstr "Retour en brouillon" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__bank_journal_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Bank Account" +msgstr "Compte bancaire" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank Account Number to Credit:" +msgstr "Numéro de compte bancaire à créditer :" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank Account Number to Debit:" +msgstr "Numéro de compte bancaire à débiter :" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Bank:" +msgstr "Banque :" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__both +msgid "Both" +msgstr "Les deux" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_order_reception_form +msgid "Cancel" +msgstr "Annuler" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__cash_journal_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Cash Box" +msgstr "Caisse" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__operation_type__deposit +msgid "Cash Deposit" +msgstr "Remise d'espèces" + +#. module: account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_account_cash_deposit_line +msgid "Cash Deposit Lines" +msgstr "Lignes de remise d'espèces" + +#. module: account_cash_deposit +#: model:ir.actions.report,name:account_cash_deposit.report_account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_account_cash_deposit +msgid "Cash Deposit/Order" +msgstr "Commande/remise d'espèces" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_deposit_action +#: model:ir.ui.menu,name:account_cash_deposit.account_cash_deposit_menu +msgid "Cash Deposits" +msgstr "Remises d'espèces" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__order_id +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__operation_type__order +msgid "Cash Order" +msgstr "Commande d'espèces" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_order_reception_action +#: model:ir.model,name:account_cash_deposit.model_account_cash_order_reception +msgid "Cash Order Reception" +msgstr "Réception de la commande d'espèces" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.account_cash_order_action +#: model:ir.ui.menu,name:account_cash_deposit.account_cash_order_menu +msgid "Cash Orders" +msgstr "Commandes d'espèces" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Cash Received" +msgstr "Èspèces reçues" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__date +msgid "Cash Reception Date" +msgstr "Date de réception des espèces" + +#. module: account_cash_deposit +#: model:ir.actions.act_window,name:account_cash_deposit.cash_unit_action +#: model:ir.model,name:account_cash_deposit.model_cash_unit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__cash_unit_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Cash Unit" +msgstr "Unité d'espèces" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__cash_unit_ids +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.view_currency_form +msgid "Cash Units" +msgstr "Unités d'espèces" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/wizards/account_cash_order_reception.py:0 +#, python-format +msgid "Cash reception confirmed on %s." +msgstr "Réception d'espèces confirmée le %s." + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__coin +msgid "Coin" +msgstr "Pièce" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__coinroll_qty +msgid "Coin Quantity" +msgstr "Quantité de pièces" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__coinroll +msgid "Coin Roll" +msgstr "Rouleau de pièces" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__company_id +msgid "Company" +msgstr "Société" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_order_reception_form +msgid "Confirm Cash Reception" +msgstr "Confirmer la réception d'espèces" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Confirm Order" +msgstr "Confirmer la commande" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__confirmed +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Confirmed" +msgstr "Confirmé" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__create_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__create_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: account_cash_deposit +#: model:ir.model,name:account_cash_deposit.model_res_currency +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__currency_id +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__currency_id +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Currency" +msgstr "Devise" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__date +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Date" +msgstr "Date" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__deposit +msgid "Deposit" +msgstr "Remise" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__display_name +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__done +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Done" +msgstr "Fait" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__account_cash_deposit__state__draft +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Draft" +msgstr "Brouillon" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_channel_ids +msgid "Followers (Channels)" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/cash_unit.py:0 +#, python-format +msgid "For a coin roll, the coin quantity must be strictly positive." +msgstr "Pour un rouleau d'espèces, la quantité de pièces doit être strictement positive." + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_search +msgid "Group By" +msgstr "Groupé par" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__id +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency__id +msgid "ID" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_needaction +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_has_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__auto_create +msgid "" +"If set, a line for this cash unit will be created by default on a new cash " +"deposit or a new cash order or both." +msgstr "Si coché, une ligne sera créé par défault pour cette unité d'espèce " +"sur les nouvelles remises d'espèce ou les nouvelles commandes d'espèces ou les deux." + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__move_id +msgid "Journal Entry" +msgstr "Pièce comptable" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit____last_update +#: model:ir.model.fields,field_description:account_cash_deposit.field_res_currency____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__write_uid +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__write_date +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__line_ids +msgid "Lines" +msgstr "Lignes" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_ids +msgid "Messages" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "Missing Outstanding Payments Account on bank journal '%s'." +msgstr "Compte de paiements sortants non configuré sur le journal de banque '%s'." + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "Missing Outstanding Receipts Account on bank journal '%s'." +msgstr "Compte de paiements entrants non configuré sur le journal de banque '%s'." + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__cash_type__note +msgid "Note" +msgstr "Billet" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__notes +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Notes" +msgstr "Notes" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "" +"On {deposit}, the cash journal {cash_journal} is not in the selected " +"currency {currency}." +msgstr "Sur {deposit}, la caisse {cash_journal} n'est pas dans la devise " +"sélectionnée {currency}." + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__operation_type +msgid "Operation Type" +msgstr "Type d'opération" + +#. module: account_cash_deposit +#: model:ir.model.fields.selection,name:account_cash_deposit.selection__cash_unit__auto_create__order +msgid "Order" +msgstr "Commande" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__order_date +msgid "Order Date" +msgstr "Date de commande" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__parent_id +msgid "Parent" +msgstr "Parent" + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Print" +msgstr "Imprimer" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__qty +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Quantity" +msgstr "Quantité" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__is_reconcile +msgid "Reconciled" +msgstr "Lettré" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__name +msgid "Reference" +msgstr "Référence" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__state +msgid "Status" +msgstr "État" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__subtotal +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.report_cashdeposit +msgid "Subtotal" +msgstr "Sous-total" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "The %s is not in draft state, so you cannot delete it." +msgstr "La %s n'est pas à l'état brouillon, donc vous ne pouvez pas la supprimer." + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_cash_unit_coinroll_qty_positive +msgid "The coin quantity must be positive." +msgstr "La quantité de pièces doit être positive." + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_account_cash_deposit_line_qty_positive +msgid "The quantity must be positive or null." +msgstr "La quantité doit être positive ou nulle." + +#. module: account_cash_deposit +#: model:ir.model.constraint,message:account_cash_deposit.constraint_cash_unit_value_positive +msgid "The value must be strictly positive." +msgstr "La valeur doit être strictement positive." + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "There are no non-zero lines on %s!" +msgstr "Il n'y a aucune ligne non nulle sur %s !" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__cash_type +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__coinroll_qty +msgid "This field should never be modified." +msgstr "Ce champ ne doit jamais être modifié." + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_cash_unit__value +msgid "" +"This field should never be modified. For a coin roll, you must enter the " +"value of the coin." +msgstr "Ce champ ne doit jamais être modifié. Pour un rouleau de pièces, " +"vous devez entrer la valeur de la pièce." + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__total_amount +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_order_reception__total_amount +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__total_value +msgid "Total Value" +msgstr "Valeur totale" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit_line__tree_order +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__tree_order +msgid "Tree Order" +msgstr "Ordre dans la liste" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__cash_type +msgid "Type" +msgstr "Type" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__date +msgid "Used as date for the journal entry." +msgstr "Utilisé commande date pour la pièce comptable." + +#. module: account_cash_deposit +#: model_terms:ir.ui.view,arch_db:account_cash_deposit.account_cash_deposit_form +msgid "Validate" +msgstr "Valider" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_cash_unit__value +msgid "Value" +msgstr "Valeur" + +#. module: account_cash_deposit +#: model:ir.model.fields,field_description:account_cash_deposit.field_account_cash_deposit__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: account_cash_deposit +#: model:ir.model.fields,help:account_cash_deposit.field_account_cash_deposit__website_message_ids +msgid "Website communication history" +msgstr "" + +#. module: account_cash_deposit +#: code:addons/account_cash_deposit/models/account_cash_deposit.py:0 +#, python-format +msgid "" +"You must delete cash lines that are linked to a currency other than %s." +msgstr "Vous devez supprimer les lignes liées à une devise autre que %s." diff --git a/account_cash_deposit/models/__init__.py b/account_cash_deposit/models/__init__.py new file mode 100644 index 00000000..9a7db64d --- /dev/null +++ b/account_cash_deposit/models/__init__.py @@ -0,0 +1,3 @@ +from . import cash_unit +from . import res_currency +from . import account_cash_deposit diff --git a/account_cash_deposit/models/account_cash_deposit.py b/account_cash_deposit/models/account_cash_deposit.py new file mode 100644 index 00000000..5d7750c0 --- /dev/null +++ b/account_cash_deposit/models/account_cash_deposit.py @@ -0,0 +1,418 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError + + +class AccountCashDeposit(models.Model): + _name = "account.cash.deposit" + _description = "Cash Deposit/Order" + _inherit = ["mail.thread", "mail.activity.mixin"] + _order = "date desc, id desc" + _check_company_auto = True + + name = fields.Char( + string="Reference", size=64, readonly=True, default="/", copy=False + ) + operation_type = fields.Selection( + [ + ("deposit", "Cash Deposit"), + ("order", "Cash Order"), + ], + required=True, + string="Operation Type", + readonly=True, + ) + line_ids = fields.One2many( + "account.cash.deposit.line", + "parent_id", + string="Lines", + readonly=True, + states={"draft": [("readonly", "=", False)]}, + ) + order_date = fields.Date( + default=fields.Date.context_today, + readonly=True, + states={"draft": [("readonly", "=", False)]}, + ) + date = fields.Date( + string="Date", + readonly=True, + tracking=True, + copy=False, + help="Used as date for the journal entry.", + ) + cash_journal_id = fields.Many2one( + "account.journal", + string="Cash Box", + domain="[('company_id', '=', company_id), ('type', '=', 'cash')]", + required=True, + check_company=True, + readonly=True, + states={"draft": [("readonly", "=", False)]}, + tracking=True, + ) + currency_id = fields.Many2one( + "res.currency", + string="Currency", + required=True, + tracking=True, + readonly=True, + states={"draft": [("readonly", "=", False)]}, + ) + state = fields.Selection( + [ + ("draft", "Draft"), + ("confirmed", "Confirmed"), # step only for orders, not for deposits + ("done", "Done"), + ], + string="Status", + default="draft", + readonly=True, + tracking=True, + ) + move_id = fields.Many2one( + "account.move", + string="Journal Entry", + readonly=True, + check_company=True, + ) + bank_journal_id = fields.Many2one( + "account.journal", + string="Bank Account", + required=True, + domain="[('company_id', '=', company_id), ('type', '=', 'bank'), " + "('bank_account_id', '!=', False)]", + check_company=True, + readonly=True, + states={"draft": [("readonly", "=", False)]}, + tracking=True, + ) + company_id = fields.Many2one( + "res.company", + string="Company", + required=True, + readonly=True, + states={"draft": [("readonly", "=", False)]}, + tracking=True, + ) + total_amount = fields.Monetary( + compute="_compute_total_amount", + string="Total Amount", + store=True, + currency_field="currency_id", + tracking=True, + ) + is_reconcile = fields.Boolean( + compute="_compute_is_reconcile", store=True, string="Reconciled" + ) + notes = fields.Text() + + _sql_constraints = [ + ( + "name_company_unique", + "unique(company_id, name)", + "A cash deposit/order with this reference already exists in this company.", + ) + ] + + @api.constrains("cash_journal_id", "currency_id") + def _check_deposit(self): + for rec in self: + if rec.currency_id and rec.cash_journal_id: + if ( + rec.cash_journal_id.currency_id + and rec.currency_id != rec.cash_journal_id.currency_id + ) or ( + not rec.cash_journal_id.currency_id + and rec.currency_id != rec.company_id.currency_id + ): + raise ValidationError( + _( + "On {deposit}, the cash journal {cash_journal} is not " + "in the selected currency {currency}." + ).format( + deposit=rec.display_name, + cash_journal=rec.cash_journal_id.display_name, + currency=rec.currency_id.name, + ) + ) + + @api.model + def default_get(self, fields_list): + res = super().default_get(fields_list) + ajo = self.env["account.journal"] + company = self.env.company + currency = company.currency_id + # pre-set cash_journal_id and bank_journal_id if there is only one + domain = [("company_id", "=", company.id)] + cash_journals = ajo.search( + domain + + [ + ("type", "=", "cash"), + "|", + ("currency_id", "=", False), + ("currency_id", "=", currency.id), + ] + ) + if len(cash_journals) == 1: + res["cash_journal_id"] = cash_journals.id + bank_journals = ajo.search( + domain + [("type", "=", "bank"), ("bank_account_id", "!=", False)] + ) + if len(bank_journals) == 1: + res["bank_journal_id"] = bank_journals.id + res.update( + { + "company_id": company.id, + "currency_id": currency.id, + } + ) + if res.get("operation_type"): + cash_units = self.env["cash.unit"].search( + [ + ("auto_create", "in", ("both", res["operation_type"])), + ("currency_id", "=", currency.id), + ] + ) + res["line_ids"] = [(0, 0, {"cash_unit_id": cu.id}) for cu in cash_units] + return res + + @api.depends("line_ids.subtotal") + def _compute_total_amount(self): + rg_res = self.env["account.cash.deposit.line"].read_group( + [("parent_id", "in", self.ids)], + ["parent_id", "subtotal"], + ["parent_id"], + ) + mapped_data = {x["parent_id"][0]: x["subtotal"] for x in rg_res} + for rec in self: + rec.total_amount = mapped_data.get(rec.id, 0) + + @api.depends("move_id.line_ids.reconciled", "company_id") + def _compute_is_reconcile(self): + for rec in self: + reconcile = False + if rec.move_id: + for line in rec.move_id.line_ids: + if ( + line.account_id.id != rec.cash_journal_id.default_account_id.id + and line.reconciled + ): + reconcile = True + rec.is_reconcile = reconcile + + def unlink(self): + for rec in self: + if rec.state != "draft": + raise UserError( + _("The %s is not in draft state, so you cannot delete it.") + % rec.display_name + ) + return super().unlink() + + def backtodraft(self): + for rec in self: + if rec.move_id: + move = rec.move_id + # It will raise here if journal_id.update_posted = False + if move.state == "posted": + move.button_draft() + move.unlink() + rec.write({"state": "draft"}) + + @api.model + def create(self, vals): + if "company_id" in vals: + self = self.with_company(vals["company_id"]) + if vals.get("name", "/") == "/": + if ( + vals.get("operation_type") == "order" + or self._context.get("default_operation_type") == "order" + ): + vals["name"] = self.env["ir.sequence"].next_by_code( + "account.cash.order", vals.get("order_date") + ) + else: + vals["name"] = self.env["ir.sequence"].next_by_code( + "account.cash.deposit" + ) + return super().create(vals) + + def name_get(self): + res = [] + type2label = dict( + self.fields_get("operation_type", "selection")["operation_type"][ + "selection" + ] + ) + for rec in self: + res.append((rec.id, " ".join([type2label[self.operation_type], self.name]))) + return res + + def confirm_order(self): + self.ensure_one() + assert self.operation_type == "order", "Wrong operation type" + self._del_empty_lines() + self.write({"state": "confirmed"}) + + def _del_empty_lines(self, raise_if_empty=True): + self.ensure_one() + self.line_ids.filtered(lambda x: x.qty == 0).unlink() + if raise_if_empty and not self.line_ids: + raise UserError(_("There are no non-zero lines on %s!") % self.display_name) + + def _prepare_account_move(self, vals): + self.ensure_one() + date = vals["date"] + op_type = self.operation_type + total_amount_comp_cur = self.currency_id._convert( + self.total_amount, self.company_id.currency_id, self.company_id, date + ) + if not self.company_id.transfer_account_id: + raise UserError(_("The Inter-Banks Transfer Account is not configured.")) + bank_account_id = self.company_id.transfer_account_id.id + + cash_debit = cash_credit = bank_debit = bank_credit = 0.0 + if op_type == "deposit": + cash_credit = total_amount_comp_cur + bank_debit = total_amount_comp_cur + else: + cash_debit = total_amount_comp_cur + bank_credit = total_amount_comp_cur + # Cash move line + cash_vals = { + "account_id": self.cash_journal_id.default_account_id.id, + "partner_id": False, + "debit": cash_debit, + "credit": cash_credit, + "currency_id": self.currency_id.id, + "amount_currency": self.total_amount * (op_type == "deposit" and -1 or 1), + } + # Bank move line + bank_vals = { + "account_id": bank_account_id, + "partner_id": False, + "debit": bank_debit, + "credit": bank_credit, + "currency_id": self.currency_id.id, + "amount_currency": self.total_amount * (op_type == "deposit" and 1 or -1), + } + move_vals = { + "journal_id": self.cash_journal_id.id, + "date": date, + "ref": self.display_name, + "company_id": self.company_id.id, + "line_ids": [(0, 0, cash_vals), (0, 0, bank_vals)], + } + return move_vals + + def _prepare_validate(self, force_date=None): + vals = {"state": "done"} + if force_date: + vals["date"] = force_date + else: + vals["date"] = fields.Date.context_today(self) + return vals + + def validate(self, force_date=None): + self.ensure_one() + self._del_empty_lines() + vals = self._prepare_validate(force_date=force_date) + move_vals = self._prepare_account_move(vals) + move = self.env["account.move"].create(move_vals) + move.action_post() + vals["move_id"] = move.id + self.write(vals) + + @api.onchange("currency_id") + def currency_change(self): + if self.currency_id and self.operation_type: + line_obj = self.env["account.cash.deposit.line"] + new_lines = self.env["account.cash.deposit.line"] + cash_units = self.env["cash.unit"].search( + [ + ("auto_create", "in", ("both", self.operation_type)), + ("currency_id", "=", self.currency_id.id), + ] + ) + for cunit in cash_units: + new_lines += line_obj.new({"cash_unit_id": cunit.id}) + self.line_ids = new_lines + domain = [("company_id", "=", self.company_id.id), ("type", "=", "cash")] + if self.currency_id == self.company_id.currency_id: + cash_journals = self.env["account.journal"].search( + domain + + [ + "|", + ("currency_id", "=", False), + ("currency_id", "=", self.currency_id.id), + ] + ) + if len(cash_journals) == 1: + self.cash_journal_id = cash_journals.id + else: + self.cash_journal_id = False + else: + cash_journals = self.env["account.journal"].search( + domain + [("currency_id", "=", self.currency_id.id)] + ) + if len(cash_journals) == 1: + self.cash_journal_id = cash_journals.id + else: + self.cash_journal_id = False + + def get_report(self): + report = self.env.ref("account_cash_deposit.report_account_cash_deposit") + action = report.with_context({"discard_logo_check": True}).report_action(self) + return action + + +class AccountCashDepositLine(models.Model): + _name = "account.cash.deposit.line" + _description = "Cash Deposit Lines" + _order = "tree_order desc" + + parent_id = fields.Many2one("account.cash.deposit", ondelete="cascade") + qty = fields.Integer(string="Quantity") + cash_unit_id = fields.Many2one( + "cash.unit", required=True, domain="[('currency_id', '=', currency_id)]" + ) + tree_order = fields.Float(related="cash_unit_id.tree_order", store=True) + subtotal = fields.Monetary(compute="_compute_subtotal", store=True) + currency_id = fields.Many2one(related="parent_id.currency_id", store=True) + + _sql_constraints = [ + ("qty_positive", "CHECK(qty >= 0)", "The quantity must be positive or null."), + ( + "cash_unit_unique", + "unique(cash_unit_id, parent_id)", + "A line already exists for this cash unit.", + ), + ] + + @api.constrains("currency_id", "cash_unit_id") + def _check_lines(self): + for line in self: + if ( + line.currency_id + and line.cash_unit_id + and line.currency_id != line.cash_unit_id.currency_id + ): + raise ValidationError( + _( + "You must delete cash lines that are linked to a currency " + "other than %s." + ) + % line.currency_id.name + ) + + @api.depends("cash_unit_id", "qty") + def _compute_subtotal(self): + for line in self: + subtotal = 0 + if line.cash_unit_id: + subtotal = line.cash_unit_id.total_value * line.qty + line.subtotal = subtotal diff --git a/account_cash_deposit/models/cash_unit.py b/account_cash_deposit/models/cash_unit.py new file mode 100644 index 00000000..f2a44316 --- /dev/null +++ b/account_cash_deposit/models/cash_unit.py @@ -0,0 +1,148 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError +from odoo.tools.misc import format_amount + + +class CashUnit(models.Model): + _name = "cash.unit" + _description = "Cash Unit" + _order = "currency_id, tree_order desc" + _rec_name = "value" + + currency_id = fields.Many2one("res.currency", ondelete="cascade") + active = fields.Boolean(default=True) + tree_order = fields.Float(compute="_compute_all", store=True) + cash_type = fields.Selection( + [ + ("note", "Note"), + ("coin", "Coin"), + ("coinroll", "Coin Roll"), + ], + string="Type", + required=True, + help="This field should never be modified.", + ) + coinroll_qty = fields.Integer( + string="Coin Quantity", help="This field should never be modified." + ) + value = fields.Monetary( + required=True, + help="This field should never be modified. For a coin roll, " + "you must enter the value of the coin.", + ) + total_value = fields.Monetary(compute="_compute_all", store=True) + auto_create = fields.Selection( + [ + ("deposit", "Deposit"), + ("order", "Order"), + ("both", "Both"), + ], + help="If set, a line for this cash unit will be created by default " + "on a new cash deposit or a new cash order or both.", + ) + + _sql_constraints = [ + ( + "coinroll_qty_positive", + "CHECK(coinroll_qty >= 0)", + "The coin quantity must be positive.", + ), + ("value_positive", "CHECK(value > 0)", "The value must be strictly positive."), + ] + + @api.constrains("cash_type", "coinroll_qty") + def _check_cash_unit(self): + for rec in self: + if rec.cash_type == "coinroll" and rec.coinroll_qty <= 0: + raise ValidationError( + _("For a coin roll, the coin quantity must be strictly positive.") + ) + + @api.depends("coinroll_qty", "cash_type", "value") + def _compute_all(self): + # I want bank notes first, then coinrolls, then coins + # This is a hack, but it is designed to work fine with + # all currencies of the planet ! + type2multiplier = { + "note": 1000000, + "coinroll": 1000, + "coin": 1, + } + for rec in self: + qty = rec.cash_type == "coinroll" and rec.coinroll_qty or 1 + total_value = rec.value * qty + rec.tree_order = type2multiplier.get(rec.cash_type, 0) * total_value + rec.total_value = total_value + + def _get_value_label(self, value): + self.ensure_one() + symbol_position = self.currency_id.position + symbol = self.currency_id.symbol + int_value = int(round(value)) + # if value is an integer + if self.currency_id.compare_amounts(value, int_value) == 0: + amount_label = str(int_value) + if symbol_position == "before": + value_label = "%s %s" % (symbol, amount_label) + else: + value_label = "%s %s" % (amount_label, symbol) + else: + value_label = format_amount(self.env, value, self.currency_id) + return value_label + + def name_get(self): + res = [] + type2label = dict( + self.fields_get("cash_type", "selection")["cash_type"]["selection"] + ) + for rec in self: + cash_type_label = type2label.get(rec.cash_type) + value_label = rec._get_value_label(rec.value) + if rec.cash_type == "coinroll": + total_value_label = rec._get_value_label(rec.total_value) + label = "%s %s x %d (%s)" % ( + cash_type_label, + value_label, + rec.coinroll_qty, + total_value_label, + ) + else: + label = "%s %s" % (cash_type_label, value_label) + res.append((rec.id, label)) + return res + + @api.model + def name_search(self, name="", args=None, operator="ilike", limit=100): + if args is None: + args = [] + if name and operator == "ilike": + if name.isdigit(): + recs = self.search([("value", "=", name)] + args, limit=limit) + if recs: + return recs.name_get() + value = False + try: + value = float(name) + except Exception: + pass + if value: + recs = self.search([("value", "=", value)] + args, limit=limit) + if recs: + return recs.name_get() + lang = self.env["res.lang"]._lang_get(self.env.user.lang) + if lang: + decimal_sep = lang.decimal_point + if decimal_sep and decimal_sep != ".": + try: + value = float(name.replace(decimal_sep, ".", 1)) + except Exception: + pass + if value: + recs = self.search([("value", "=", value)] + args, limit=limit) + if recs: + return recs.name_get() + return super().name_search(name=name, args=args, operator=operator, limit=limit) diff --git a/account_cash_deposit/models/res_currency.py b/account_cash_deposit/models/res_currency.py new file mode 100644 index 00000000..6dcc3430 --- /dev/null +++ b/account_cash_deposit/models/res_currency.py @@ -0,0 +1,11 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResCurrency(models.Model): + _inherit = "res.currency" + + cash_unit_ids = fields.One2many("cash.unit", "currency_id", string="Cash Units") diff --git a/account_cash_deposit/readme/CONFIGURE.rst b/account_cash_deposit/readme/CONFIGURE.rst new file mode 100644 index 00000000..06668fcf --- /dev/null +++ b/account_cash_deposit/readme/CONFIGURE.rst @@ -0,0 +1,11 @@ +First, for each currency of your cash boxes, you must define the bank notes and coin rolls for that currency (coin rolls are often standardised by the Central Bank). You can also definie the coins, but it's not useful if your bank only accept coin rolls and not coins. + +.. figure:: static/description/currency_form_view.png + :scale: 100 % + :alt: Currency form view + +To save time for new users, this module provides the bank notes, coins and coin rolls for several currencies (EUR, USD, CAD, etc.). If it is not the case for your currency, it would be very nice of you to contribute it (you can use the file *account_cash_deposit/data/cash_unit_eur.xml* as an example). + +To save time when encoding the cash deposits/orders, you can set the parameter *Auto Create* on the bank notes and/or coin rolls that you use very often. + +On the Accounting configuration page, in the section *Bank & Cash*, the *Inter-Banks Transfer Account* must be configured. diff --git a/account_cash_deposit/readme/CONTRIBUTORS.rst b/account_cash_deposit/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..ff65d68c --- /dev/null +++ b/account_cash_deposit/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexis de Lattre diff --git a/account_cash_deposit/readme/DESCRIPTION.rst b/account_cash_deposit/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ef8b2afa --- /dev/null +++ b/account_cash_deposit/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds support for **cash deposits at the bank**. It also supports the other way around: **ordering cash at the bank**. It allows to declare the kind of cash you want to deposit (or order): bank notes, coins and coin rolls and the quantity for each of them. Coins are rarely used, because most banks only allow to deposit/order coin rolls. diff --git a/account_cash_deposit/readme/USAGE.rst b/account_cash_deposit/readme/USAGE.rst new file mode 100644 index 00000000..28366d82 --- /dev/null +++ b/account_cash_deposit/readme/USAGE.rst @@ -0,0 +1,13 @@ +To create a new cash **deposit**, go to the menu *Invoicing > Accounting > Miscellaneous > Cash Deposits* and click on *Create*: select the currency, the cash box from which you will take the cash out and the bank journal corresponding to the bank account on which you want to deposit the cash. Then create/edit lines to enter the quantity for each kind of bank note and coin rolls. Then, you can print a PDF report designed to be a kind of delivery report for the cash. Upon validation, Odoo will generate a journal entry in the cash journal that: + +* credits the cash account, +* debits the inter-banks transfer account. + +.. figure:: static/description/cash_deposit_form.png + :scale: 100 % + :alt: Cash Deposit form view + +The process is very similar when **ordering** cash but you have to use another menu entry: menu *Invoicing > Accounting > Miscellaneous > Cash Orders*. Select the currency, the cash box that will receive the cash and the bank account from which the bank will take the money. Create/edit lines to enter the details of your order (bank notes, coin rolls). Then, you can confirm the order and print a PDF report designed to be sent to your bank as a cash order. Eventually, when the bank delivers the cash to you, you should validate the cash order and Odoo will generate a journal entry in the cash journal that: + +* debits the cash account, +* credits the inter-banks transfer account. diff --git a/account_cash_deposit/report/report.xml b/account_cash_deposit/report/report.xml new file mode 100644 index 00000000..b83c5ae8 --- /dev/null +++ b/account_cash_deposit/report/report.xml @@ -0,0 +1,20 @@ + + + + + Cash Deposit/Order + account.cash.deposit + qweb-pdf + account_cash_deposit.report_cashdeposit + account_cash_deposit.report_cashdeposit + '%s%s' % (object.display_name.replace(' ', '_'), object.state == 'draft' and '-draft' or '') + + report + + diff --git a/account_cash_deposit/report/report_cashdeposit.xml b/account_cash_deposit/report/report_cashdeposit.xml new file mode 100644 index 00000000..ed355c7d --- /dev/null +++ b/account_cash_deposit/report/report_cashdeposit.xml @@ -0,0 +1,104 @@ + + + + + diff --git a/account_cash_deposit/security/ir.model.access.csv b/account_cash_deposit/security/ir.model.access.csv new file mode 100644 index 00000000..1ae75b94 --- /dev/null +++ b/account_cash_deposit/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_cash_deposit_user,Full rights on account.cash.deposit to Accountant,model_account_cash_deposit,account.group_account_user,1,1,1,1 +access_account_cash_deposit_line_user,Full rights on account.cash.deposit.line to Accountant,model_account_cash_deposit_line,account.group_account_user,1,1,1,1 +access_account_cash_order_reception,Full rights on account.cash.order.reception wizard,model_account_cash_order_reception,account.group_account_user,1,1,1,1 +cash_unit_read,Read rights on cash.unit to everybody,model_cash_unit,,1,0,0,0 +cash_unit_full,Full rights on cash.unit to System group,model_cash_unit,base.group_system,1,1,1,1 diff --git a/account_cash_deposit/security/security.xml b/account_cash_deposit/security/security.xml new file mode 100644 index 00000000..f42479cf --- /dev/null +++ b/account_cash_deposit/security/security.xml @@ -0,0 +1,13 @@ + + + + + Cash Deposit multi-company + + [('company_id', 'in', company_ids)] + + diff --git a/account_cash_deposit/static/description/cash_deposit_form.png b/account_cash_deposit/static/description/cash_deposit_form.png new file mode 100644 index 00000000..e2409333 Binary files /dev/null and b/account_cash_deposit/static/description/cash_deposit_form.png differ diff --git a/account_cash_deposit/static/description/currency_form_view.png b/account_cash_deposit/static/description/currency_form_view.png new file mode 100644 index 00000000..82282708 Binary files /dev/null and b/account_cash_deposit/static/description/currency_form_view.png differ diff --git a/account_cash_deposit/tests/__init__.py b/account_cash_deposit/tests/__init__.py new file mode 100644 index 00000000..03896123 --- /dev/null +++ b/account_cash_deposit/tests/__init__.py @@ -0,0 +1 @@ +from . import test_cash_deposit diff --git a/account_cash_deposit/tests/test_cash_deposit.py b/account_cash_deposit/tests/test_cash_deposit.py new file mode 100644 index 00000000..c911fea8 --- /dev/null +++ b/account_cash_deposit/tests/test_cash_deposit.py @@ -0,0 +1,129 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from datetime import date, timedelta + +from odoo.tests.common import TransactionCase + + +class TestAccountCashDeposit(TransactionCase): + def setUp(self): + super().setUp() + self.company = self.env.ref("base.main_company") + self.currency = self.company.currency_id + self.cash_journal = self.env["account.journal"].search( + [("type", "=", "cash"), ("company_id", "=", self.company.id)], limit=1 + ) + self.bank_journal = self.env["account.journal"].search( + [("type", "=", "bank"), ("company_id", "=", self.company.id)], limit=1 + ) + self.cash_unit_note = self.env["cash.unit"].search( + [("currency_id", "=", self.currency.id), ("cash_type", "=", "note")], + limit=1, + ) + self.cash_unit_coinroll = self.env["cash.unit"].search( + [("currency_id", "=", self.currency.id), ("cash_type", "=", "coinroll")], + limit=1, + ) + self.all_cash_units = self.env["cash.unit"].search( + [("currency_id", "=", self.currency.id)] + ) + self.date = date.today() + self.yesterday = date.today() - timedelta(days=1) + self.deposit_seq = self.env["ir.sequence"].search( + [("code", "=", "account.cash.deposit")] + ) + self.order_seq = self.env["ir.sequence"].search( + [("code", "=", "account.cash.order")] + ) + + def test_cash_order(self): + self.all_cash_units.write({"auto_create": "both"}) + order = ( + self.env["account.cash.deposit"] + .with_context(default_operation_type="order") + .create( + { + "company_id": self.company.id, + "currency_id": self.currency.id, + "cash_journal_id": self.cash_journal.id, + "bank_journal_id": self.bank_journal.id, + } + ) + ) + self.assertEqual(len(order.line_ids), len(self.all_cash_units)) + self.assertEqual(order.state, "draft") + self.assertTrue(order.name.startswith(self.order_seq.prefix)) + self.assertEqual(order.operation_type, "order") + line_note = self.env["account.cash.deposit.line"].search( + [ + ("cash_unit_id", "=", self.cash_unit_note.id), + ("parent_id", "=", order.id), + ] + ) + line_note.write({"qty": 5}) + line_note = self.env["account.cash.deposit.line"].search( + [ + ("cash_unit_id", "=", self.cash_unit_coinroll.id), + ("parent_id", "=", order.id), + ] + ) + line_note.write({"qty": 2}) + total = ( + 5 * self.cash_unit_note.total_value + + 2 * self.cash_unit_coinroll.total_value + ) + self.assertFalse(order.currency_id.compare_amounts(order.total_amount, total)) + order.confirm_order() + self.assertEqual(order.state, "confirmed") + self.assertEqual(len(order.line_ids), 2) + wizard = ( + self.env["account.cash.order.reception"] + .with_context(default_order_id=order.id) + .create({"date": self.yesterday}) + ) + wizard.run() + self.assertEqual(order.state, "done") + self.assertEqual(order.date, self.yesterday) + self.assertTrue(order.move_id) + self.assertEqual(len(order.move_id.line_ids), 2) + self.assertEqual(order.move_id.date, order.date) + self.assertEqual(order.move_id.journal_id, order.cash_journal_id) + self.assertEqual(order.move_id.ref, order.display_name) + + def test_cash_deposit(self): + deposit = ( + self.env["account.cash.deposit"] + .with_context(default_operation_type="deposit") + .create( + { + "company_id": self.company.id, + "currency_id": self.currency.id, + "cash_journal_id": self.cash_journal.id, + "bank_journal_id": self.bank_journal.id, + "line_ids": [ + (0, 0, {"cash_unit_id": self.cash_unit_note.id, "qty": 3}), + (0, 0, {"cash_unit_id": self.cash_unit_coinroll.id, "qty": 6}), + ], + } + ) + ) + self.assertEqual(len(deposit.line_ids), 2) + self.assertEqual(deposit.state, "draft") + self.assertTrue(deposit.name.startswith(self.deposit_seq.prefix)) + self.assertEqual(deposit.operation_type, "deposit") + total = ( + 3 * self.cash_unit_note.total_value + + 6 * self.cash_unit_coinroll.total_value + ) + self.assertFalse( + deposit.currency_id.compare_amounts(deposit.total_amount, total) + ) + deposit.validate() + self.assertEqual(deposit.state, "done") + self.assertTrue(deposit.move_id) + self.assertEqual(len(deposit.move_id.line_ids), 2) + self.assertEqual(deposit.move_id.date, deposit.date) + self.assertEqual(deposit.move_id.journal_id, deposit.cash_journal_id) + self.assertEqual(deposit.move_id.ref, deposit.display_name) diff --git a/account_cash_deposit/views/account_cash_deposit.xml b/account_cash_deposit/views/account_cash_deposit.xml new file mode 100644 index 00000000..10efbf3a --- /dev/null +++ b/account_cash_deposit/views/account_cash_deposit.xml @@ -0,0 +1,218 @@ + + + + + account.cash.deposit + +
+
+ +
+ +
+ +

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + account.cash.deposit + + + + + + + + + + + + + + + + + + account.cash.deposit + + + + + + + + + + + + + + + + + + + + + Cash Deposits + account.cash.deposit + tree,form + [('operation_type', '=', 'deposit')] + {'default_operation_type': 'deposit'} + + + + + Cash Orders + account.cash.deposit + tree,form + [('operation_type', '=', 'order')] + {'default_operation_type': 'order'} + + + + + + +
diff --git a/account_cash_deposit/views/cash_unit.xml b/account_cash_deposit/views/cash_unit.xml new file mode 100644 index 00000000..f5d9e216 --- /dev/null +++ b/account_cash_deposit/views/cash_unit.xml @@ -0,0 +1,72 @@ + + + + + + cash.unit + +
+ + + + + + + + + + + +
+
+ + + cash.unit + + + + + + + + + + + + + + + Cash Unit + cash.unit + tree,form + {'cash_unit_main_view': True} + + +
diff --git a/account_cash_deposit/views/res_currency.xml b/account_cash_deposit/views/res_currency.xml new file mode 100644 index 00000000..1481a43e --- /dev/null +++ b/account_cash_deposit/views/res_currency.xml @@ -0,0 +1,21 @@ + + + + + + res.currency + + + + + + + + + + + diff --git a/account_cash_deposit/wizards/__init__.py b/account_cash_deposit/wizards/__init__.py new file mode 100644 index 00000000..01e460e7 --- /dev/null +++ b/account_cash_deposit/wizards/__init__.py @@ -0,0 +1 @@ +from . import account_cash_order_reception diff --git a/account_cash_deposit/wizards/account_cash_order_reception.py b/account_cash_deposit/wizards/account_cash_order_reception.py new file mode 100644 index 00000000..ad9ed4d8 --- /dev/null +++ b/account_cash_deposit/wizards/account_cash_order_reception.py @@ -0,0 +1,27 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, fields, models +from odoo.tools.misc import format_date + + +class AccountCashOrderReception(models.TransientModel): + _name = "account.cash.order.reception" + _description = "Cash Order Reception" + + order_id = fields.Many2one( + "account.cash.deposit", readonly=True, string="Cash Order" + ) + date = fields.Date( + string="Cash Reception Date", default=fields.Date.context_today, required=True + ) + total_amount = fields.Monetary(related="order_id.total_amount") + currency_id = fields.Many2one(related="order_id.currency_id") + + def run(self): + self.ensure_one() + self.order_id.message_post( + body=_("Cash reception confirmed on %s.") % format_date(self.env, self.date) + ) + self.order_id.validate(force_date=self.date) diff --git a/account_cash_deposit/wizards/account_cash_order_reception_view.xml b/account_cash_deposit/wizards/account_cash_order_reception_view.xml new file mode 100644 index 00000000..f5ae8f2a --- /dev/null +++ b/account_cash_deposit/wizards/account_cash_order_reception_view.xml @@ -0,0 +1,42 @@ + + + + + + account.cash.order.reception + +
+ + + + + + +
+
+
+
+
+ + + Cash Order Reception + account.cash.order.reception + form + new + + +