diff --git a/account_factoring_receivable_balance/README.rst b/account_factoring_receivable_balance/README.rst new file mode 100644 index 000000000..98fc658c8 --- /dev/null +++ b/account_factoring_receivable_balance/README.rst @@ -0,0 +1,153 @@ +==================================== +Account Factoring Receivable Balance +==================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f83b4e457e88c47bbaaf7466d0fe78b4b388825dbfcc675626c326ae91716e89 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-france/tree/17.0/account_factoring_receivable_balance + :alt: OCA/l10n-france +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-account_factoring_receivable_balance + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-france&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +see account_factoring_receivable_balance_bpce module + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To implement your own factor connector, see +account_factoring_receivable_balance_bpce module. + +At the minimum, you have to define this Subrogation code + +.. code:: python + + class SubrogationReceipt(models.Model): + _inherit = "subrogation.receipt" + + def _prepare_factor_file_myownfactor(self): + self.ensure_one + name = "myown_file.txt" + return { + "name": name, + "res_id": self.id, + "res_model": self._name, + "datas": self._prepare_factor_file_data_myownfactor(), + } + + def _prepare_factor_file_data_myownfactor(self): + ... + return base64.b64encode(data) + + def _get_partner_field(self): + res = super()._get_partner_field() + if self.factor_type == "myownfactor": + return "myownfactor_factoring_balance" + return res + +this journal code + +.. code:: python + + class AccountJournal(models.Model): + _inherit = "account.journal" + + factor_type = fields.Selection( + selection_add=[("myownfactor", "MyOwnFactor")], ondelete={"myownfactor": "set null"} + ) + +this partner code + +.. code:: python + + class ResPartner(models.Model): + _inherit = "res.partner" + + myownfactor_factoring_balance = fields.Boolean( + string="Use MyOwnFactor factoring balance", + groups="account.group_account_invoice", + company_dependent=True, + help="Use MyOwnFactor factoring receivable balance external service", + ) + +Usage +===== + +see account_factoring_receivable_balance_bpce module + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Akretion + +Contributors +------------ + +- Akretion: + + - David BEAL + - Alexis DE LATTRE + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainers `__: + +|maintainer-bealdav| |maintainer-alexis-via| + +This module is part of the `OCA/l10n-france `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_factoring_receivable_balance/__init__.py b/account_factoring_receivable_balance/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_factoring_receivable_balance/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_factoring_receivable_balance/__manifest__.py b/account_factoring_receivable_balance/__manifest__.py new file mode 100644 index 000000000..756999fdc --- /dev/null +++ b/account_factoring_receivable_balance/__manifest__.py @@ -0,0 +1,26 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion + +{ + "name": "Account Factoring Receivable Balance", + "version": "17.0.1.0.0", + "category": "Accounting", + "license": "AGPL-3", + "author": "Akretion,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-france", + "maintainers": [ + "bealdav", + "alexis-via", + ], + "depends": [ + "account", + ], + "data": [ + "security/ir.model.access.csv", + "security/misc.xml", + "views/account_journal.xml", + "views/account_move_line.xml", + "views/res_partner.xml", + "views/subrogation_receipt.xml", + ], +} diff --git a/account_factoring_receivable_balance/i18n/account_factoring_receivable_balance.pot b/account_factoring_receivable_balance/i18n/account_factoring_receivable_balance.pot new file mode 100644 index 000000000..faa23382d --- /dev/null +++ b/account_factoring_receivable_balance/i18n/account_factoring_receivable_balance.pot @@ -0,0 +1,513 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_factoring_receivable_balance +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \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_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_ids +msgid "Activities" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_state +msgid "Activity State" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__target_date +msgid "All account moves line dates are lower or equal to this date" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_attachment_count +msgid "Attachment Count" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__balance +msgid "Balance" +msgstr "" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "" +"Check fields 'Holdabck Amount', 'Untaxed Amount', 'Tax Amount', they should " +"have a value" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__comment +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Comment" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__company_id +msgid "Company" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Compute" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Confirm" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__confirmed +msgid "Confirmed" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__date +msgid "Confirmed Date" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.actions.act_window,name:account_factoring_receivable_balance.subrogation_receipt_action_redirection +msgid "Created Subrogation Receipts" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__create_uid +msgid "Created by" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__create_date +msgid "Created on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__currency_id +msgid "Currency" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_current_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_current_account_id +msgid "Current Account" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_subrogation_receipt +msgid "Customer balance data for factoring" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__statement_date +msgid "Date of the last bank statement taken account in accounting" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_res_company__factor_config_currency_id +msgid "Devise" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__display_name +msgid "Display Name" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__draft +msgid "Draft" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_expense_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_expense_account_id +msgid "Expense Account" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__expense_tax_amount +msgid "Expense Tax Amount" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__expense_untaxed_amount +msgid "Expense Untaxed Amount" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Expenses" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__factor_type +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.view_account_journal_search +msgid "Factor" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.constraint,message:account_factoring_receivable_balance.constraint_account_journal_currency_factor_curr_type_cpny_unique +msgid "" +"Field Factor type must be unique by Currency, Journal type, and Company" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__has_message +msgid "Has Message" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_holdback_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_holdback_account_id +msgid "Holdback Account" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__holdback_amount +msgid "Holdback Amount" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__id +msgid "ID" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "In currency" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__item_ids +msgid "Item" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_account_journal +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__factor_journal_id +msgid "Journal" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__line_ids +msgid "Line" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_ids +msgid "Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Original Currency" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__partner_ref +msgid "Partn." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_pending_recharging_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_pending_recharging_account_id +msgid "Pending Recharging Account" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Post" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__posted +msgid "Posted" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_receivable_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_receivable_account_id +msgid "Receivable Account" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.view_account_journal_form +msgid "Receiveable Balance" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__partner_bank_id +msgid "Recipient Bank" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_sms_error +msgid "SMS Delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "See account moves" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__state +msgid "State" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__statement_date +msgid "Statement Date" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__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_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__subrogation_id +msgid "Subrogation Receipt" +msgstr "" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "Subrogation Receipt %s" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.actions.act_window,name:account_factoring_receivable_balance.subrogation_receipt_action +#: model:ir.ui.menu,name:account_factoring_receivable_balance.subrogation_receipt_menu +msgid "Subrogation Receipts" +msgstr "" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "Subrogations in Posted state can't be deleted" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__target_date +msgid "Target Date" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Tax Amount" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__currency_id +msgid "The currency used to enter statement" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Total Credit" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Total Debit" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Untaxed Amount" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_res_company__factor_config_currency_id +msgid "Use to configure account and journal" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__website_message_ids +msgid "Website communication history" +msgstr "" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "You already have a Draft Subrogation with this journal and company." +msgstr "" diff --git a/account_factoring_receivable_balance/i18n/fr.po b/account_factoring_receivable_balance/i18n/fr.po new file mode 100644 index 000000000..de0eaa54c --- /dev/null +++ b/account_factoring_receivable_balance/i18n/fr.po @@ -0,0 +1,521 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_factoring_receivable_balance +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2022-07-26 15:28+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 3.0.1\n" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_ids +msgid "Activities" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_state +msgid "Activity State" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__target_date +msgid "All account moves line dates are lower or equal to this date" +msgstr "" +"Toutes les écritures comptables sont antérieures ou égales à cette date" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_attachment_count +msgid "Attachment Count" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__balance +msgid "Balance" +msgstr "Balance" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "" +"Check fields 'Holdabck Amount', 'Untaxed Amount', 'Tax Amount', they should " +"have a value" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__comment +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Comment" +msgstr "Commentaire" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__company_id +msgid "Company" +msgstr "Société" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Compute" +msgstr "Calculer" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Confirm" +msgstr "Confirmer" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__confirmed +msgid "Confirmed" +msgstr "Confirmé" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__date +msgid "Confirmed Date" +msgstr "Date de confirmation" + +#. module: account_factoring_receivable_balance +#: model:ir.actions.act_window,name:account_factoring_receivable_balance.subrogation_receipt_action_redirection +msgid "Created Subrogation Receipts" +msgstr "Quittances subrogatives" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__create_uid +msgid "Created by" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__create_date +msgid "Created on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__currency_id +msgid "Currency" +msgstr "Devise" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_current_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_current_account_id +msgid "Current Account" +msgstr "Compte courant" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_subrogation_receipt +msgid "Customer balance data for factoring" +msgstr "Données de la balance client pour le factor" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__statement_date +msgid "Date of the last bank statement taken account in accounting" +msgstr "Date du dernier relevé bancaire pris en compte en comptabilité" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_res_company__factor_config_currency_id +msgid "Devise" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__display_name +msgid "Display Name" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__draft +msgid "Draft" +msgstr "Brouillon" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_expense_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_expense_account_id +msgid "Expense Account" +msgstr "Compte de dépense" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__expense_tax_amount +msgid "Expense Tax Amount" +msgstr "Montant de taxe de dépense" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__expense_untaxed_amount +msgid "Expense Untaxed Amount" +msgstr "Montant non taxé de dépense" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Expenses" +msgstr "Dépenses" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__factor_type +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.view_account_journal_search +msgid "Factor" +msgstr "Type de factor" + +#. module: account_factoring_receivable_balance +#: model:ir.model.constraint,message:account_factoring_receivable_balance.constraint_account_journal_currency_factor_curr_type_cpny_unique +msgid "Field Factor type must be unique by Currency, Journal type, and Company" +msgstr "" +"Le champ factor doit être unique par Devise, Type de journal, et Société" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__has_message +msgid "Has Message" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_holdback_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_holdback_account_id +msgid "Holdback Account" +msgstr "Compte de retenue" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__holdback_amount +msgid "Holdback Amount" +msgstr "Montant retenue" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__id +msgid "ID" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "In currency" +msgstr "En devise" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__item_ids +msgid "Item" +msgstr "Ecritures" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_account_journal +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__factor_journal_id +msgid "Journal" +msgstr "Journal" + +#. module: account_factoring_receivable_balance +#: model:ir.model,name:account_factoring_receivable_balance.model_account_move_line +msgid "Journal Item" +msgstr "Écriture comptable" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__line_ids +msgid "Line" +msgstr "Ligne" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_ids +msgid "Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Original Currency" +msgstr "Devise d'origine" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__partner_ref +msgid "Partn." +msgstr "Client" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_pending_recharging_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_pending_recharging_account_id +msgid "Pending Recharging Account" +msgstr "Compte d'attente de rechargement" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Post" +msgstr "Comptabiliser" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance.selection__subrogation_receipt__state__posted +msgid "Posted" +msgstr "Comptabilisé" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_bank_statement_import_journal_creation__factoring_receivable_account_id +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_journal__factoring_receivable_account_id +msgid "Receivable Account" +msgstr "Compte à recevoir" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.view_account_journal_form +msgid "Receiveable Balance" +msgstr "Balance à recevoir" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__partner_bank_id +msgid "Recipient Bank" +msgstr "Banque" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_has_sms_error +msgid "SMS Delivery error" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "See account moves" +msgstr "Voir les écritures comptables" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__state +msgid "State" +msgstr "Etat" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__statement_date +msgid "Statement Date" +msgstr "Date relevé" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__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_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_account_move_line__subrogation_id +msgid "Subrogation Receipt" +msgstr "Quittance subrogative" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "Subrogation Receipt %s" +msgstr "Quittance subrogative %s" + +#. module: account_factoring_receivable_balance +#: model:ir.actions.act_window,name:account_factoring_receivable_balance.subrogation_receipt_action +#: model:ir.ui.menu,name:account_factoring_receivable_balance.subrogation_receipt_menu +msgid "Subrogation Receipts" +msgstr "Quittances subrogatives" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "Subrogations in Posted state can't be deleted" +msgstr "Les quittances comptabilisées ne peuvent etre effacées" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__target_date +#, fuzzy +#| msgid "Statement Date" +msgid "Target Date" +msgstr "Date cible" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Tax Amount" +msgstr "Montant de la taxe" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__currency_id +msgid "The currency used to enter statement" +msgstr "La devise utilisé pour le relevé" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Total Credit" +msgstr "Total Credit" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Total Debit" +msgstr "Total Debit" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance.subrogation_receipt_form +msgid "Untaxed Amount" +msgstr "Montant non taxé" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_res_company__factor_config_currency_id +msgid "Use to configure account and journal" +msgstr "Utiliser pour configurer les comptes et journaux" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance.field_subrogation_receipt__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: account_factoring_receivable_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance.field_subrogation_receipt__website_message_ids +msgid "Website communication history" +msgstr "" + +#. module: account_factoring_receivable_balance +#: code:addons/account_factoring_receivable_balance/models/subrogation_receipt.py:0 +#, python-format +msgid "You already have a Draft Subrogation with this journal and company." +msgstr "" +"Vous avez déjà une quittance en brouillon avec ce journal et cette société." diff --git a/account_factoring_receivable_balance/models/__init__.py b/account_factoring_receivable_balance/models/__init__.py new file mode 100644 index 000000000..be098f00b --- /dev/null +++ b/account_factoring_receivable_balance/models/__init__.py @@ -0,0 +1,4 @@ +from . import account_journal +from . import account_move +from . import res_partner +from . import subrogation_receipt diff --git a/account_factoring_receivable_balance/models/account_journal.py b/account_factoring_receivable_balance/models/account_journal.py new file mode 100644 index 000000000..628204bc8 --- /dev/null +++ b/account_factoring_receivable_balance/models/account_journal.py @@ -0,0 +1,47 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + factor_type = fields.Selection(string="Factor", selection=[("", "")]) + factor_code = fields.Char(help="Account Number for factor company") + factor_start_date = fields.Date( + tracking=True, + help="No account move will be selected before this date", + ) + factor_invoice_journal_ids = fields.Many2many( + string="Limit Factoring to Journals", + comodel_name="account.journal", + relation="account_journal_factor_invoice_rel", + column1="factor_journal_id", + column2="sale_journal_id", + help="Journals to limit Factoring to. Leave blank to allow all journals", + ) + factoring_receivable_account_id = fields.Many2one( + comodel_name="account.account", string="Receivable Account" + ) + factoring_current_account_id = fields.Many2one( + comodel_name="account.account", string="Current Account" + ) + factoring_holdback_account_id = fields.Many2one( + comodel_name="account.account", string="Holdback Account" + ) + factoring_pending_recharging_account_id = fields.Many2one( + comodel_name="account.account", string="Pending Recharging Account" + ) + factoring_expense_account_id = fields.Many2one( + comodel_name="account.account", string="Expense Account" + ) + + _sql_constraints = [ + ( + "currency_factor_curr_type_cpny_unique", + "UNIQUE(currency_id, factor_type, type, company_id)", + "Field Factor type must be unique by Currency, Journal type, and Company", + ) + ] diff --git a/account_factoring_receivable_balance/models/account_move.py b/account_factoring_receivable_balance/models/account_move.py new file mode 100644 index 000000000..6fe44cccd --- /dev/null +++ b/account_factoring_receivable_balance/models/account_move.py @@ -0,0 +1,29 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + subrogation_id = fields.Many2one( + comodel_name="subrogation.receipt", + string="Subrogation Receipt", + check_company=True, + ) + bank_id = fields.Many2one( + comodel_name="res.bank", + related="move_id.partner_bank_id.bank_id", + string="Recipient Bank", + help="Bank of the partner", + ) + partner_ref = fields.Char(string="Partn.", compute="_compute_partner_ref") + + def _compute_partner_ref(self): + for rec in self: + if rec.partner_id: + rec.partner_ref = rec.partner_id.commercial_partner_id.ref + else: + rec.partner_ref = "" diff --git a/account_factoring_receivable_balance/models/res_partner.py b/account_factoring_receivable_balance/models/res_partner.py new file mode 100644 index 000000000..d7ce982d5 --- /dev/null +++ b/account_factoring_receivable_balance/models/res_partner.py @@ -0,0 +1,14 @@ +# © 2024 Open Source Integrators, Daniel Reis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class Partner(models.Model): + _inherit = "res.partner" + + factor_journal_id = fields.Many2one( + comodel_name="account.journal", + domain="[('factor_type', '!=', False)]", + help="Select the factoring service for this partner.", + ) diff --git a/account_factoring_receivable_balance/models/subrogation_receipt.py b/account_factoring_receivable_balance/models/subrogation_receipt.py new file mode 100644 index 000000000..7d4998744 --- /dev/null +++ b/account_factoring_receivable_balance/models/subrogation_receipt.py @@ -0,0 +1,238 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + + +class SubrogationReceipt(models.Model): + _name = "subrogation.receipt" + _inherit = ["mail.thread", "mail.activity.mixin"] + _check_company_auto = True + _rec_name = "factor_type" + _order = "target_date DESC" + _description = "Customer balance data for factoring" + + factor_journal_id = fields.Many2one( + comodel_name="account.journal", + string="Journal", + domain="[('factor_type', '!=', False)," "('type', '=', 'bank')]", + check_company=True, + required=True, + ) + factor_type = fields.Selection(related="factor_journal_id.factor_type", store=True) + currency_id = fields.Many2one(related="factor_journal_id.currency_id", store=True) + display_name = fields.Char(compute="_compute_display_name") + date = fields.Date( + string="Confirmed Date", + readonly=True, + tracking=True, + ) + target_date = fields.Date( + help="All account moves line dates are lower or equal to this date", + required=True, + tracking=True, + ) + statement_date = fields.Date( + help="Date of the last bank statement taken account in accounting" + ) + state = fields.Selection( + [ + ("draft", "Draft"), + ("confirmed", "Confirmed"), + ("posted", "Posted"), + ], + default="draft", + required=True, + tracking=True, + ) + expense_untaxed_amount = fields.Monetary(tracking=True, help="") + expense_tax_amount = fields.Monetary(tracking=True, help="") + holdback_amount = fields.Monetary(tracking=True, help="") + balance = fields.Monetary(readonly=True) + company_id = fields.Many2one( + comodel_name="res.company", + string="Company", + default=lambda s: s._get_company_id(), + readonly=True, + required=True, + ) + comment = fields.Text() + line_ids = fields.One2many( + comodel_name="account.move.line", + inverse_name="subrogation_id", + ) + + @api.constrains("factor_journal_id", "state", "company_id") + def _check_draft_per_journal(self): + for rec in self: + count_drafts = self.search_count( + [ + ("factor_journal_id", "=", rec.factor_journal_id.id), + ("state", "=", "draft"), + ("company_id", "=", rec._get_company_id()), + ] + ) + if count_drafts > 1: + raise UserError( + _( + "You already have a Draft Subrogation with " + "this journal and company." + ) + ) + + @api.depends("factor_journal_id", "date") + def _compute_display_name(self): + for rec in self: + rec.display_name = "{} {} {}".format( + rec.factor_type, + rec.currency_id.name, + rec.date or rec._fields["state"].selection[0][1], + ) + + @api.model + def _get_domain_for_factor(self): + journal = self.factor_journal_id + factor_type = self.factor_type + factor_journal = self.factor_journal_id + currency = journal.currency_id + bank_journal = self._get_bank_journal(factor_type, currency=currency) + domain = [ + ("date", "<=", self.target_date), + ("company_id", "=", self._get_company_id()), + ("parent_state", "=", "posted"), + self._get_customer_accounts(), + ("full_reconcile_id", "=", False), + ("subrogation_id", "=", False), + ( + "partner_id.commercial_partner_id.factor_journal_id", + "=", + factor_journal.id, + ), + "|", + ("move_id.partner_bank_id", "=", bank_journal.bank_account_id.id), + ("move_id.partner_bank_id", "=", False), + ] + domain += [ + ( + "move_id.currency_id", + "=", + ( + journal.currency_id + and journal.currency_id.id + or journal.company_id.currency_id.id + ), + ) + ] + if factor_journal.factor_start_date: + domain.append(("date", ">=", factor_journal.factor_start_date)) + invoice_journals = self.factor_journal_id.factor_invoice_journal_ids + if invoice_journals: + domain.append(("journal_id", "in", invoice_journals.ids)) + return domain + + @api.model + def _get_customer_accounts(self): + return ("account_id.account_type", "=", "asset_receivable") + + def _get_factor_lines(self): + domain = self._get_domain_for_factor() + lines = self.env["account.move.line"].search(domain) + return lines + + def action_compute_lines(self): + self.ensure_one() + self.line_ids.write({"subrogation_id": False}) + if not self.statement_date: + statement = self.env["account.bank.statement"].search( + [ + ("journal_id.factor_type", "=", self.factor_type), + ("journal_id.currency_id", "=", self.currency_id.id), + ], + limit=1, + order="date DESC", + ) + if statement: + self.statement_date = statement.date + lines = self._get_factor_lines() + lines.write({"subrogation_id": self.id}) + if self.line_ids: + self.balance = sum(self.line_ids.mapped("amount_currency")) + return True + + def _get_bank_journal(self, factor_type, currency=None): + """Get matching bank journal + You may override to have a dedicated mapping""" + factor_type = self.factor_type + currency = self.factor_journal_id.currency_id + domain = [("type", "=", "bank"), ("factor_type", "=", factor_type)] + if currency: + domain += [("currency_id", "=", currency.id)] + res = self.env["account.journal"].search(domain, limit=1) + if not res: + raise UserError( + _("Missing bank journal with factor '%(ft)s' currency %(curr)s") + % {"ft": factor_type, "curr": currency and currency.name or ""} + ) + return res + + def _prepare_factor_file(self, factor_type): + self.ensure_one() + method = "_prepare_factor_file_%s" % factor_type + if hasattr(self, method): + return getattr(self, method)() + else: + pass + + def _sanitize_filepath(self, string): + "Helper to make safe filepath" + for elm in ["/", " ", ":", "<", ">", "\\", "|", "?", "*"]: + string = string.replace(elm, "_") + return string + + def action_confirm(self): + for rec in self: + if rec.state == "draft": + rec.state = "confirmed" + rec.date = fields.Date.today() + data = self._prepare_factor_file(rec.factor_type) + if data: + attachment = self.env["ir.attachment"].create(data) + self.message_post(attachment_ids=attachment.ids) + + def action_post(self): + for rec in self: + if ( + rec.state == "confirmed" + and rec.holdback_amount > 0 + and rec.expense_untaxed_amount > 0 + and rec.expense_tax_amount > 0 + ): + rec.state = "posted" + else: + raise UserError( + _( + "Check fields 'Holdabck Amount', 'Untaxed Amount', " + "'Tax Amount', they should have a value" + ) + ) + + def action_goto_moves(self): + self.ensure_one() + return { + "name": _("Subrogation Receipt %s") % self.display_name, + "res_model": "account.move.line", + "view_mode": "tree,form", + "domain": "[('subrogation_id', '=', %s)]" % self.id, + "type": "ir.actions.act_window", + } + + def unlink(self): + for rec in self: + if rec.state == "posted": + raise UserError(_("Subrogations in Posted state can't be deleted")) + return super().unlink() + + def _get_company_id(self): + return self.env.company.id diff --git a/account_factoring_receivable_balance/pyproject.toml b/account_factoring_receivable_balance/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/account_factoring_receivable_balance/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_factoring_receivable_balance/readme/CONFIGURE.md b/account_factoring_receivable_balance/readme/CONFIGURE.md new file mode 100644 index 000000000..2b3621c50 --- /dev/null +++ b/account_factoring_receivable_balance/readme/CONFIGURE.md @@ -0,0 +1,54 @@ +To implement your own factor connector, see +account_factoring_receivable_balance_bpce module. + +At the minimum, you have to define this Subrogation code + +``` python +class SubrogationReceipt(models.Model): + _inherit = "subrogation.receipt" + + def _prepare_factor_file_myownfactor(self): + self.ensure_one + name = "myown_file.txt" + return { + "name": name, + "res_id": self.id, + "res_model": self._name, + "datas": self._prepare_factor_file_data_myownfactor(), + } + + def _prepare_factor_file_data_myownfactor(self): + ... + return base64.b64encode(data) + + def _get_partner_field(self): + res = super()._get_partner_field() + if self.factor_type == "myownfactor": + return "myownfactor_factoring_balance" + return res +``` + +this journal code + +``` python +class AccountJournal(models.Model): + _inherit = "account.journal" + + factor_type = fields.Selection( + selection_add=[("myownfactor", "MyOwnFactor")], ondelete={"myownfactor": "set null"} + ) +``` + +this partner code + +``` python +class ResPartner(models.Model): + _inherit = "res.partner" + +myownfactor_factoring_balance = fields.Boolean( + string="Use MyOwnFactor factoring balance", + groups="account.group_account_invoice", + company_dependent=True, + help="Use MyOwnFactor factoring receivable balance external service", +) +``` diff --git a/account_factoring_receivable_balance/readme/CONTRIBUTORS.md b/account_factoring_receivable_balance/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..8c6e0d92a --- /dev/null +++ b/account_factoring_receivable_balance/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Akretion: + - David BEAL + - Alexis DE LATTRE diff --git a/account_factoring_receivable_balance/readme/DESCRIPTION.md b/account_factoring_receivable_balance/readme/DESCRIPTION.md new file mode 100644 index 000000000..fa0c44097 --- /dev/null +++ b/account_factoring_receivable_balance/readme/DESCRIPTION.md @@ -0,0 +1 @@ +see account_factoring_receivable_balance_bpce module diff --git a/account_factoring_receivable_balance/readme/USAGE.md b/account_factoring_receivable_balance/readme/USAGE.md new file mode 100644 index 000000000..fa0c44097 --- /dev/null +++ b/account_factoring_receivable_balance/readme/USAGE.md @@ -0,0 +1 @@ +see account_factoring_receivable_balance_bpce module diff --git a/account_factoring_receivable_balance/security/ir.model.access.csv b/account_factoring_receivable_balance/security/ir.model.access.csv new file mode 100644 index 000000000..910ae72c3 --- /dev/null +++ b/account_factoring_receivable_balance/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +subrogation_receipt_user,subrogation_receipt_user,model_subrogation_receipt,account.group_account_user,1,0,0,0 +subrogation_receipt_adviser,subrogation_receipt_adivser,model_subrogation_receipt,account.group_account_manager,1,1,1,1 diff --git a/account_factoring_receivable_balance/security/misc.xml b/account_factoring_receivable_balance/security/misc.xml new file mode 100644 index 000000000..06d297cb5 --- /dev/null +++ b/account_factoring_receivable_balance/security/misc.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/account_factoring_receivable_balance/static/description/index.html b/account_factoring_receivable_balance/static/description/index.html new file mode 100644 index 000000000..c1556f202 --- /dev/null +++ b/account_factoring_receivable_balance/static/description/index.html @@ -0,0 +1,483 @@ + + + + + +Account Factoring Receivable Balance + + + +
+

Account Factoring Receivable Balance

+ + +

Beta License: AGPL-3 OCA/l10n-france Translate me on Weblate Try me on Runboat

+

see account_factoring_receivable_balance_bpce module

+

Table of contents

+ +
+

Configuration

+

To implement your own factor connector, see +account_factoring_receivable_balance_bpce module.

+

At the minimum, you have to define this Subrogation code

+
+class SubrogationReceipt(models.Model):
+    _inherit = "subrogation.receipt"
+
+    def _prepare_factor_file_myownfactor(self):
+        self.ensure_one
+        name = "myown_file.txt"
+        return {
+            "name": name,
+            "res_id": self.id,
+            "res_model": self._name,
+            "datas": self._prepare_factor_file_data_myownfactor(),
+        }
+
+    def _prepare_factor_file_data_myownfactor(self):
+        ...
+        return base64.b64encode(data)
+
+    def _get_partner_field(self):
+        res = super()._get_partner_field()
+        if self.factor_type == "myownfactor":
+            return "myownfactor_factoring_balance"
+        return res
+
+

this journal code

+
+class AccountJournal(models.Model):
+    _inherit = "account.journal"
+
+    factor_type = fields.Selection(
+        selection_add=[("myownfactor", "MyOwnFactor")], ondelete={"myownfactor": "set null"}
+    )
+
+

this partner code

+
+class ResPartner(models.Model):
+    _inherit = "res.partner"
+
+myownfactor_factoring_balance = fields.Boolean(
+    string="Use MyOwnFactor factoring balance",
+    groups="account.group_account_invoice",
+    company_dependent=True,
+    help="Use MyOwnFactor factoring receivable balance external service",
+)
+
+
+
+

Usage

+

see account_factoring_receivable_balance_bpce module

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+
    +
  • Akretion:
      +
    • David BEAL
    • +
    • Alexis DE LATTRE
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainers:

+

bealdav alexis-via

+

This module is part of the OCA/l10n-france project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_factoring_receivable_balance/tests/__init__.py b/account_factoring_receivable_balance/tests/__init__.py new file mode 100644 index 000000000..d9b96c4fa --- /dev/null +++ b/account_factoring_receivable_balance/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/account_factoring_receivable_balance/tests/test_module.py b/account_factoring_receivable_balance/tests/test_module.py new file mode 100644 index 000000000..6e4c0bc0f --- /dev/null +++ b/account_factoring_receivable_balance/tests/test_module.py @@ -0,0 +1,3 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/account_factoring_receivable_balance/views/account_journal.xml b/account_factoring_receivable_balance/views/account_journal.xml new file mode 100644 index 000000000..929586424 --- /dev/null +++ b/account_factoring_receivable_balance/views/account_journal.xml @@ -0,0 +1,68 @@ + + + + + + account.journal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + account.journal + + + + + + + + + + account.journal + + + + + + + + + diff --git a/account_factoring_receivable_balance/views/account_move_line.xml b/account_factoring_receivable_balance/views/account_move_line.xml new file mode 100644 index 000000000..db30aa9f4 --- /dev/null +++ b/account_factoring_receivable_balance/views/account_move_line.xml @@ -0,0 +1,19 @@ + + + + account.move.line + + + + + + + + + + Account moves of a subrogation + account.move.line + tree,form + + + diff --git a/account_factoring_receivable_balance/views/res_partner.xml b/account_factoring_receivable_balance/views/res_partner.xml new file mode 100644 index 000000000..990c0f658 --- /dev/null +++ b/account_factoring_receivable_balance/views/res_partner.xml @@ -0,0 +1,22 @@ + + + + res.partner + + + + + + + + + + + diff --git a/account_factoring_receivable_balance/views/subrogation_receipt.xml b/account_factoring_receivable_balance/views/subrogation_receipt.xml new file mode 100644 index 000000000..399e639a3 --- /dev/null +++ b/account_factoring_receivable_balance/views/subrogation_receipt.xml @@ -0,0 +1,232 @@ + + + + subrogation.receipt + +
+
+
+ +
+ +
+
+

+

+
+ + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + + subrogation.receipt + + + + + + + + + + + + + + + + subrogation.receipt + + + + + + + + + + + + + Subrogation Receipts + subrogation.receipt + tree,form + + + + Created Subrogation Receipts + subrogation.receipt + tree,form + + + + + +
diff --git a/account_factoring_receivable_balance_bpce/README.rst b/account_factoring_receivable_balance_bpce/README.rst new file mode 100644 index 000000000..e5649003e --- /dev/null +++ b/account_factoring_receivable_balance_bpce/README.rst @@ -0,0 +1,126 @@ +========================================= +Account Factoring Receivable Balance BPCE +========================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:063d495a7d079ae9bafe1d7f47890862938bed76c7a1a0a94afd8fe018ea6303 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--france-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-france/tree/17.0/account_factoring_receivable_balance_bpce + :alt: OCA/l10n-france +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-france-17-0/l10n-france-17-0-account_factoring_receivable_balance_bpce + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-france&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Gestion de balance avec BPCE + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +- use a company with l10n_fr +- alternatively you may create a new one with + +Here you can create a new company with BPCE settings for default +currency + +.. code:: python + + env["res.company"]._create_french_company(company_name="my new company") + +Here you may create settings for a new installed currency + +.. code:: python + + env.browse(mycompany_id)._configure_bpce_factoring(currency_record) + +- you may execute this last method with UI in res.company form (Factor + tab) +- now you can go to journals and filter them with Factor type. +- set bpce to Factor Type to each bank journal related to currency of + previous journals. + +Known issues / Roadmap +====================== + +Seul le mode de réglement est géré dans ce module. + +Les prélèvements, effets, BOR, et chèques ne le sont pas + +Dans le fichier émis en position 53, seul le cas export est traité. + +See TODO in source code + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Akretion + +Contributors +------------ + +- Akretion: + + - David BEAL + - Alexis DE LATTRE + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px + :target: https://github.com/bealdav + :alt: bealdav +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainers `__: + +|maintainer-bealdav| |maintainer-alexis-via| + +This module is part of the `OCA/l10n-france `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_factoring_receivable_balance_bpce/__init__.py b/account_factoring_receivable_balance_bpce/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_factoring_receivable_balance_bpce/__manifest__.py b/account_factoring_receivable_balance_bpce/__manifest__.py new file mode 100644 index 000000000..22623613e --- /dev/null +++ b/account_factoring_receivable_balance_bpce/__manifest__.py @@ -0,0 +1,26 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion + +{ + "name": "Account Factoring Receivable Balance BPCE", + "version": "17.0.1.0.0", + "category": "Accounting", + "license": "AGPL-3", + "website": "https://github.com/OCA/l10n-france", + "author": "Akretion,Odoo Community Association (OCA)", + "maintainers": [ + "bealdav", + "alexis-via", + ], + "depends": [ + "account_factoring_receivable_balance", + "l10n_fr", + ], + "data": [ + "views/partner.xml", + "views/company.xml", + ], + "demo": [ + "views/company_demo.xml", + ], +} diff --git a/account_factoring_receivable_balance_bpce/i18n/account_factoring_receivable_balance_bpce.pot b/account_factoring_receivable_balance_bpce/i18n/account_factoring_receivable_balance_bpce.pot new file mode 100644 index 000000000..b0138d58b --- /dev/null +++ b/account_factoring_receivable_balance_bpce/i18n/account_factoring_receivable_balance_bpce.pot @@ -0,0 +1,124 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_factoring_receivable_balance_bpce +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-07-08 17:21+0000\n" +"PO-Revision-Date: 2022-07-08 17:21+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_factoring_receivable_balance_bpce +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance_bpce.view_company_form +msgid "001234" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance_bpce.selection__account_journal__factor_type__bpce +msgid "BPCE" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "BPCE Journal with currency '%s' already exist. Configuration aborted" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_company__bpce_factor_code +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_factor_code +msgid "Bpce Factor Code" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance_bpce.view_company_form +msgid "Configure BPCE journals and accounts" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_partner +msgid "Contact" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_subrogation_receipt +msgid "Customer balance data for factoring" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_account_bank_statement_import_journal_creation__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_account_journal__factor_type +msgid "Factor" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "Go to accounting chart configuration" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_company__bpce_start_date +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_start_date +msgid "No account move will be selected before this date" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_company__bpce_factor_code +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_factor_code +msgid "N° de compte chez PBCE" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_company__bpce_start_date +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_start_date +msgid "Start Date" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "" +"The accounting chart installed in this company is not the french one. " +"Install it first" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_partner__bpce_factoring_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_users__bpce_factoring_balance +msgid "Use BPCE factoring balance" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_partner__bpce_factoring_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_users__bpce_factoring_balance +msgid "Use BPCE factoring receivable balance external service" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "You must select a currency to begin configuration" +msgstr "" diff --git a/account_factoring_receivable_balance_bpce/i18n/fr.po b/account_factoring_receivable_balance_bpce/i18n/fr.po new file mode 100644 index 000000000..fac2d8328 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/i18n/fr.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_factoring_receivable_balance_bpce +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-07-08 17:21+0000\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#. module: account_factoring_receivable_balance_bpce +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance_bpce.view_company_form +msgid "001234" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields.selection,name:account_factoring_receivable_balance_bpce.selection__account_journal__factor_type__bpce +msgid "BPCE" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "BPCE Journal with currency '%s' already exist. Configuration aborted" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_company__bpce_factor_code +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_factor_code +msgid "Bpce Factor Code" +msgstr "Code Factor Bpce" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model_terms:ir.ui.view,arch_db:account_factoring_receivable_balance_bpce.view_company_form +msgid "Configure BPCE journals and accounts" +msgstr "Configure journaux et comptes BPCE" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_res_partner +msgid "Contact" +msgstr "Contact" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_subrogation_receipt +msgid "Customer balance data for factoring" +msgstr "Customer balance data for factoring" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_account_bank_statement_import_journal_creation__factor_type +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_account_journal__factor_type +msgid "Factor" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "Go to accounting chart configuration" +msgstr "Aller à la configuration du plan comptable" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model,name:account_factoring_receivable_balance_bpce.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_company__bpce_start_date +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_start_date +msgid "No account move will be selected before this date" +msgstr "Aucune écriture comptable ne sera sélectionné après cette date" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_company__bpce_factor_code +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_factor_code +msgid "N° de compte chez PBCE" +msgstr "" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_company__bpce_start_date +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_config_settings__bpce_start_date +msgid "Start Date" +msgstr "Date de début" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "" +"The accounting chart installed in this company is not the french one. " +"Install it first" +msgstr "" +"Le plan comptable installé dans cette société n'est pas celui de la " +"France. Installez le d'abord." + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_partner__bpce_factoring_balance +#: model:ir.model.fields,field_description:account_factoring_receivable_balance_bpce.field_res_users__bpce_factoring_balance +msgid "Use BPCE factoring balance" +msgstr "Utiliser le factoring de balance BPCE" + +#. module: account_factoring_receivable_balance_bpce +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_partner__bpce_factoring_balance +#: model:ir.model.fields,help:account_factoring_receivable_balance_bpce.field_res_users__bpce_factoring_balance +msgid "Use BPCE factoring receivable balance external service" +msgstr "Utiliser le service externe factoring de balance BPCE" + +#. module: account_factoring_receivable_balance_bpce +#: code:addons/account_factoring_receivable_balance_bpce/models/company.py:0 +#, python-format +msgid "You must select a currency to begin configuration" +msgstr "Vous dever sélection une devise pour commencer la configuration" diff --git a/account_factoring_receivable_balance_bpce/models/__init__.py b/account_factoring_receivable_balance_bpce/models/__init__.py new file mode 100644 index 000000000..aacf30390 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/__init__.py @@ -0,0 +1,5 @@ +from . import partner +from . import account_journal +from . import subrogation_receipt +from . import company +from . import config diff --git a/account_factoring_receivable_balance_bpce/models/account_journal.py b/account_factoring_receivable_balance_bpce/models/account_journal.py new file mode 100644 index 000000000..dfdaad995 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/account_journal.py @@ -0,0 +1,13 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + factor_type = fields.Selection( + selection_add=[("bpce", "BPCE")], ondelete={"bpce": "set null"} + ) diff --git a/account_factoring_receivable_balance_bpce/models/company.py b/account_factoring_receivable_balance_bpce/models/company.py new file mode 100644 index 000000000..fe7aad600 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/company.py @@ -0,0 +1,192 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo import Command, _, api, fields, models +from odoo.exceptions import RedirectWarning, UserError +from odoo.tests import Form + +logger = logging.getLogger(__name__) + + +class ResCompany(models.Model): + _inherit = "res.company" + + factor_config_currency_id = fields.Many2one( + comodel_name="res.currency", + string="Facto Currency", + help="Use to configure account and journal", + ) + bpce_factor_code = fields.Char(size=6, help="N° de compte chez PBCE") + bpce_start_date = fields.Date( + string="Start Date", + tracking=True, + help="No account move will be selected before this date", + ) + + @api.model + def _create_french_company(self, company_name=None): + """ + Method to use with the cmd line (demo purpose) + Can be called from Odoo Shell + """ + demo_cpny_name = "BPCE demo" + previous_cpny = self.search([("name", "=", demo_cpny_name)], limit=1) + previous_cpny.write({"name": "Company %s" % previous_cpny.id}) + company = self.create( + { + "name": company_name or demo_cpny_name, + "street": "42 rue du logiciel libre", + "zip": "69009", + "city": "Lyon", + "country_id": self.env.ref("base.fr").id, + "siret": "77788899100018", + "vat": "FR51777888991", + } + ) + self.env.ref("l10n_fr.l10n_fr_pcg_chart_template")._load(20.0, 20.0, company) + self.env.ref("base.user_admin").company_ids = [Command.link(company.id)] + logger.info("Company %s" % company.name) + for currency in self.env["res.currency"].search([]): + logger.info("Journal and account for factor to create") + company._configure_bpce_factoring(currency=currency.name) + return company + + def _prepare_data_for_factor(self, move_type="out_invoice"): + self.ensure_one() + move_form = Form( + self.env["account.move"] + .with_company(self.env.company) + .with_context( + default_move_type=move_type, + account_predictive_bills_disable_prediction=True, + ) + ) + move_form.invoice_date = fields.Date.from_string("2022-10-03") + move_form.date = move_form.invoice_date + move_form.partner_id = self.env.ref("base.res_partner_2") + + def ui_populate_data_for_factor(self): + raise UserError(_("Not yet implemented")) + # self._prepare_data_for_factor() + + def ui_configure_bpce_factoring_balance(self): + self.ensure_one() + if not self.factor_config_currency_id: + raise UserError(_("You must select a currency to begin configuration")) + self._configure_bpce_factoring(currency=self.factor_config_currency_id.name) + bpce_journals = self.env["account.journal"].search( + [("factor_type", "=", "bpce"), ("company_id", "=", self.id)] + ) + action_id = self.env.ref("account.action_account_journal_form").id + active_ids = ",".join([str(x) for x in bpce_journals.ids]) + + return { + "type": "ir.actions.client", + "tag": "display_notification", + "params": { + "title": "Configuration réussie", + "type": "success", # warning/success + "message": "Consulter les journaux et comptes configurés", + "links": [ + { + "label": "Voir les journaux", + "url": f"#action={action_id}&model=account.journal" + f"&active_ids={active_ids}", + } + ], + "sticky": True, # True/False will display for few seconds if false + "next": action_id, + }, + } + + @api.model + def _configure_bpce_factoring(self, currency): + """Mainly copied from l10n_fr_account_vat_return + The code is created here and not in the test, + because it can be very useful for demos too + + This method can be called to configure actual company or a new one + """ + self = self.sudo() + self.ensure_one() + currency = self.env.ref("base.%s" % currency.upper(), raise_if_not_found=False) + if not currency: + # pylint: disable=C8107 + raise UserError("La devise '%s' est inconnue" % currency.name) + if self.env["account.journal"].search( + [ + ("factor_type", "=", "bpce"), + ("company_id", "=", self.id), + ("currency_id", "=", currency.id), + ] + ): + # pylint: disable=C8107 + raise UserError( + "Un journal BPCE avec la devise '%s' existe déjà. Configuration annulée" + % currency.name + ) + fr_chart_template = self.env.ref("l10n_fr.l10n_fr_pcg_chart_template") + company = self + if self.chart_template_id != fr_chart_template: + action = self.env.ref("account.action_account_config").read()[0] + action["name"] = "Configure accounting chart in '%s' company" % self.name + raise RedirectWarning( + _( + "The accounting chart installed in this company " + "is not the french one. Install it first" + ), + action, + _("Go to accounting chart configuration"), + {"active_ids": [self.env.company.id]}, + ) + if self.env["account.journal"].search( + [ + ("factor_type", "=", "bpce"), + ("currency_id", "=", currency.id), + ("company_id", "=", company.id), + ] + ): + raise UserError( + _( + "BPCE Journal with currency '%s' already exist. " + "Configuration aborted" + ) + % currency.name + ) + vals = {"reconcile": False, "tax_ids": False, "company_id": company.id} + acc = {} + revenue_type_id = self.env.ref("account.data_account_type_revenue").id + for acco in ( + ["4115", "Factoring Receivable", revenue_type_id], + ["4671", "Factoring Current", revenue_type_id], + ["4672", "Factoring Holdback", revenue_type_id], + ["4673", "Factoring Recharging", revenue_type_id], + ): + code = f"{acco[0]}{currency.symbol}" + values = {"code": code, "name": acco[1], "user_type_id": acco[2]} + values.update(vals) + acc[code] = self.env["account.account"].create(values) + expense_acc = self.env["account.account"].search( + [("code", "=", "622500"), ("company_id", "=", company.id)] + ) + self.env["account.journal"].create( + { + "name": "BPCE %s" % currency.symbol, + "type": "general", + "factor_type": "bpce", + "code": "BPCE%s" % currency.symbol, + "currency_id": currency.id, + "company_id": company.id, + "factoring_receivable_account_id": acc["4115%s" % currency.symbol].id, + "factoring_current_account_id": acc["4671%s" % currency.symbol].id, + "factoring_holdback_account_id": acc["4672%s" % currency.symbol].id, + "factoring_pending_recharging_account_id": acc[ + "4673%s" % currency.symbol + ].id, + "factoring_expense_account_id": expense_acc.id, + } + ) + return company diff --git a/account_factoring_receivable_balance_bpce/models/config.py b/account_factoring_receivable_balance_bpce/models/config.py new file mode 100644 index 000000000..b3cfae84c --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/config.py @@ -0,0 +1,16 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo import fields, models + +logger = logging.getLogger(__name__) + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + bpce_factor_code = fields.Char(related="company_id.bpce_factor_code") + bpce_start_date = fields.Date(related="company_id.bpce_start_date") diff --git a/account_factoring_receivable_balance_bpce/models/partner.py b/account_factoring_receivable_balance_bpce/models/partner.py new file mode 100644 index 000000000..5001ac279 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/partner.py @@ -0,0 +1,27 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.exceptions import UserError + + +class ResPartner(models.Model): + _inherit = "res.partner" + + bpce_factoring_balance = fields.Boolean( + string="Use BPCE factoring balance", + groups="account.group_account_invoice", + company_dependent=True, + help="Use BPCE factoring receivable balance external service", + ) + + @api.constrains("bpce_factoring_balance", "ref") + def bpce_ref_constrains(self): + for rec in self: + if rec.bpce_factoring_balance and (not rec.ref or not rec.siret): + # pylint: disable=C8107 + raise UserError( + "Les balances clients gérées par BPCE doivent avoir " + "les champs Référence et SIRET remplis" + ) diff --git a/account_factoring_receivable_balance_bpce/models/subrogation_receipt.py b/account_factoring_receivable_balance_bpce/models/subrogation_receipt.py new file mode 100644 index 000000000..6f43b5f94 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/models/subrogation_receipt.py @@ -0,0 +1,279 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import base64 +import re + +from odoo import api, fields, models, tools +from odoo.exceptions import UserError + +FORMAT_VERSION = "7.0" +RETURN = "\r\n" + + +class SubrogationReceipt(models.Model): + _inherit = "subrogation.receipt" + + def _prepare_factor_file_bpce(self): + self.ensure_one() + name = "BPCE_{}_{}_{}.txt".format( + self._sanitize_filepath(f"{fields.Date.today()}"), + self.id, + self._sanitize_filepath(self.company_id.name), + ) + return { + "name": name, + "res_id": self.id, + "res_model": self._name, + "datas": self._prepare_factor_file_data_bpce(), + } + + def _prepare_factor_file_data_bpce(self): + self.ensure_one() + if not self.company_id.bpce_factor_code: + # pylint: disable=C8107 + raise UserError( + "Vous devez mettre le code du factor dans la société '{}'.\n" + "Champ dans l'onglet 'Factor'".format(self.env.company.name) + ) + if not self.statement_date: + # pylint: disable=C8107 + raise UserError("Vous devez spécifier la date du dernier relevé") + body, max_row, balance = self._get_bpce_body() + header = self._get_bpce_header() + check_column_size(header) + ender = self._get_bpce_ender(max_row, balance) + check_column_size(ender) + raw_data = (f"{header}{RETURN}{body}{RETURN}{ender}{RETURN}").replace( + "False", " " + ) + data = clean_string(raw_data) + # check there is no regression in colmuns position + check_column_position(raw_data, self.factor_journal_id, False) + check_column_position(data, self.factor_journal_id) + dev_mode = tools.config.options.get("dev_mode") + if dev_mode and dev_mode[0][-3:] == "pdb" or False: + # make debugging easier saving file on filesystem to check + debug(raw_data, "_raw") + debug(data) + # pylint: disable=C8107 + raise UserError("See files /odoo/subrog*.txt") + total_in_erp = sum(self.line_ids.mapped("amount_currency")) + if round(balance, 2) != round(total_in_erp, 2): + # pylint: disable=C8107 + raise UserError( + "Erreur dans le calul de la balance :" + f"\n - erp : {total_in_erp}\n - fichier : {balance}" + ) + self.write({"balance": balance}) + # non ascii chars are replaced + data = bytes(data, "ascii", "replace").replace(b"?", b" ") + return base64.b64encode(data) + + def _get_partner_field(self): + res = super()._get_partner_field() + if self.factor_type == "bpce": + return "bpce_factoring_balance" + return res + + @api.model + def _get_domain_for_factor( + self, factor_type, partner_selection_field=None, currency=None + ): + "Minimal override of the Account move lines" + domain = super()._get_domain_for_factor( + factor_type, + partner_selection_field=partner_selection_field, + currency=currency, + ) + if self.env.company.bpce_start_date: + domain = [("date", ">=", self.env.company.bpce_start_date)] + domain + return domain + + def _get_bpce_header(self): + self = self.sudo() + info = { + "code": pad(self.company_id.bpce_factor_code, 6, 0), + "devise": self.factor_journal_id.currency_id.name, + "name": pad(self.company_id.partner_id.name, 25), + "statem_date": bpce_date(self.statement_date), + "date": bpce_date(self.date), + "idfile": pad(self.id, 3, 0), + "reserved": pad(" ", 208), + "format": FORMAT_VERSION, + } + string = "01000001138{code}{devise}{name}{statem_date}{date}" + string += "{idfile}{format}{reserved}" + return string.format(**info) + + def _get_bpce_ender(self, max_row, balance): + self = self.sudo() + info = { + "seq": pad(max_row + 2, 6, 0), + "code": pad(self.company_id.bpce_factor_code, 6, 0), + "name": pad(self.company_id.partner_id.name[:25], 25), + "balance": pad(round(balance * 100), 13, 0), + "reserved": pad(" ", 220), + } + return "09{seq}138{code}{name}{balance}{reserved}".format(**info) + + def _get_bpce_body(self): + self = self.sudo() + sequence = 1 + rows = [] + balance = 0 + for line in self.line_ids: + move = line.move_id + partner = line.move_id.partner_id.commercial_partner_id + if not partner: + raise UserError(f"Pas de partenaire sur la pièce {line.move_id}") + sequence += 1 + name = pad(move.name, 30, position="left") + p_type = get_type_piece(move) + total = move.amount_total_in_currency_signed + info = { + "seq": pad(sequence, 6, 0), + "siret": pad(" ", 14) + if not partner.siret + else pad(partner.siret, 14, 0, position="left"), + "pname": pad(partner.name[:15], 15, position="left"), + "ref_cli": pad(partner.ref, 10, position="left"), + "res1": pad(" ", 5), + "activity": "D" + if partner.country_id == self.env.ref("base.fr") + else "E", + "res2": pad(" ", 9), + "cmt": pad(" ", 20), + "piece": name, + "piece_factor": get_piece_factor(name, p_type), + "type": p_type, + "paym": "VIR" + if p_type == "FAC" + else " ", # TODO only VIR is implemented + "date": bpce_date(move.invoice_date if p_type == "FAC" else move.date), + "date_due": bpce_date(move.invoice_date_due) or pad(" ", 8), + "total": pad(round(abs(total) * 100), 13, 0), + "devise": move.currency_id.name, + "res3": " ", + "eff_non_echu": " ", # TODO + "eff_num": pad(" ", 7), # TODO + "eff_total": pad("", 13, 0), # effet total TODO not implemented + "eff_imputed": pad("", 13, 0), # effet imputé TODO not implemented + "rib": pad(" ", 23), # TODO + "eff_echeance": pad(" ", 8), # date effet echeance TODO not implemented + "eff_pull": pad(" ", 10), # reférence tiré/le nom TODO not implemented + # 0: traite non accepté, 1: traite accepté, 2: BOR TODO not implemented + "eff_type": " ", + "res4": pad(" ", 17), + } + balance += total + fstring = "02{seq}{siret}{pname}{ref_cli}{res1}{activity}{res2}{cmt}" + fstring += "{piece}{piece_factor}{type}{paym}{date}{date_due}" + fstring += "{total}{devise}{res3}{eff_non_echu}{eff_num}{eff_total}" + fstring += "{eff_imputed}{rib}{eff_echeance}{eff_pull}{eff_type}{res4}" + string = fstring.format(**info) + check_column_size(string, fstring, info) + rows.append(string) + return (RETURN.join(rows), len(rows), balance) + + +def get_piece_factor(name, p_type): + if not p_type: + return "{}{}".format(name[:15], pad(" ", 15)) + return name[:30] + + +def get_type_piece(move): + journal_type = move.journal_id.type + p_type = False + move_type = move.move_type + if move_type == "entry": + if journal_type == "general": + # TODO : improve + od_type = False + lines = move.line_ids.filtered( + lambda s: s.account_id.group_id == s.env.ref("l10n_fr.1_pcg_411") + ) + for line in lines: + if max(line.debit, line.credit) == move.amount_total: + if line.debit == move.amount_total: + od_type = "D" + else: + od_type = "C" + break + if not od_type: + # pylint: disable=C8107 + raise UserError(f"Impossible de déterminer le type de l'OD {move.name}") + p_type = f"OD{od_type}" + elif move_type == "out_invoice": + p_type = "FAC" + elif move_type == "out_refund": + p_type = "AVO" + assert len(p_type) == 3 + return p_type + + +def bpce_date(date_field): + return date_field.strftime("%d%m%Y") + + +def pad(string, pad, end=" ", position="right"): + "Complete string by leading `end` string from `position`" + if isinstance(end, int | float): + end = str(end) + if isinstance(string, int | float): + string = str(string) + if position == "right": + string = string.rjust(pad, end) + else: + string = string.ljust(pad, end) + return string + + +def clean_string(string): + """Remove all except [A-Z], space, \r, \n + https://www.rapidtables.com/code/text/ascii-table.html""" + string = string.replace(FORMAT_VERSION, "FORMATVERSION") + string = string.upper() + string = re.sub(r"[\x21-\x2F]|[\x3A-\x40]|[\x5E-\x7F]|\x0A\x0D", r" ", string) + string = string.replace("FORMATVERSION", FORMAT_VERSION) + return string + + +def debug(content, suffix=""): + mpath = f"/odoo/subrog{suffix}.txt" + with open(mpath, "wb") as f: + if isinstance(content, str): + content = bytes(content, "ascii", "replace") + f.write(content) + + +def check_column_size(string, fstring=None, info=None): + if len(string) != 275: + if fstring and info: + fstring = fstring.replace("{", "|{") + fstring = fstring.format(**info) + strings = fstring.split("|") + for mystr in strings: + strings[strings.index(mystr)] = f"{mystr}({len(mystr)})" + fstring = "|".join(strings) + else: + fstring = "" + # pylint: disable=C8107 + raise UserError( + "La ligne suivante contient {} caractères au lieu de 275\n\n{}" + "\n\nDebugging string:\n{}s".format(len(string), string, fstring) + ) + + +def check_column_position(content, factor_journal, final=True): + line2 = content.split(RETURN)[1] + # line2 = content.readline(2) + currency = line2[177:180] + msg = "Problème de décalage colonne dans le fichier" + if final: + msg += " final" + else: + msg += " brut" + assert currency == factor_journal.currency_id.name, msg diff --git a/account_factoring_receivable_balance_bpce/pyproject.toml b/account_factoring_receivable_balance_bpce/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/account_factoring_receivable_balance_bpce/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_factoring_receivable_balance_bpce/readme/CONFIGURE.md b/account_factoring_receivable_balance_bpce/readme/CONFIGURE.md new file mode 100644 index 000000000..ae7894ea1 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/readme/CONFIGURE.md @@ -0,0 +1,21 @@ +- use a company with l10n_fr +- alternatively you may create a new one with + +Here you can create a new company with BPCE settings for default +currency + +``` python +env["res.company"]._create_french_company(company_name="my new company") +``` + +Here you may create settings for a new installed currency + +``` python +env.browse(mycompany_id)._configure_bpce_factoring(currency_record) +``` + +- you may execute this last method with UI in res.company form (Factor + tab) +- now you can go to journals and filter them with Factor type. +- set bpce to Factor Type to each bank journal related to currency of + previous journals. diff --git a/account_factoring_receivable_balance_bpce/readme/CONTRIBUTORS.md b/account_factoring_receivable_balance_bpce/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..8c6e0d92a --- /dev/null +++ b/account_factoring_receivable_balance_bpce/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Akretion: + - David BEAL + - Alexis DE LATTRE diff --git a/account_factoring_receivable_balance_bpce/readme/DESCRIPTION.md b/account_factoring_receivable_balance_bpce/readme/DESCRIPTION.md new file mode 100644 index 000000000..299661695 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Gestion de balance avec BPCE diff --git a/account_factoring_receivable_balance_bpce/readme/ROADMAP.md b/account_factoring_receivable_balance_bpce/readme/ROADMAP.md new file mode 100644 index 000000000..f816b8b4c --- /dev/null +++ b/account_factoring_receivable_balance_bpce/readme/ROADMAP.md @@ -0,0 +1,7 @@ +Seul le mode de réglement est géré dans ce module. + +Les prélèvements, effets, BOR, et chèques ne le sont pas + +Dans le fichier émis en position 53, seul le cas export est traité. + +See TODO in source code diff --git a/account_factoring_receivable_balance_bpce/static/description/index.html b/account_factoring_receivable_balance_bpce/static/description/index.html new file mode 100644 index 000000000..b86393436 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/static/description/index.html @@ -0,0 +1,458 @@ + + + + + +Account Factoring Receivable Balance BPCE + + + +
+

