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] account_reconcile_analytic_tag: New module #758

Merged
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 account_reconcile_analytic_tag/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=======================================
Analytic tags in account reconciliation
=======================================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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--reconcile-lightgray.png?logo=github
:target: https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_analytic_tag
:alt: OCA/account-reconcile
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_reconcile_analytic_tag
: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/account-reconcile&target_branch=16.0
:alt: Try me on Runboat

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

This module adds the analytical tags to the bank reconciliation.

**Table of contents**

.. contents::
:local:

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

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

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez
* Pedro M. Baeza

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

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

|maintainer-victoralmau|

This module is part of the `OCA/account-reconcile <https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_analytic_tag>`_ 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 account_reconcile_analytic_tag/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions account_reconcile_analytic_tag/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Analytic tags in account reconciliation",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-reconcile",
"version": "16.0.1.0.0",
"depends": ["account_reconcile_oca", "account_analytic_tag"],
"license": "AGPL-3",
"category": "Accounting",
"installable": True,
"maintainers": ["victoralmau"],
"data": [
"views/account_bank_statement_line_views.xml",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_reconcile_analytic_tag
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-26 15:08+0000\n"
"PO-Revision-Date: 2024-11-26 15:08+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_reconcile_analytic_tag
#: model:ir.model,name:account_reconcile_analytic_tag.model_account_reconcile_abstract
msgid "Account Reconcile Abstract"
msgstr ""

#. module: account_reconcile_analytic_tag
#: model:ir.model.fields,field_description:account_reconcile_analytic_tag.field_account_bank_statement_line__manual_analytic_tag_ids
msgid "Analytic Tags"
msgstr ""

#. module: account_reconcile_analytic_tag
#: model:ir.model,name:account_reconcile_analytic_tag.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr ""
33 changes: 33 additions & 0 deletions account_reconcile_analytic_tag/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_reconcile_analytic_tag
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-26 15:08+0000\n"
"PO-Revision-Date: 2024-11-26 16:08+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: account_reconcile_analytic_tag
#: model:ir.model,name:account_reconcile_analytic_tag.model_account_reconcile_abstract
msgid "Account Reconcile Abstract"
msgstr "Resumen de conciliación de cuenta"

#. module: account_reconcile_analytic_tag
#: model:ir.model.fields,field_description:account_reconcile_analytic_tag.field_account_bank_statement_line__manual_analytic_tag_ids
msgid "Analytic Tags"
msgstr "Etiquetas analíticas"

#. module: account_reconcile_analytic_tag
#: model:ir.model,name:account_reconcile_analytic_tag.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr "Línea de extracto bancario"
3 changes: 3 additions & 0 deletions account_reconcile_analytic_tag/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import account_reconcile_abstract
from . import account_bank_statement_line
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import api, fields, models


class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"

manual_analytic_tag_ids = fields.Many2many(
comodel_name="account.analytic.tag",
string="Analytic Tags",
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",
)

def _get_manual_delete_vals(self):
vals = super()._get_manual_delete_vals()
vals["manual_analytic_tag_ids"] = False
return vals

def _process_manual_reconcile_from_line(self, line):
res = super()._process_manual_reconcile_from_line(line)
self.manual_analytic_tag_ids = line.get("manual_analytic_tag_ids")
return res

def _get_manual_reconcile_vals(self):
vals = super()._get_manual_reconcile_vals()
vals["manual_analytic_tag_ids"] = [(6, 0, self.manual_analytic_tag_ids.ids)]
return vals

@api.onchange("manual_analytic_tag_ids")
def _onchange_analytic_tag_ids(self):
return super()._onchange_manual_reconcile_vals()

def _reconcile_move_line_vals(self, line, move_id=False):
vals = super()._reconcile_move_line_vals(line=line, move_id=move_id)
vals["analytic_tag_ids"] = line.get("manual_analytic_tag_ids")
return vals
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import models


class AccountReconcileAbstract(models.AbstractModel):
_inherit = "account.reconcile.abstract"

def _get_reconcile_line(
self, line, kind, is_counterpart=False, max_amount=False, from_unreconcile=False
):
vals = super()._get_reconcile_line(
line=line,
kind=kind,
is_counterpart=is_counterpart,
max_amount=max_amount,
from_unreconcile=from_unreconcile,
)
vals[0]["manual_analytic_tag_ids"] = [(6, 0, line.analytic_tag_ids.ids)]
return vals
3 changes: 3 additions & 0 deletions account_reconcile_analytic_tag/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Víctor Martínez
* Pedro M. Baeza
1 change: 1 addition & 0 deletions account_reconcile_analytic_tag/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds the analytical tags to the bank reconciliation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading