Skip to content

Commit

Permalink
[MIG] l10n_it_split_payment: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed Sep 25, 2023
1 parent ed43483 commit b55d19d
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 276 deletions.
22 changes: 11 additions & 11 deletions l10n_it_split_payment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ ITA - Scissione pagamenti
: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--italy-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_split_payment
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_split_payment
:alt: OCA/l10n-italy
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_split_payment
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_split_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/122/14.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/l10n-italy&target_branch=16.0
:alt: Try me on Runboat

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

Expand Down Expand Up @@ -57,7 +57,7 @@ To configure this module, you need to:

* go to Accounting → Configuration → Settings and configure 'Split Payment Write-off account' (like 'IVA n/debito sospesa SP'). Write-off account should be different from standard debit VAT, in order to separately add it in VAT statement.

.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/14.0/l10n_it_split_payment/static/settings.png
.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/16.0/l10n_it_split_payment/static/settings.png
:alt: Configuration
:width: 600 px

Expand All @@ -72,11 +72,11 @@ To configure this module, you need to:
* add a new tax (Accounting → Configuration → Accounting → Taxes). IVA al 22% SPL should be configured like the following:


.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/14.0/l10n_it_split_payment/static/SP.png
.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/16.0/l10n_it_split_payment/static/SP.png
:alt: 22SPL
:width: 600 px

.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/14.0/l10n_it_split_payment/static/SP2.png
.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/16.0/l10n_it_split_payment/static/SP2.png
:alt: 22SPL
:width: 600 px

Expand All @@ -91,7 +91,7 @@ To configure this module, you need to:
* configure the fiscal position (Accounting → Configuration → Accounting → Fiscal Positions) used for split payment, setting 'Split Payment' flag. In fiscal position, map standard VAT with SP VAT, like the following:


.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/14.0/l10n_it_split_payment/static/fiscal_position.png
.. figure:: https://raw.githubusercontent.com/OCA/l10n-italy/16.0/l10n_it_split_payment/static/fiscal_position.png
:alt: Fiscal position
:width: 600 px

Expand All @@ -112,7 +112,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_split_payment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_split_payment%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.

Expand Down Expand Up @@ -153,6 +153,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion l10n_it_split_payment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "ITA - Scissione pagamenti",
"version": "14.0.1.0.7",
"version": "16.0.1.0.0",
"category": "Localization/Italy",
"summary": "Scissione pagamenti",
"author": "Abstract, Agile Business Group, Odoo Community Association (OCA)",
Expand All @@ -16,6 +16,7 @@
"account",
],
"data": [
"data/account_tax_group_data.xml",
"views/account_view.xml",
"views/config_view.xml",
],
Expand Down
9 changes: 9 additions & 0 deletions l10n_it_split_payment/data/account_tax_group_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">

<record id="tax_group_split_payment" model="account.tax.group">
<field name="name">Split Payment</field>
<field name="country_id" ref="base.it" />
</record>

</odoo>
33 changes: 0 additions & 33 deletions l10n_it_split_payment/migrations/14.0.1.0.0/post-migration.py

This file was deleted.

This file was deleted.

6 changes: 5 additions & 1 deletion l10n_it_split_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Copyright 2015 Davide Corio <davide.corio@abstract.it>
# Copyright 2015 Lorenzo Battistini - Agile Business Group
# Copyright 2016 Alessio Gerace - Agile Business Group
# Copyright 2023 Giuseppe Borruso <gborruso@dinamicheaziendali.it>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account
from . import account_fiscal_position
from . import account_move
from . import account_move_line
from . import company
from . import config
from . import account_tax
167 changes: 0 additions & 167 deletions l10n_it_split_payment/models/account.py

This file was deleted.

13 changes: 13 additions & 0 deletions l10n_it_split_payment/models/account_fiscal_position.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2015 Davide Corio <davide.corio@abstract.it>
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# Copyright 2016 Alessio Gerace - Agile Business Group
# Copyright 2023 Giuseppe Borruso <gborruso@dinamicheaziendali.it>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountFiscalPosition(models.Model):
_inherit = "account.fiscal.position"

split_payment = fields.Boolean()
42 changes: 42 additions & 0 deletions l10n_it_split_payment/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2015 Davide Corio <davide.corio@abstract.it>
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# Copyright 2016 Alessio Gerace - Agile Business Group
# Copyright 2023 Giuseppe Borruso <gborruso@dinamicheaziendali.it>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


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

amount_sp = fields.Float(
string="Split Payment",
digits="Account",
store=True,
readonly=True,
compute="_compute_amount",
)
split_payment = fields.Boolean(
string="Is Split Payment", related="fiscal_position_id.split_payment"
)

def _compute_amount(self):
res = super()._compute_amount()
for move in self:
if move.split_payment:
if move.is_purchase_document():
continue

Check warning on line 29 in l10n_it_split_payment/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_split_payment/models/account_move.py#L29

Added line #L29 was not covered by tests
if move.tax_totals:
move.amount_sp = (
move.tax_totals["amount_total"]
- move.tax_totals["amount_untaxed"]
)
move.amount_residual -= move.amount_tax
move.amount_tax = 0.0
else:
move.amount_sp = 0.0
move.amount_total = move.amount_untaxed
else:
move.amount_sp = 0.0
return res
Loading

0 comments on commit b55d19d

Please sign in to comment.