-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] l10n_it_split_payment: Migration to 16.0
- Loading branch information
Showing
16 changed files
with
214 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
33
l10n_it_split_payment/migrations/14.0.1.0.0/post-migration.py
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
l10n_it_split_payment/migrations/14.0.1.0.0/pre-move_split_amount.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 |
Oops, something went wrong.