Skip to content
Open
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
144 changes: 144 additions & 0 deletions account_analytic_distribution_model_recalculate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
===============================================
Account Analytic Distribution Model Recalculate
===============================================

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

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

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

This module allows you to regenerate the analytic distribution of the
journal items, that were generated by the distribution model.

It adds the posibility to add a Start Date and End Date for the
distribution models too.

**Table of contents**

.. contents::
:local:

Usage
=====

1. **Navigate to Analytic Distribution Models**

- Go to Invoicing -> Configuration -> Analytic Distribution Models.

2. **Create or Edit a Distribution Model**

- Create a new distribution model or edit an existing one.
- Set the **Start Date** and **End Date** to define the active period
for the distribution. Only distributions within this date range will
be applied.
- Define filters such as **Partner** and **Account Prefix** to control
when the model should apply.

3. **Create an Invoice or Vendor Bill**

- Select a customer and an account that match the conditions set in the
distribution model.
- If the invoice has a date, the system will use it to filter
applicable distribution models; otherwise, it will use the current
date.

4. **Use the Recalculate Function**

- Go to **Analytic Distribution Models**.
- Enable the **Recalculate** option on the model you want to update.
- Modify the analytic distribution as needed.
- Click the **Recalculate** button. (Partner and account prefix needs
to be set)
- All journal items originally updated using this model, and still
within its date range and matching its criteria, will be
recalculated, using the current distribution of the model.

**Sync Distribution Models with Journal Items**
-----------------------------------------------

You can use the **Sync** button to associate all journal items that
match the distribution model's criteria.

This is especially useful in the following cases:

- Journal items were created **before** the distribution model existed.
- The model has been **updated or changed**, and you want to reassign
journal items accordingly.
- You need to **sync lines** from other entries that now match the
model's conditions.

By syncing, the system will disassociate any previous links and reassign
journal items based on the current configuration of the distribution
model.

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

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

* APSL-Nagarro
* Bernat Obrador

Contributors
------------

- APSL - Nagarro <https://apsl.tech>

- Bernat Obrador

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

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

|maintainer-BernatObrador|

This module is part of the `OCA/account-analytic <https://github.com/OCA/account-analytic/tree/16.0/account_analytic_distribution_model_recalculate>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions account_analytic_distribution_model_recalculate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 (APSL-Nagarro) - Bernat Obrador
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Account Analytic Distribution Model Recalculate",
"summary": """Add the posibility to change the analytic distribution of the journal
items assigned by the distribution model""",
"version": "16.0.1.0.1",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA), APSL-Nagarro, Bernat Obrador",
"website": "https://github.com/OCA/account-analytic",
"maintainers": ["BernatObrador"],
"depends": [
"account",
"analytic",
],
"data": [
"views/account_analytic_distribution_model.xml",
"views/account_move_line.xml",
],
"installable": True,
"application": False,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_analytic_distribution_model_recalculate
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \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_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "%s analytic lines have been recalculated."
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model,name:account_analytic_distribution_model_recalculate.model_account_analytic_distribution_model
msgid "Analytic Distribution Model"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "Cannot have overlapping dates for the same partner and account prefix."
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model.fields,field_description:account_analytic_distribution_model_recalculate.field_account_move_line__distribution_model_id
msgid "Distribution Model"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model.fields,field_description:account_analytic_distribution_model_recalculate.field_account_analytic_distribution_model__end_date
msgid "End Date"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model_terms:ir.ui.view,arch_db:account_analytic_distribution_model_recalculate.inherit_account_analytic_distribution_model_form_view
msgid "Filter Dates"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model.fields,help:account_analytic_distribution_model_recalculate.field_account_analytic_distribution_model__recalculate
msgid ""
"If checked, you will be able to recalculate\n"
" the analytic lines that where created by this model,\n"
" and still matches the model criteria"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model,name:account_analytic_distribution_model_recalculate.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "No analytic lines have been recalculated."
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model.fields,field_description:account_analytic_distribution_model_recalculate.field_account_analytic_distribution_model__recalculate
#: model_terms:ir.ui.view,arch_db:account_analytic_distribution_model_recalculate.inherit_account_analytic_distribution_model_tree_view
msgid "Recalculate"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.actions.server,name:account_analytic_distribution_model_recalculate.action_recalculate_analytic_distribution
msgid "Recalculate Analytic Lines"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "Recalculation Complete"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model:ir.model.fields,field_description:account_analytic_distribution_model_recalculate.field_account_analytic_distribution_model__start_date
msgid "Start Date"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model_terms:ir.ui.view,arch_db:account_analytic_distribution_model_recalculate.inherit_account_analytic_distribution_model_tree_view
msgid "Sync"
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#: model_terms:ir.ui.view,arch_db:account_analytic_distribution_model_recalculate.inherit_account_analytic_distribution_model_tree_view
msgid ""
"Sync the journal items with the analytic distribution model. Used to sync "
"lines that were generated before the model was created."
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "The start date cannot be later than the end date."
msgstr ""

#. module: account_analytic_distribution_model_recalculate
#. odoo-python
#: code:addons/account_analytic_distribution_model_recalculate/models/account_analytic_distribution_model.py:0
#, python-format
msgid "You must select a partner and account prefix to recalculate lines."
msgstr ""
Loading
Loading