diff --git a/hr_expense_invoice/README.rst b/hr_expense_invoice/README.rst new file mode 100644 index 000000000..759779860 --- /dev/null +++ b/hr_expense_invoice/README.rst @@ -0,0 +1,121 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Supplier invoices on HR expenses +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9eca0748af62f7f5a3ace8bd4bbe82abdca21c001a31f0539e2ddd19bf0530b6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fhr--expense-lightgray.png?logo=github + :target: https://github.com/OCA/hr-expense/tree/19.0/hr_expense_invoice + :alt: OCA/hr-expense +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-expense-19-0/hr-expense-19-0-hr_expense_invoice + :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/hr-expense&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module lets you link an existing posted vendor bill to an employee +expense, so the bill stays the accounting document for that expense +instead of an auto-generated receipt. Use it when an employee paid a +supplier invoice and you want the original bill to remain the source of +truth. When the expense is posted, the module books an entry that +transfers the debt from the bill's vendor to the employee, and the +expense is settled once the bill is paid. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +**Reference one invoice to an expense** + +- Create an expense sheet. +- Add an expense line to sheet with an invoice_id selected or create one + new. +- Process expense sheet. +- On paying expense sheet, you are reconciling supplier invoice too. + +**Create one invoice to multiple expenses** + +- Create an expense sheet with one or multiple expense lines +- After approved, click button "Create Vendor Bill" +- Select multiple expense to create an invoice, and process it. +- New invoice will be create and link to the selected expense lines. +- Validate newly create invoice. +- On paying expense sheet, you are reconciling supplier invoice(s) too. + +Known issues / Roadmap +====================== + +- Multiple payment terms for a supplier invoice are not handled + correctly. +- Partial reconcile supplier invoices are also not correctly handled. + +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 +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__: + + - Pedro M. Baeza + - Vicent Cubells + - Víctor Martínez + +- Kitti Upariphutthiphong +- Rattapong Chokmasermkul +- Saran Lim. + +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. + +This module is part of the `OCA/hr-expense `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_expense_invoice/__init__.py b/hr_expense_invoice/__init__.py new file mode 100644 index 000000000..69f7babdf --- /dev/null +++ b/hr_expense_invoice/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/hr_expense_invoice/__manifest__.py b/hr_expense_invoice/__manifest__.py new file mode 100644 index 000000000..0e30e8575 --- /dev/null +++ b/hr_expense_invoice/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2015-2021 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Supplier invoices on HR expenses", + "version": "19.0.1.0.0", + "category": "Human Resources", + "author": "Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/hr-expense", + "depends": ["hr_expense"], + "data": [ + "views/account_move_views.xml", + "views/hr_expense_views.xml", + ], + "installable": True, +} diff --git a/hr_expense_invoice/i18n/cs_CZ.po b/hr_expense_invoice/i18n/cs_CZ.po new file mode 100644 index 000000000..17f9e98ed --- /dev/null +++ b/hr_expense_invoice/i18n/cs_CZ.po @@ -0,0 +1,129 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-23 03:45+0000\n" +"PO-Revision-Date: 2018-02-23 03:45+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Výdaje" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Zpráva o výdajích" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Výdaje" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +#, fuzzy +msgid "Invoice Count" +msgstr "Faktura" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy, python-format +msgid "Invoices" +msgstr "Faktura" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/de.po b/hr_expense_invoice/i18n/de.po new file mode 100644 index 000000000..93e1e9ff0 --- /dev/null +++ b/hr_expense_invoice/i18n/de.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-12 14:43+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy +msgid "Create Vendor Bill" +msgstr "Lieferantenrechnung" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Spesen" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Spesen-Bericht" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Spesen" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +#, fuzzy +msgid "Invoice Count" +msgstr "Rechnung" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy, python-format +msgid "Invoices" +msgstr "Rechnung" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "Lieferantenrechnung" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/es.po b/hr_expense_invoice/i18n/es.po new file mode 100644 index 000000000..c51105990 --- /dev/null +++ b/hr_expense_invoice/i18n/es.po @@ -0,0 +1,140 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-27 16:34+0000\n" +"PO-Revision-Date: 2023-10-29 23:38+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "Crear Factura de Vendedor" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Gasto" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Informe de gastos" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +msgid "Expenses" +msgstr "Gastos" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +msgid "Invoice Count" +msgstr "Conteo de Factura" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, python-format +msgid "Invoices" +msgstr "Facturas" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "Entrada Diaria" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "Estado de la hoja" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "Factura de Proveedor" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" +"El importe de la factura del proveedor no coincide.\n" +"Asegúrese de que el importe de la factura del proveedor coincide con el " +"importe de sus líneas de gasto" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "Debe publicarse el estado de la factura del proveedor" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" +"No puede modificar el importe total, ya que hay un gasto vinculado a esta " +"factura." + +#~ msgid "Expense Report State" +#~ msgstr "Estado del Informe de Gastos" + +#~ msgid "Register Payment" +#~ msgstr "Registrar Pago" + +#, python-format +#~ msgid "Register payment on expense's invoice is not allowed" +#~ msgstr "No se permite registrar el pago en la factura del gasto" diff --git a/hr_expense_invoice/i18n/fr.po b/hr_expense_invoice/i18n/fr.po new file mode 100644 index 000000000..5b2061c64 --- /dev/null +++ b/hr_expense_invoice/i18n/fr.po @@ -0,0 +1,129 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +# Translators: +# guillaume bauer , 2017 +# Alexandre Fayolle , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-23 03:45+0000\n" +"PO-Revision-Date: 2018-02-23 03:45+0000\n" +"Last-Translator: Alexandre Fayolle , 2018\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Note de frais" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Rapport de dépenses" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Note de frais" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +#, fuzzy +msgid "Invoice Count" +msgstr "Facture" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy, python-format +msgid "Invoices" +msgstr "Facture" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/hr.po b/hr_expense_invoice/i18n/hr.po new file mode 100644 index 000000000..408f0ddb2 --- /dev/null +++ b/hr_expense_invoice/i18n/hr.po @@ -0,0 +1,129 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-23 03:45+0000\n" +"PO-Revision-Date: 2018-02-23 03:45+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Trošak" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Izvještaj troškova" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Trošak" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +#, fuzzy +msgid "Invoice Count" +msgstr "Račun" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy, python-format +msgid "Invoices" +msgstr "Račun" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/hr_expense_invoice.pot b/hr_expense_invoice/i18n/hr_expense_invoice.pot new file mode 100644 index 000000000..17ac05504 --- /dev/null +++ b/hr_expense_invoice/i18n/hr_expense_invoice.pot @@ -0,0 +1,176 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\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: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "" +"\n" +" Expense\n" +" " +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__amount_residual +msgid "Amount Due" +msgstr "" + +#. module: hr_expense_invoice +#: model:mail.message.subtype,name:hr_expense_invoice.mt_expense_approved_inherited +msgid "Approved" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" + +#. module: hr_expense_invoice +#: model:mail.message.subtype,description:hr_expense_invoice.mt_expense_approved_inherited +msgid "Expense report approved" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +msgid "Expenses" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +msgid "Invoice Count" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Invoices" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Please specify an expense journal in order to generate" +" accounting entries." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Please specify if the expenses for this report were paid by" +" the company, or the employee" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "Show missing work email employees" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"The work email of some employees is missing. Please add it on" +" the employee form" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "You can only generate an accounting entry for approved expense(s)." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"You cannot create accounting entries for an expense " +"report without expenses." +msgstr "" diff --git a/hr_expense_invoice/i18n/it.po b/hr_expense_invoice/i18n/it.po new file mode 100644 index 000000000..1743086ee --- /dev/null +++ b/hr_expense_invoice/i18n/it.po @@ -0,0 +1,141 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-05-30 13:38+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "Spesa" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "Crea una fattura fornitore" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Spesa" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Nota spese" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +msgid "Expenses" +msgstr "Spese" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +msgid "Invoice Count" +msgstr "Numero fatture" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, python-format +msgid "Invoices" +msgstr "Fatture" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "Movimento contabile" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" +"Riferimento alla spesa con una fattura collegata che ha generato questa " +"registrazione contabile del trasferimento" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "Stato prospetto" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "Fattura spesa origine" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "Movimento di trasferimento" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "Fattura fornitore" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" +"Differenza fattura fornitore!\n" +"Assicurarsi che il valore nel conto del fornitore sia pari al valore delle " +"righe di spesa" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "Lo stato del conto fornitore deve essere Inviato" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" +"Non si può cambiare il valore totale, perché c'è una spesa collegata a " +"questa fattura." + +#~ msgid "Expense Report State" +#~ msgstr "Stato nota spese" + +#~ msgid "Register Payment" +#~ msgstr "Registra pagamento" + +#, python-format +#~ msgid "Register payment on expense's invoice is not allowed" +#~ msgstr "Non è consentito registrare il pagamento sulla fattura delle spese" diff --git a/hr_expense_invoice/i18n/nl_NL.po b/hr_expense_invoice/i18n/nl_NL.po new file mode 100644 index 000000000..d82751219 --- /dev/null +++ b/hr_expense_invoice/i18n/nl_NL.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 01:43+0000\n" +"PO-Revision-Date: 2017-11-28 01:43+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Onkostennota" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Onkostennota" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +msgid "Invoice Count" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, python-format +msgid "Invoices" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/pt.po b/hr_expense_invoice/i18n/pt.po new file mode 100644 index 000000000..41c6049de --- /dev/null +++ b/hr_expense_invoice/i18n/pt.po @@ -0,0 +1,126 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2018-10-10 12:08+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.1.1\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "Despesa" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Relatório de Despesas" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__expense_ids +#, fuzzy +msgid "Expenses" +msgstr "Despesa" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +#, fuzzy +msgid "Invoice Count" +msgstr "Fatura" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +#, fuzzy, python-format +msgid "Invoices" +msgstr "Fatura" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_payment__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#, python-format +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +#, python-format +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" diff --git a/hr_expense_invoice/i18n/tr.po b/hr_expense_invoice/i18n/tr.po new file mode 100644 index 000000000..b29cfb948 --- /dev/null +++ b/hr_expense_invoice/i18n/tr.po @@ -0,0 +1,177 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.view_move_form +msgid "" +"\n" +" Expense\n" +" " +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__amount_residual +msgid "Amount Due" +msgstr "" + +#. module: hr_expense_invoice +#: model:mail.message.subtype,name:hr_expense_invoice.mt_expense_approved_inherited +msgid "Approved" +msgstr "" + +#. module: hr_expense_invoice +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Create Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense +msgid "Expense" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" + +#. module: hr_expense_invoice +#: model:mail.message.subtype,description:hr_expense_invoice.mt_expense_approved_inherited +msgid "Expense report approved" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__expense_ids +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__expense_ids +msgid "Expenses" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense_sheet__invoice_count +msgid "Invoice Count" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +#: model_terms:ir.ui.view,arch_db:hr_expense_invoice.hr_expense_sheet_form_view_inherit_sale_expense +msgid "Invoices" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model,name:hr_expense_invoice.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Please specify an expense journal in order to generate" +" accounting entries." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Please specify if the expenses for this report were paid by" +" the company, or the employee" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,help:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,help:hr_expense_invoice.field_account_move__source_invoice_expense_id +msgid "" +"Reference to the expense with a linked invoice that generated thistransfer " +"journal entry" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__sheet_id_state +msgid "Sheet state" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "Show missing work email employees" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_bank_statement_line__source_invoice_expense_id +#: model:ir.model.fields,field_description:hr_expense_invoice.field_account_move__source_invoice_expense_id +msgid "Source Invoice Expense" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"The work email of some employees is missing. Please add it on" +" the employee form" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__transfer_move_ids +msgid "Transfer Move" +msgstr "" + +#. module: hr_expense_invoice +#: model:ir.model.fields,field_description:hr_expense_invoice.field_hr_expense__invoice_id +msgid "Vendor Bill" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"Vendor bill amount mismatch!\n" +"Please make sure amount in vendor bills equal to amount of its expense lines" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense.py:0 +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "Vendor bill state must be Posted" +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "You can only generate an accounting entry for approved expense(s)." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/account_move.py:0 +msgid "" +"You can't change the total amount, as there's an expense linked to this " +"invoice." +msgstr "" + +#. module: hr_expense_invoice +#. odoo-python +#: code:addons/hr_expense_invoice/models/hr_expense_sheet.py:0 +msgid "" +"You cannot create accounting entries for an expense " +"report without expenses." +msgstr "" diff --git a/hr_expense_invoice/models/__init__.py b/hr_expense_invoice/models/__init__.py new file mode 100644 index 000000000..f827772aa --- /dev/null +++ b/hr_expense_invoice/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import hr_expense +from . import account_move diff --git a/hr_expense_invoice/models/account_move.py b/hr_expense_invoice/models/account_move.py new file mode 100644 index 000000000..3a13bc84e --- /dev/null +++ b/hr_expense_invoice/models/account_move.py @@ -0,0 +1,75 @@ +# Copyright 2019 Ecosoft +# Copyright 2021 Tecnativa - Víctor Martínez +# Copyright 2024 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models +from odoo.exceptions import ValidationError +from odoo.tools import float_compare + + +class AccountMove(models.Model): + _inherit = "account.move" + + # Expenses that reference this bill via invoice_id (distinct from core's + # receipt-flow expense_ids). + invoice_expense_ids = fields.One2many( + comodel_name="hr.expense", + inverse_name="invoice_id", + string="Linked Expenses", + ) + source_invoice_expense_id = fields.Many2one( + comodel_name="hr.expense", + help="Expense that owns this AP transfer entry " + "(employee-paid bill-linked path).", + ) + + @api.constrains("amount_total") + def _check_invoice_expense_ids(self): + precision = self.env["decimal.precision"].precision_get("Product Price") + for move in self.filtered("invoice_expense_ids"): + expense_amount = sum( + move.invoice_expense_ids.mapped("total_amount_currency") + ) + if float_compare(expense_amount, move.amount_total, precision) != 0: + raise ValidationError( + self.env._( + "You can't change the total amount, as there's an " + "expense linked to this invoice." + ) + ) + + def action_view_invoice_expense(self): + self.ensure_one() + return { + "type": "ir.actions.act_window", + "view_mode": "form", + "res_model": "hr.expense", + "res_id": self.invoice_expense_ids[:1].id, + } + + def action_force_register_payment(self): + if not self.source_invoice_expense_id: + return super().action_force_register_payment() + return self.line_ids.action_register_payment() + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + @api.constrains("account_id", "display_type") + def _check_payable_receivable(self): + # Expense-linked lines may legitimately mix payable/receivable + # accounts; skip the core check for those. + _self = self.filtered("expense_id") + return super(AccountMoveLine, (self - _self))._check_payable_receivable() + + def reconcile(self): + """Refresh the linked expense's residual once the transfer entry is + reconciled (bill paid -> employee reimbursed).""" + source_expenses = self.move_id.source_invoice_expense_id + not_paid = source_expenses.filtered(lambda x: x.amount_residual) + res = super().reconcile() + for expense in not_paid: + if expense.currency_id.is_zero(expense.amount_residual): + expense.invalidate_recordset(["amount_residual"]) + return res diff --git a/hr_expense_invoice/models/hr_expense.py b/hr_expense_invoice/models/hr_expense.py new file mode 100644 index 000000000..9a273ac77 --- /dev/null +++ b/hr_expense_invoice/models/hr_expense.py @@ -0,0 +1,235 @@ +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2020 Tecnativa - David Vidal +# Copyright 2021 Tecnativa - Víctor Martínez +# Copyright 2015-2024 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import Command, api, fields, models +from odoo.exceptions import UserError +from odoo.tools import float_compare + + +class HrExpense(models.Model): + _inherit = "hr.expense" + + invoice_id = fields.Many2one( + comodel_name="account.move", + string="Vendor Bill", + domain=[ + ("move_type", "=", "in_invoice"), + ("state", "=", "posted"), + ("payment_state", "=", "not_paid"), + # Exclude bills already linked to another expense. + ("invoice_expense_ids", "=", False), + ], + copy=False, + ) + transfer_move_ids = fields.One2many( + comodel_name="account.move", + inverse_name="source_invoice_expense_id", + ) + + def _prepare_invoice_values(self): + invoice_lines = [ + Command.create( + { + "product_id": self.product_id.id, + "name": self.name, + "price_unit": self.untaxed_amount_currency, + "quantity": 1, + "account_id": self.account_id.id, + "analytic_distribution": self.analytic_distribution, + "tax_ids": [Command.set(self.tax_ids.ids)], + } + ) + ] + return { + "name": "/", + "move_type": "in_invoice", + "invoice_date": self.date, + "invoice_line_ids": invoice_lines, + } + + def action_expense_create_invoice(self): + invoice = self.env["account.move"].create(self._prepare_invoice_values()) + attachments = self.env["ir.attachment"].search( + [("res_model", "=", self._name), ("res_id", "in", self.ids)] + ) + for attachment in attachments: + attachment.copy({"res_model": invoice._name, "res_id": invoice.id}) + self.write( + { + "invoice_id": invoice.id, + "quantity": 1, + "tax_ids": False, + "price_unit": invoice.amount_total, + } + ) + return True + + @api.constrains("invoice_id") + def _check_invoice_id(self): + # Allow draft bills while the expense is draft; posting is gated by + # _validate_expense_invoice() at action_post time. + for expense in self: + if ( + expense.state != "draft" + and expense.invoice_id + and expense.invoice_id.state != "posted" + ): + raise UserError(self.env._("Vendor bill state must be Posted")) + + @api.onchange("invoice_id") + def _onchange_invoice_id(self): + if self.invoice_id: + self.quantity = 1 + self.name = (self.name or "").split(" | ")[0].strip() + self.name = f"{self.name} | {self.invoice_id.name}" + self.date = self.invoice_id.date + if self.invoice_id.company_id != self.company_id: + self.company_id = self.invoice_id.company_id.id + + @api.depends("invoice_id", "tax_ids") + def _compute_price_unit(self): + with_invoice = self.filtered("invoice_id") + for record in with_invoice: + record.price_unit = record.invoice_id.amount_total + return super(HrExpense, self - with_invoice)._compute_price_unit() + + @api.depends("invoice_id", "tax_ids") + def _compute_total_amount_currency(self): + with_invoice = self.filtered("invoice_id") + for record in with_invoice: + record.total_amount_currency = record.invoice_id.amount_total + return super(HrExpense, self - with_invoice)._compute_total_amount_currency() + + @api.depends("invoice_id") + def _compute_currency_id(self): + with_invoice = self.filtered("invoice_id") + for record in with_invoice: + record.currency_id = record.invoice_id.currency_id.id + return super(HrExpense, self - with_invoice)._compute_currency_id() + + @api.depends("invoice_id") + def _compute_tax_ids(self): + with_invoice = self.filtered("invoice_id") + for record in with_invoice: + record.tax_ids = [(5,)] + return super(HrExpense, self - with_invoice)._compute_tax_ids() + + def action_post(self): + """Route bill-linked expenses through the transfer-entry flow instead + of core's auto-generated receipt; let the rest fall through to super.""" + bill_linked = self.filtered("invoice_id") + regular = self - bill_linked + bill_linked._validate_expense_invoice() + res = super(HrExpense, regular).action_post() if regular else None + own_account_bill_linked = bill_linked.filtered( + lambda e: e.payment_mode == "own_account" + ) + for expense in own_account_bill_linked: + move_vals = expense._prepare_own_account_transfer_move_vals() + move = self.env["account.move"].create(move_vals) + move.action_post() + expense._reconcile_ap_move(move) + # Company-paid bill-linked: the bill is already the company's debt, so + # no transfer entry is needed; just mark the expense approved. + company_bill_linked = bill_linked - own_account_bill_linked + if company_bill_linked: + company_bill_linked.sudo().write({"approval_state": "approved"}) + return res + + def _validate_expense_invoice(self): + """Validate that linked bills are posted and amounts match.""" + if not self: + return + DecimalPrecision = self.env["decimal.precision"] + precision = DecimalPrecision.precision_get("Product Price") + for expense in self: + invoice = expense.invoice_id + if invoice.state != "posted": + raise UserError(self.env._("Vendor bill state must be Posted")) + if ( + float_compare( + expense.total_amount_currency, invoice.amount_total, precision + ) + != 0 + ): + raise UserError( + self.env._( + "Vendor bill amount mismatch!\nPlease make sure the " + "vendor bill total equals the expense total." + ) + ) + + def _prepare_own_account_transfer_move_vals(self): + self.ensure_one() + rec = self.with_company(self.company_id) + journal = self.env["account.journal"].search( + [ + ("company_id", "=", rec.company_id.id), + ("type", "=", "general"), + ], + limit=1, + ) + employee_partner = rec.employee_id.sudo().work_contact_id + invoice_partner = rec.invoice_id.partner_id + ap_lines = rec.invoice_id.line_ids.filtered( + lambda x: x.display_type == "payment_term" + ) + amount_invoice = sum(ap_lines.mapped("credit")) + return { + "journal_id": journal.id, + "move_type": "entry", + "name": "/", + "date": rec.date, + "ref": rec.name, + "source_invoice_expense_id": rec.id, + "line_ids": [ + Command.create( + { + "account_id": ap_lines.account_id[:1].id, + "partner_id": invoice_partner.id, + "debit": amount_invoice, + } + ), + Command.create( + { + "account_id": employee_partner.property_account_payable_id.id, + "partner_id": employee_partner.id, + "credit": amount_invoice, + } + ), + ], + } + + def _reconcile_ap_move(self, move): + """Reconcile the transfer entry with the bill so paying the bill + clears the employee's portion.""" + self.ensure_one() + invoice = self.invoice_id + ap_lines = invoice.line_ids.filtered(lambda x: x.display_type == "payment_term") + transfer_line = move.line_ids.filtered( + lambda x: x.partner_id == invoice.partner_id + ) + if ap_lines and transfer_line: + (ap_lines + transfer_line).reconcile() + + @api.depends( + "transfer_move_ids.line_ids.amount_residual", + "transfer_move_ids.line_ids.amount_residual_currency", + ) + def _compute_amount_residual(self): + """For bill-linked expenses, derive the residual from the transfer + entry's open balance instead of the receipt's.""" + with_invoice = self.filtered("invoice_id") + for rec in with_invoice: + if not rec.currency_id or rec.currency_id == rec.company_currency_id: + residual_field = "amount_residual" + else: + residual_field = "amount_residual_currency" + payment_term_lines = rec.transfer_move_ids.sudo().line_ids.filtered( + lambda x: x.account_type in ("asset_receivable", "liability_payable") + ) + rec.amount_residual = -sum(payment_term_lines.mapped(residual_field)) + return super(HrExpense, self - with_invoice)._compute_amount_residual() diff --git a/hr_expense_invoice/pyproject.toml b/hr_expense_invoice/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/hr_expense_invoice/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_expense_invoice/readme/CONTRIBUTORS.md b/hr_expense_invoice/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..a0ee5e903 --- /dev/null +++ b/hr_expense_invoice/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Vicent Cubells + - Víctor Martínez +- Kitti Upariphutthiphong \<\> +- Rattapong Chokmasermkul \<\> +- Saran Lim. \<\> diff --git a/hr_expense_invoice/readme/DESCRIPTION.md b/hr_expense_invoice/readme/DESCRIPTION.md new file mode 100644 index 000000000..f7ffa40f7 --- /dev/null +++ b/hr_expense_invoice/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module lets you link an existing posted vendor bill to an employee +expense, so the bill stays the accounting document for that expense instead +of an auto-generated receipt. Use it when an employee paid a supplier +invoice and you want the original bill to remain the source of truth. When +the expense is posted, the module books an entry that transfers the debt +from the bill's vendor to the employee, and the expense is settled once the +bill is paid. diff --git a/hr_expense_invoice/readme/ROADMAP.md b/hr_expense_invoice/readme/ROADMAP.md new file mode 100644 index 000000000..ceef0a207 --- /dev/null +++ b/hr_expense_invoice/readme/ROADMAP.md @@ -0,0 +1,3 @@ +- Multiple payment terms for a supplier invoice are not handled + correctly. +- Partial reconcile supplier invoices are also not correctly handled. diff --git a/hr_expense_invoice/readme/USAGE.md b/hr_expense_invoice/readme/USAGE.md new file mode 100644 index 000000000..e2fba394e --- /dev/null +++ b/hr_expense_invoice/readme/USAGE.md @@ -0,0 +1,16 @@ +**Reference one invoice to an expense** + +- Create an expense sheet. +- Add an expense line to sheet with an invoice_id selected or create one + new. +- Process expense sheet. +- On paying expense sheet, you are reconciling supplier invoice too. + +**Create one invoice to multiple expenses** + +- Create an expense sheet with one or multiple expense lines +- After approved, click button "Create Vendor Bill" +- Select multiple expense to create an invoice, and process it. +- New invoice will be create and link to the selected expense lines. +- Validate newly create invoice. +- On paying expense sheet, you are reconciling supplier invoice(s) too. diff --git a/hr_expense_invoice/static/description/icon.png b/hr_expense_invoice/static/description/icon.png new file mode 100644 index 000000000..8e5a7f402 Binary files /dev/null and b/hr_expense_invoice/static/description/icon.png differ diff --git a/hr_expense_invoice/static/description/index.html b/hr_expense_invoice/static/description/index.html new file mode 100644 index 000000000..a7956c083 --- /dev/null +++ b/hr_expense_invoice/static/description/index.html @@ -0,0 +1,473 @@ + + + + + +Supplier invoices on HR expenses + + + +
+ + + +Odoo Community Association + +
+

