-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] account_move_line_related_taxes_amount:
- Loading branch information
Berezi
committed
Jan 21, 2025
1 parent
fea1f23
commit 15e9eae
Showing
10 changed files
with
153 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
====================================== | ||
Account move line related taxes amount | ||
====================================== | ||
|
||
* Field in account move line that calculates the account credit amount. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Berezi Amubieta <[email protected]> | ||
* Ana Juaristi <[email protected]> | ||
|
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 @@ | ||
from . import models |
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,17 @@ | ||
# Copyright 2024 Berezi Amubieta - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Account Move Line Related Taxes Amount", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"account", | ||
], | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"category": "Accounting", | ||
"data": [ | ||
"views/account_move_view.xml", | ||
], | ||
"installable": True, | ||
} |
26 changes: 26 additions & 0 deletions
26
account_move_line_related_taxes_amount/i18n/account_move_line_related_taxes_amount.pot
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,26 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_move_line_related_taxes_amount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2025-01-21 12:16+0000\n" | ||
"PO-Revision-Date: 2025-01-21 12:16+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: account_move_line_related_taxes_amount | ||
#: model:ir.model,name:account_move_line_related_taxes_amount.model_account_move_line | ||
msgid "Journal Item" | ||
msgstr "" | ||
|
||
#. module: account_move_line_related_taxes_amount | ||
#: model:ir.model.fields,field_description:account_move_line_related_taxes_amount.field_account_move_line__related_taxes_amount | ||
msgid "Related Taxes Amount" | ||
msgstr "" |
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,26 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_move_line_related_taxes_amount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2025-01-21 12:16+0000\n" | ||
"PO-Revision-Date: 2025-01-21 12:16+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: account_move_line_related_taxes_amount | ||
#: model:ir.model,name:account_move_line_related_taxes_amount.model_account_move_line | ||
msgid "Journal Item" | ||
msgstr "Apunte contable" | ||
|
||
#. module: account_move_line_related_taxes_amount | ||
#: model:ir.model.fields,field_description:account_move_line_related_taxes_amount.field_account_move_line__related_taxes_amount | ||
msgid "Related Taxes Amount" | ||
msgstr "Saldo cuenta" |
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 @@ | ||
from . import account_move_line |
34 changes: 34 additions & 0 deletions
34
account_move_line_related_taxes_amount/models/account_move_line.py
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,34 @@ | ||
# Copyright 2024 Berezi Amubieta - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = "account.move.line" | ||
|
||
related_taxes_amount = fields.Float( | ||
compute="_compute_related_taxes_amount", | ||
) | ||
|
||
@api.depends( | ||
"account_id", | ||
"account_id.related_taxes_amount", | ||
"debit", | ||
"credit", | ||
"move_id.invoice_line_ids", | ||
"move_id.invoice_line_ids.credit", | ||
"move_id.invoice_line_ids.account_id", | ||
) | ||
def _compute_related_taxes_amount(self): | ||
for line in self: | ||
amount = 0 | ||
if line.account_id: | ||
amount = line.account_id.related_taxes_amount | ||
debit = line.debit | ||
same_account_lines = line.move_id.invoice_line_ids.filtered( | ||
lambda c: c.account_id == line.account_id | ||
) | ||
credit = sum(same_account_lines.mapped("credit")) | ||
amount = amount - debit - credit | ||
line.related_taxes_amount = amount |
12 changes: 12 additions & 0 deletions
12
account_move_line_related_taxes_amount/views/account_move_view.xml
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="view_move_form" model="ir.ui.view"> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_move_form" /> | ||
<field name="arch" type="xml"> | ||
<button name="action_automatic_entry" position="before"> | ||
<field name="related_taxes_amount" optional="show" /> | ||
</button> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
...account_move_line_related_taxes_amount/odoo/addons/account_move_line_related_taxes_amount
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 @@ | ||
../../../../account_move_line_related_taxes_amount |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |