Skip to content

Commit

Permalink
TA#72185 [16.0][MIG] project_task_analytic_lines (#513)
Browse files Browse the repository at this point in the history
* Init module in 16.0 from 14.0

* TA#72185 [16.0][MIG] project_task_analytic_lines

* Update fr.po

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* [16.0][MIG] project_task_analytic_lines

* TA#72185 [16.0][MIG][CHG] project_task_analytic_lines : account_analytic_line

* TA#72185 [16.0][MIG][CHG] project_task_analytic_lines : account_move_line

* Minor changes

* Update account_move_line_views.xml

---------

Co-authored-by: Lanto R. <124650562+lanto-razafindrabe@users.noreply.github.com>
Co-authored-by: Rivo Lalaina <rivo2302@gmail.com>
  • Loading branch information
3 people authored Feb 17, 2025
1 parent 43c5da3 commit 0978126
Show file tree
Hide file tree
Showing 33 changed files with 920 additions and 5 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"project_remaining_hours_update",
"project_stage_allow_timesheet",
"project_stage_no_quick_create",
"project_task_analytic_lines",
"project_task_date_planned",
"project_task_deadline_from_project",
"project_task_description_template",
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ COPY project_milestone_spent_hours /mnt/extra-addons/project_milestone_spent_hou
COPY project_milestone_time_kpi /mnt/extra-addons/project_milestone_time_kpi
COPY project_no_quick_create /mnt/extra-addons/project_no_quick_create
COPY project_parent_enhanced mnt/extra-addons/project_parent_enhanced
COPY project_parent_forecasted_end_date mnt/extra-addons/project_parent_forecasted_end_date
COPY project_parent_type_required mnt/extra-addons/project_parent_type_required
COPY project_parent_forecasted_end_date mnt/extra-addons/project_parent_forecasted_end_date
COPY project_parent_type_required mnt/extra-addons/project_parent_type_required
COPY project_portal_hide_timesheets mnt/extra-addons/project_portal_hide_timesheets
COPY project_portal_parent_task mnt/extra-addons/project_portal_parent_task
COPY project_portal_parent_task mnt/extra-addons/project_portal_parent_task
COPY project_progress_variance /mnt/extra-addons/project_progress_variance
COPY project_projected_hours mnt/extra-addons/project_projected_hours
COPY project_projected_hours mnt/extra-addons/project_projected_hours
COPY project_remaining_hours_update /mnt/extra-addons/project_remaining_hours_update
COPY project_stage_allow_timesheet mnt/extra-addons/project_stage_allow_timesheet
COPY project_stage_no_quick_create mnt/extra-addons/project_stage_no_quick_create
COPY project_task_analytic_lines /mnt/extra-addons/project_task_analytic_lines
COPY project_task_date_planned /mnt/extra-addons/project_task_date_planned
COPY project_task_deadline_from_project /mnt/extra-addons/project_task_deadline_from_project
COPY project_task_description_template /mnt/extra-addons/project_task_description_template
Expand All @@ -49,4 +50,4 @@ COPY project_track_end_date /mnt/extra-addons/project_track_end_date
COPY project_type_advanced /mnt/extra-addons/project_type_advanced

COPY .docker_files/main /mnt/extra-addons/main
COPY .docker_files/odoo.conf /etc/odoo
COPY .docker_files/odoo.conf /etc/odoo
115 changes: 115 additions & 0 deletions project_task_analytic_lines/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Project Task Analytic Lines
===========================

.. contents:: Table of Contents

Odoo Context
------------
In vanilla Odoo, analytic lines can not be grouped or filtered by task, except for timesheet lines.

Therefore, if you need to generate a cost report, only the timesheet lines will be shown per task.

Summary
-------
This module adds a `Task` field on supplier invoice lines and journal entries.

The task is propagated from invoice lines to journal entries and analytic lines

Then, the analytic lines can be filtered and grouped by task.

Invoices
--------
As member of the group `Accounting / Billing`, on a draft invoice, I find a new field `Task`.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/invoice_form.png

The field is readonly if the analytic account is not filled.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/invoice_task_readonly.png

If an analytic account is selected, I am able to select a task related to project of the analytic account.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/invoice_task_selected.png

I validate the invoice.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/invoice_validated.png

On the journal Items tab, I notice that the task was propagated to the expense line.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/journal_items.png

In the list of analytic lines, I notice that the task was propagated.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/analytic_lines_task.png


List Views Filters
------------------

Analytic Lines
~~~~~~~~~~~~~~
In the list of analytic lines, I see a new field `Task`.

..
A new technical field (origin_task_id) was added because the field task_id
available in vanilla Odoo could not be used.

The field task_id is used by Odoo for timesheet lines.
If task_id was used for any other purpose, some standard functionalities would be broken.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/analytic_lines_origin_task_column.png

I am able to search by task:

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/analytic_lines_search.png

I am able to group by task:

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/analytic_lines_group.png

Journal Items
~~~~~~~~~~~~~
In the list view of journal items, I see a new field `Task`.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/journal_items_task_column.png

I am able to search by task:

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/journal_items_search.png

I am able to group by task:

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/journal_items_group.png

Constraints
-----------
Once a task is selected on an invoice, it is not possible to move the task to another project.

Otherwise, when changing the project on the task, a blocking message is displayed.

.. image:: https://raw.githubusercontent.com/Numigi/odoo-project-addons/16.0/project_task_analytic_lines/static/description/task_change_project_constraint.png

Limits
------