Supplier invoices on HR expenses

+ +

Beta License: AGPL-3 OCA/hr-expense Translate me on Weblate Try me on Runboat

+

This module lets you link an existing posted vendor bill to an employee +expense, so the bill stays the accounting document for that expense +instead of an auto-generated receipt. Use it when an employee paid a +supplier invoice and you want the original bill to remain the source of +truth. When the expense is posted, the module books an entry that +transfers the debt from the bill’s vendor to the employee, and the +expense is settled once the bill is paid.

+

Table of contents

+ +
+

Usage

+

Reference one invoice to an expense

+
    +
  • Create an expense sheet.
  • +
  • Add an expense line to sheet with an invoice_id selected or create one +new.
  • +
  • Process expense sheet.
  • +
  • On paying expense sheet, you are reconciling supplier invoice too.
  • +
+

Create one invoice to multiple expenses

+
    +
  • Create an expense sheet with one or multiple expense lines
  • +
  • After approved, click button “Create Vendor Bill”
  • +
  • Select multiple expense to create an invoice, and process it.
  • +
  • New invoice will be create and link to the selected expense lines.
  • +
  • Validate newly create invoice.
  • +
  • On paying expense sheet, you are reconciling supplier invoice(s) too.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Multiple payment terms for a supplier invoice are not handled +correctly.
  • +
  • Partial reconcile supplier invoices are also not correctly handled.
  • +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

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.