Account Factoring Receivable Balance BPCE

+ + +

Beta License: AGPL-3 OCA/l10n-france Translate me on Weblate Try me on Runboat

+

Gestion de balance avec BPCE

+

Table of contents

+ +
+

Configuration

+
    +
  • use a company with l10n_fr
  • +
  • alternatively you may create a new one with
  • +
+

Here you can create a new company with BPCE settings for default +currency

+
+env["res.company"]._create_french_company(company_name="my new company")
+
+

Here you may create settings for a new installed currency

+
+env.browse(mycompany_id)._configure_bpce_factoring(currency_record)
+
+
    +
  • you may execute this last method with UI in res.company form (Factor +tab)
  • +
  • now you can go to journals and filter them with Factor type.
  • +
  • set bpce to Factor Type to each bank journal related to currency of +previous journals.
  • +
+
+
+

Known issues / Roadmap

+

Seul le mode de réglement est géré dans ce module.

+

Les prélèvements, effets, BOR, et chèques ne le sont pas

+

Dans le fichier émis en position 53, seul le cas export est traité.

+

See TODO in source code

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+
    +
  • Akretion:
      +
    • David BEAL
    • +
    • Alexis DE LATTRE
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainers:

+

bealdav alexis-via

+

This module is part of the OCA/l10n-france project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_factoring_receivable_balance_bpce/tests/__init__.py b/account_factoring_receivable_balance_bpce/tests/__init__.py new file mode 100644 index 000000000..d9b96c4fa --- /dev/null +++ b/account_factoring_receivable_balance_bpce/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/account_factoring_receivable_balance_bpce/tests/test_module.py b/account_factoring_receivable_balance_bpce/tests/test_module.py new file mode 100644 index 000000000..377f85264 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/tests/test_module.py @@ -0,0 +1,47 @@ +# © 2022 David BEAL @ Akretion +# © 2022 Alexis DE LATTRE @ Akretion + +from odoo.tests import tagged + +# from odoo import fields +# from odoo.tests import tagged +from odoo.tests.common import TransactionCase + +# from odoo.addons.account.tests.common import AccountTestInvoicingCommon + + +# TODO : IMPLEMENT TESTS + + +# class Test(AccountTestInvoicingCommon): +# @tagged("standard") +# @tagged("+nice") +@tagged("-at_install", "post_install") +class TestB(TransactionCase): + # @classmethod + # def setUpClass(cls): + # super().setUpClass() + # cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + # cls.user_model = cls.env["res.users"].with_context(no_reset_password=True) + # cls.patch(type(cls.env["res.partner"]), "_get_gravatar_image", lambda *a: False) + + def setUp(self): + super().setUp() + self.env = self.env(context=dict(self.env.context, tracking_disable=True)) + self.pp = "PP" + + def test_module(self): + company = self.env["res.company"]._create_french_company(company_name="Any") + assert len(company) == 1 + # partner = self.partner_a + # tax = self.tax_sale_a + # today = fields.Date.today() + # self.init_invoice( + # "in_invoice", + # partner=partner, + # invoice_date=today, + # post=True, + # amounts=[100], + # taxes=tax, + # company=company, + # ) diff --git a/account_factoring_receivable_balance_bpce/views/company.xml b/account_factoring_receivable_balance_bpce/views/company.xml new file mode 100644 index 000000000..fe992aa38 --- /dev/null +++ b/account_factoring_receivable_balance_bpce/views/company.xml @@ -0,0 +1,29 @@ + + + + res.company + + + + + + + + + + +