Purchase Orders
~~~~~~~~~~~~~~~
This module does not define how tasks are propagated from a purchase order to a supplier invoice.

The module `project_wip_outsourcing` inherits this module and adds the business logic related to outsourcing.
For now, outsourcing is the only known case where defining a task on a PO is relevant.

Stockable Products
~~~~~~~~~~~~~~~~~~
An analytic account and a task should not be set on a supplier invoice for stockable products.
The expense for a stockable product is recognized in Odoo at the customer invoice validation.

The module is intended for services (or even consummable products).

However, the module does not constrain on which type of product a task can be used.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
4 changes: 4 additions & 0 deletions project_task_analytic_lines/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
22 changes: 22 additions & 0 deletions project_task_analytic_lines/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Project Task Analytic Lines",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "LGPL-3",
"category": "Project",
"summary": "Add a task on journal entries and vendor bills",
"depends": [
"account",
"hr_timesheet",
],
"data": [
"views/account_analytic_line_views.xml",
"views/account_move_line_views.xml",
],
"installable": True,
}
146 changes: 146 additions & 0 deletions project_task_analytic_lines/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_analytic_lines
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-10 21:51+0000\n"
"PO-Revision-Date: 2020-12-10 16:51-0500\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: fr\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 2.0.6\n"

#. module: project_task_analytic_lines
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.account_move_line_search_with_task
msgid "Analytic Account"
msgstr "Compte analytique"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_analytic_line
msgid "Analytic Line"
msgstr "Ligne analytique"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_invoice
msgid "Invoice"
msgstr "Facture"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_invoice_line
msgid "Invoice Line"
msgstr "Ligne de facture"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_invoice_tax
msgid "Invoice Tax"
msgstr "Taxe de facture"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_move
msgid "Journal Entries"
msgstr "Pièces comptables"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_account_move_line
msgid "Journal Item"
msgstr "Écriture comptable"

#. module: project_task_analytic_lines
#: model:ir.model.fields,field_description:project_task_analytic_lines.field_account_analytic_line__origin_task_id
msgid "Origin Task"
msgstr "Taxe d'origine"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_product_product
msgid "Product"
msgstr "Article"

#. module: project_task_analytic_lines
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.account_move_line_form_with_task
msgid "Project"
msgstr "Projet"

#. module: project_task_analytic_lines
#: model:ir.model,name:project_task_analytic_lines.model_project_task
#: model:ir.model.fields,field_description:project_task_analytic_lines.field_account_invoice_line__task_id
#: model:ir.model.fields,field_description:project_task_analytic_lines.field_account_invoice_tax__task_id
#: model:ir.model.fields,field_description:project_task_analytic_lines.field_account_move_line__task_id
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.account_move_line_form_with_analytic_lines_sanitized
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.account_move_line_search_with_task
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.analytic_line_form_with_origin_task
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.analytic_line_list_with_origin_task
#: model_terms:ir.ui.view,arch_db:project_task_analytic_lines.analytic_line_search_with_origin_task
msgid "Task"
msgstr "Tâche"

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/account_analytic_line.py:32
#, python-format
msgid ""
"The origin task {task} is set on the analytic line {line}. This task does "
"not match the analytic account ({analytic_account}) set on the line."
msgstr ""
"La tâche d'origine {task} est inscrite sur la ligne analytique {line}. Cette "
"tâche ne correspond pas au compte analytique ({account_account}) inscrit sur "
"la ligne."

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/project_task.py:66
#, python-format
msgid ""
"The task {task} can not be moved to another project because it is already "
"bound to a posted journal entry ({move})."
msgstr ""
"La tâche {task} ne peut pas être déplacée vers un autre projet, car elle est "
"déjà liée à une écriture comptable comptabilisée ({move})."

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/project_task.py:49
#, python-format
msgid ""
"The task {task} can not be moved to another project because it is already "
"bound to a validated invoice ({invoice})."
msgstr ""
"La tâche {task} ne peut pas être déplacée vers un autre projet, car elle est "
"déjà liée à une facture validée ({invoice})."

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/account_invoice_line.py:27
#, python-format
msgid ""
"The task {task} is set on the invoice line {line}. This task does not match "
"the project ({project}) set on the line."
msgstr ""
"La tâche d'origine {task} est inscrite sur la ligne de facture {line}. Cette "
"tâche ne correspond pas au projet ({project}) inscrit sur la ligne."

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/account_move_line.py:33
#, python-format
msgid ""
"The task {task} is set on the journal item {line}. This task does not match "
"the project ({project}) set on the line."
msgstr ""
"La tâche d'origine {task} est inscrite sur la ligne d'écriture comptable "
"{line}. Cette tâche ne correspond pas au projet ({project}) inscrit sur la "
"ligne."

#. module: project_task_analytic_lines
#: code:addons/project_task_analytic_lines/models/account_invoice_tax.py:26
#, python-format
msgid ""
"The task {task} is set on the tax line {line}. This task does not match the "
"project ({project}) set on the line."
msgstr ""
"La tâche d'origine {task} est inscrite sur la ligne de taxe {line}. Cette "
"tâche ne correspond pas au projet ({project}) inscrit sur la ligne."

#~ msgid "Account Entry"
#~ msgstr "Pièce comptable"
7 changes: 7 additions & 0 deletions project_task_analytic_lines/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2023 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import account_analytic_line
from . import account_move
from . import account_move_line
from . import project_task
Loading

0 comments on commit 0978126

Please sign in to comment.