Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] l10n_fr_account_vat_return_einvoice_generate #595

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions l10n_fr_account_vat_return_einvoice_generate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
===================================================
Adapt e-invoice generation to France VAT on payment
===================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b0698c1b605ebfa93ede27d3b65fdac8fad7d91757113e61c4e29b343473d8a9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |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/16.0/l10n_fr_account_vat_return_einvoice_generate
: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-16-0/l10n-france-16-0-l10n_fr_account_vat_return_einvoice_generate
: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=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This is a glue module between **l10n_fr_account_vat_return** and **account_einvoice_generate**.

When this module is installed, Odoo will set the UNECE Due Date Type Code for tax exigibility in the invoice's XML file from the boolean field **out_vat_on_payment** of the invoice (field added by the module *l10n_fr_account_vat_return*) instead of the native field **tax_exigibility** of the tax.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-france/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 <https://github.com/OCA/l10n-france/issues/new?body=module:%20l10n_fr_account_vat_return_einvoice_generate%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

* Alexis de Lattre <alexis.delattre@akretion.com>

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-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/l10n-france <https://github.com/OCA/l10n-france/tree/16.0/l10n_fr_account_vat_return_einvoice_generate>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions l10n_fr_account_vat_return_einvoice_generate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions l10n_fr_account_vat_return_einvoice_generate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Adapt e-invoice generation to France VAT on payment",
"version": "16.0.1.0.0",
"category": "Accounting",
"license": "AGPL-3",
"summary": "Glue module between account_einvoice_generate and l10n_fr_account_vat_return",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/l10n-france",
"depends": ["account_einvoice_generate", "l10n_fr_account_vat_return"],
"installable": True,
"auto_install": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def _get_unece_due_date_type_code(self):
# inherit method from account_einvoice_generate => move to
if self.move_type in ("out_invoice", "out_refund"):
if self.out_vat_on_payment:
tax_exigibility = "on_payment"

Check warning on line 15 in l10n_fr_account_vat_return_einvoice_generate/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_account_vat_return_einvoice_generate/models/account_move.py#L15

Added line #L15 was not covered by tests
else:
tax_exigibility = "on_invoice"
return self.env["account.tax"]._get_unece_code_from_tax_exigibility(

Check warning on line 18 in l10n_fr_account_vat_return_einvoice_generate/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_account_vat_return_einvoice_generate/models/account_move.py#L17-L18

Added lines #L17 - L18 were not covered by tests
tax_exigibility
)
return super()._get_unece_due_date_type_code()

Check warning on line 21 in l10n_fr_account_vat_return_einvoice_generate/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_account_vat_return_einvoice_generate/models/account_move.py#L21

Added line #L21 was not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Alexis de Lattre <alexis.delattre@akretion.com>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a glue module between **l10n_fr_account_vat_return** and **account_einvoice_generate**.

When this module is installed, Odoo will set the UNECE Due Date Type Code for tax exigibility in the invoice's XML file from the boolean field **out_vat_on_payment** of the invoice (field added by the module *l10n_fr_account_vat_return*) instead of the native field **tax_exigibility** of the tax.
Loading
Loading