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][MIG] account_tax_balance: Migration to 16.0 #937

Merged
merged 65 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
4c88180
[ADD] account_tax_balance: Compute tax balances based on date range
eLBati Apr 28, 2016
10384e3
tests
gfcapalbo Apr 29, 2016
473c54e
[FIX+IMP] account_tax_balance:
eLBati Apr 29, 2016
2bdeb1f
Consider normal and refund operations separately
antespi Oct 21, 2016
e5f5ff2
[MIG] account_tax_balance 10.0
sbidoul Nov 19, 2016
6a8cc2b
[FIX+IMP] account_tax_balance:
eLBati Jan 18, 2017
b9cdcc3
[FIX] Include tax amounts from all move types
StefanRijnhart Mar 16, 2017
b604ac4
[IMP] account_tax_balance: performance
sbidoul Mar 24, 2017
c41b939
[IMP] account_tax_balance: faster search of taxes with moves
sbidoul Mar 26, 2017
4f70e6d
account_tax_balance: improve test coverage
sbidoul Apr 3, 2017
d611bca
add condition tax_exigible in domain variable
May 25, 2017
508801e
[IMP] account_tax_balance: add index
sbidoul Aug 30, 2017
94fcd31
[MIG] account_tax_balance: Migration to 11.0
pedrobaeza Oct 18, 2017
f5ebe29
dynamize general ledger
JordiBForgeFlow Dec 1, 2017
fd9c2d1
[IMP] account_tax_balance: Change tests to post instal and protect ag…
pedrobaeza Mar 9, 2018
d868839
utf-8 remove from .py files
HviorForgeFlow Mar 27, 2018
3fe77f1
Translated using Weblate (Italian)
dcorio Jun 18, 2018
ee4f91b
Translated using Weblate (Spanish)
jimmybanegas Sep 24, 2018
c1448a0
[12.0][MIG] account_tax_balance
astirpe Oct 1, 2018
72e78c7
[FIX] at_install/post_install test decorators
astirpe Oct 7, 2018
92d1ac2
Translated using Weblate (Dutch)
JordyBlankestijn Nov 1, 2018
85652a3
Translated using Weblate (Italian)
primes2h Dec 23, 2018
598e765
Update translation files
oca-transbot Dec 29, 2018
effc9b0
Translated using Weblate (Italian)
primes2h Dec 29, 2018
ea24325
Translated using Weblate (Spanish)
mvrodriguez Feb 4, 2019
39672c9
Translated using Weblate (French)
BECJIE32 May 1, 2019
9563457
[IMP] account_tax_balance: Ensure test correctness
pedrobaeza May 8, 2019
25337e1
[IMP] account_tax_balance: Ensure test correctness (2)
pedrobaeza May 8, 2019
e63ba7b
[IMP] tax_balance: breadcrumb name (#548)
bealdav May 22, 2019
bb3c1fa
Translated using Weblate (Catalan)
May 27, 2019
7743d34
Translated using Weblate (Spanish)
josepmy Jul 22, 2019
62cca3c
[IMP] Ease extension if multicompany fiscal unit
astirpe Sep 16, 2019
25387c2
[13.0][MIG] account_tax_balance
astirpe Sep 30, 2019
5b2d24f
Convert onchange to computed
astirpe Sep 30, 2019
e73ac97
Code review
astirpe Oct 1, 2019
fb96814
Black, isort, etc...
astirpe Oct 28, 2019
bd8aa0b
[ADD] Prefill move_type
StefanRijnhart Jan 3, 2020
87d99ed
[RFR] Apply a mapping instead of separate queries
pedrobaeza Feb 4, 2020
0cb3ea0
[FIX] select company in multicompany
astirpe Feb 26, 2020
711fedf
Added translation using Weblate (Spanish (Argentina))
ibuioli Aug 9, 2020
3c28e02
Translated using Weblate (Spanish (Argentina))
ibuioli Aug 9, 2020
7121003
Translated using Weblate (Romanian)
dhongu Sep 23, 2020
c0a0291
[IMP] account_tax_balance: black, isort, prettier
ozono Oct 22, 2020
700335e
[MIG] account_tax_balance: Migration to 14.0
ozono Oct 23, 2020
aa6cc81
[FIX] account_tax_balance: Fix tests
joao-p-marques Mar 1, 2021
9975015
Added translation using Weblate (French (France))
Yvesldff Apr 10, 2021
10e2cd5
Translated using Weblate (French (France))
Yvesldff Apr 10, 2021
62e6677
[FIX] account_tax_balance: Remove unnecessary text from button
joao-p-marques May 17, 2021
ebbe3c4
Manage renamed move_type column
SimoRubi Apr 16, 2021
4c83453
Translated using Weblate (Portuguese)
pedrocs-exo Jul 2, 2021
a36051c
[IMP] account_tax_balance: use rename_fields instead of rename_columns
MiquelRForgeFlow Oct 4, 2021
6ea25e8
account_tax_balance: change development_status to Production/Stable
tafaRU Oct 21, 2021
5201370
[FIX] account_tax_balance: Fixed translation of the financial type fi…
Oct 20, 2021
7e31c28
Translated using Weblate (Spanish (Argentina))
ibuioli Nov 8, 2021
12722d9
Translated using Weblate (Italian)
francesco-ooops Dec 3, 2021
e5fd247
[14.0][FIX] account_tax_balance: init hook refund confusion
StefanRijnhart Mar 30, 2021
37a257f
[IMP] account_tax_balance: black, isort, prettier
ValentinVinagre Dec 10, 2021
491f421
[MIG] account_tax_balance: Migration to 15.0
ValentinVinagre Dec 10, 2021
104eb38
[UPD] Update account_tax_balance.pot
Dec 22, 2021
274da45
[FIX] account_tax_balance: Fix development_status
ValentinVinagre Dec 28, 2021
7509184
[FIX] account_tax_balance: Recompute balance for different dates
SimoRubi Dec 9, 2021
270c51d
[FIX] account_tax_balance: delete obsolete migration
mariadforgeflow Feb 4, 2022
07fb3f8
[FIX] account_tax_balance: run test after install
LoisRForgeFlow Jul 20, 2022
cd56144
[IMP] account_tax_balance: pre-commit stuff
ramiadavid Oct 27, 2022
6ad3e20
[MIG] account_tax_balance: Migration to 16.0
ramiadavid Oct 27, 2022
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
96 changes: 96 additions & 0 deletions account_tax_balance/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
===========
Tax Balance
===========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Faccount--financial--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-reporting/tree/15.0/account_tax_balance
:alt: OCA/account-financial-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-account_tax_balance
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/91/15.0
:alt: Try me on Runbot

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

This module allows to compute tax balances within a certain date range.
It depends on date_range module and exposes 'compute' methods that can be called by other modules
(like localization ones).

**Table of contents**

.. contents::
:local:

Usage
=====

Accounting --> Reporting --> Taxes Balance

Select the company, the date range, the target moves and 'open taxes'

.. figure:: https://raw.githubusercontent.com/account_tax_balance/static/description/tax_balance.png

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/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/account-financial-reporting/issues/new?body=module:%20account_tax_balance%0Aversion:%2015.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
~~~~~~~

* Agile Business Group
* Therp BV
* Tecnativa
* ACSONE SA/NV

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

* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Giovanni Capalbo <giovanni@therp.nl>
* Tecnativa - Antonio Espinosa
* Tecnativa - Pedro M. Baeza
* ACSONE SA/NV - Stéphane Bidoul
* Andrea Stirpe <a.stirpe@onestein.nl>
* Iván Antón <ozono@ozonomultimedia.com>
* `Sygel <https://www.sygel.es>`__:

* Valentin Vinagre

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/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/15.0/account_tax_balance>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions account_tax_balance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizard
from .hooks import pre_init_hook
26 changes: 26 additions & 0 deletions account_tax_balance/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2016 Lorenzo Battistini - Agile Business Group
# Copyright 2016 Tecnativa - Antonio Espinosa
# Copyright 2016 ACSONE SA/NV - Stéphane Bidoul
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Tax Balance",
"summary": "Compute tax balances based on date range",
"version": "16.0.1.0.0",
"development_status": "Mature",
"category": "Invoices & Payments",
"website": "https://github.com/OCA/account-financial-reporting",
"author": "Agile Business Group, Therp BV, Tecnativa, ACSONE SA/NV, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["account", "date_range"],
"data": [
"wizard/open_tax_balances_view.xml",
"views/account_move_view.xml",
"views/account_tax_view.xml",
"security/ir.model.access.csv",
],
"images": ["images/tax_balance.png"],
"pre_init_hook": "pre_init_hook",
}
47 changes: 47 additions & 0 deletions account_tax_balance/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2020 Opener B.V. <https://opener.amsterdam>
# Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging

from psycopg2 import sql


def pre_init_hook(cr):
"""Precreate financial_type and fill with appropriate values to prevent
a MemoryError when the ORM attempts to call its compute method on a large
amount of preexisting moves. Note that the order of the mapping is
important as one move can have move lines on accounts of multiple types
and the move type is set in the order of precedence."""
logger = logging.getLogger(__name__)
logger.info("Add account_move.financial_type column if it does not yet exist")
cr.execute(
"ALTER TABLE account_move ADD COLUMN IF NOT EXISTS financial_type VARCHAR"
)
MAPPING = [
("liquidity", "asset_cash", False),
("liquidity", "liability_credit_card", False),
("payable", "liability_payable", "AND aml.balance < 0"),
("payable_refund", "liability_payable", "AND aml.balance >= 0"),
("receivable", "asset_receivable", "AND aml.balance > 0"),
("receivable_refund", "asset_receivable", "AND aml.balance <= 0"),
("other", False, False),
]
for financial_type, account_type, extra_where in MAPPING:
args = [financial_type]
query = sql.SQL("UPDATE account_move am SET financial_type = %s")
if account_type:
query += sql.SQL(
"""FROM account_move_line aml
WHERE aml.account_id IN (
SELECT id FROM account_account
WHERE account_type = %s)
AND aml.move_id = am.id AND am.financial_type IS NULL
"""
)
args.append(account_type)
else:
query += sql.SQL("WHERE am.financial_type IS NULL")
if extra_where:
query += sql.SQL(extra_where)
cr.execute(query, tuple(args))
logger.info("%s move set to type %s", financial_type, cr.rowcount)
Loading