+

This module is part of the OCA/hr-expense project on GitHub.

+

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

+
+
+
+
+ + diff --git a/hr_expense_invoice/tests/__init__.py b/hr_expense_invoice/tests/__init__.py new file mode 100644 index 000000000..571c2e78e --- /dev/null +++ b/hr_expense_invoice/tests/__init__.py @@ -0,0 +1 @@ +from . import test_hr_expense_invoice diff --git a/hr_expense_invoice/tests/test_hr_expense_invoice.py b/hr_expense_invoice/tests/test_hr_expense_invoice.py new file mode 100644 index 000000000..54ccfabcd --- /dev/null +++ b/hr_expense_invoice/tests/test_hr_expense_invoice.py @@ -0,0 +1,67 @@ +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2021 Tecnativa - Pedro M. Baeza +# Copyright 2021-2023 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.exceptions import UserError +from odoo.tests import tagged + +from odoo.addons.hr_expense.tests.common import TestExpenseCommon + + +@tagged("post_install", "-at_install") +class TestHrExpenseInvoice(TestExpenseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company_data["company"].account_sale_tax_id = False + cls.company_data["company"].account_purchase_tax_id = False + cls.product_a.supplier_taxes_id = False + cls.invoice = cls.init_invoice( + "in_invoice", + products=[cls.product_a], + ) + cls.invoice.invoice_line_ids.price_unit = 100 + cls.invoice.invoice_line_ids.tax_ids = False + cls.invoice.action_post() + cls.expense = cls.create_expenses( + { + "payment_mode": "own_account", + "product_id": cls.product_a.id, + "total_amount_currency": 100.0, + "invoice_id": cls.invoice.id, + } + ) + + def test_invoice_back_reference(self): + """account.move.invoice_expense_ids exposes the linked expenses.""" + self.assertIn(self.expense, self.invoice.invoice_expense_ids) + + def test_action_expense_create_invoice(self): + """action_expense_create_invoice creates a posted bill and links it.""" + expense = self.create_expenses( + { + "payment_mode": "own_account", + "product_id": self.product_a.id, + "total_amount_currency": 50.0, + } + ) + expense.action_expense_create_invoice() + self.assertTrue(expense.invoice_id) + self.assertEqual(expense.invoice_id.move_type, "in_invoice") + + def test_amount_mismatch_raises(self): + """_validate_expense_invoice catches bill-vs-expense amount drift.""" + self.expense.sudo().write({"total_amount_currency": 999.0}) + with self.assertRaises(UserError): + self.expense._validate_expense_invoice() + + def test_action_post_creates_transfer_entry(self): + """For own_account bill-linked expenses, action_post creates an AP + transfer entry instead of a receipt.""" + self.expense.action_submit() + if self.expense.state == "submitted": + self.expense.action_approve() + self.expense.action_post() + self.assertTrue(self.expense.transfer_move_ids) + self.assertEqual(self.expense.transfer_move_ids.move_type, "entry") diff --git a/hr_expense_invoice/views/account_move_views.xml b/hr_expense_invoice/views/account_move_views.xml new file mode 100644 index 000000000..2a1be1faf --- /dev/null +++ b/hr_expense_invoice/views/account_move_views.xml @@ -0,0 +1,23 @@ + + + + account.move.form - Add invoice-expense smart-button + account.move + + +
+ + +
+
+
+
diff --git a/hr_expense_invoice/views/hr_expense_views.xml b/hr_expense_invoice/views/hr_expense_views.xml new file mode 100644 index 000000000..9ada5c6f6 --- /dev/null +++ b/hr_expense_invoice/views/hr_expense_views.xml @@ -0,0 +1,82 @@ + + + + hr.expense.form + hr.expense + + + + 1 + + + + + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + 1 + + + + + + + + + + + + + + + + + +