Skip to content

Commit

Permalink
[REF] project_consumable: improve consumable detection
Browse files Browse the repository at this point in the history
In the previous implementation project_id field was reused on account move line
but a lot of the odoo code source assume that an account move line with a project_id
is a timesheet, making very hard to distinguish Materials and Timesheet.

Adding a consumable_project_id it avoid to breaks existing code make module
much more easier to maintains
  • Loading branch information
petrus-v committed Feb 4, 2025
1 parent 293b4f9 commit 74a568c
Show file tree
Hide file tree
Showing 25 changed files with 412 additions and 614 deletions.
14 changes: 11 additions & 3 deletions project_consumable/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Project consumable

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

This module provides a 'closed' flag on project task stages.
This module allow to collect materials/consumable linked to a project
adding account analytic lines.

**Table of contents**

Expand Down Expand Up @@ -65,7 +66,6 @@ quantities and Unit of Mesure provided by users, analytic amount will be
computed based on product cost.

- Material & Consumable Menu
- On task tab
- Project tab

Review consumable amount
Expand Down Expand Up @@ -98,7 +98,7 @@ Authors
Contributors
------------

- Pierre Verkest <[email protected]>
- Pierre Verkest <[email protected]>

Maintainers
-----------
Expand All @@ -113,6 +113,14 @@ 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-petrus-v| image:: https://github.com/petrus-v.png?size=40px
:target: https://github.com/petrus-v
:alt: petrus-v

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

|maintainer-petrus-v|

This module is part of the `OCA/project <https://github.com/OCA/project/tree/17.0/project_consumable>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion project_consumable/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2021-2025 - Pierre Verkest
# @author Pierre Verkest <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from . import report
from .hooks import set_project_ok_for_consumable_products
5 changes: 4 additions & 1 deletion project_consumable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2021 - Pierre Verkest
# Copyright 2021-2025 - Pierre Verkest
# @author Pierre Verkest <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Project consumable",
Expand All @@ -8,6 +9,7 @@
"category": "Project Management",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"maintainers": ["petrus-v"],
"depends": [
"account",
"hr_timesheet",
Expand All @@ -17,6 +19,7 @@
"views/analytic_account_line_report.xml",
"views/product.xml",
"views/project_views.xml",
"security/project_consumable_security.xml",
],
"demo": [
"demo/product-product.xml",
Expand Down
150 changes: 31 additions & 119 deletions project_consumable/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,24 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: project_consumable
#: model:uom.uom,name:project_consumable.uom_cat_coffee_capsule_unit
msgid "1 capsule"
msgstr "1 capsule"

#. module: project_consumable
#: model:uom.uom,name:project_consumable.uom_cat_coffee_capsule_box_10
msgid "10 capsules box"
msgstr "Boîte de 10 capsules"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_kanban
msgid ""
"<i class=\"fa fa-calendar\" role=\"img\" aria-label=\"Date\" title=\"Date\"/>"
"<i class=\"fa fa-calendar me-1\" role=\"img\" aria-label=\"Date\" "
"title=\"Date\"/>"
msgstr ""
"<i class=\"fa fa-calendar\" role=\"img\" aria-label=\"Date\" title=\"Date\"/>"
"<i class=\"fa fa-calendar me-1\" role=\"img\" aria-label=\"Date\" "
"title=\"Date\"/>"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_invoice_form
Expand Down Expand Up @@ -47,11 +59,6 @@ msgstr "Entrée analytique"
msgid "Analytic Line"
msgstr "Ligne analytique"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_project_project__timesheet_ids
msgid "Associated Timesheets"
msgstr "Feuilles de temps associées"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_product_product__project_ok
#: model:ir.model.fields,field_description:project_consumable.field_product_template__project_ok
Expand All @@ -78,85 +85,31 @@ msgstr ""
"lignes. Vous pourrez ainsi analyser l'usage des consomables par projet."

#. module: project_consumable
#: code:addons/project_consumable/models/project_project.py:0
#, python-format
msgid "Consumable"
msgstr "Consomable"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_project_profitability_report__consumable_cost
msgid "Consumable Cost"
msgstr "Coût consomable"
#: model:product.template,name:project_consumable.product_coffee_capsule_product_template
#: model:uom.category,name:project_consumable.uom_category_coffee_capsule
msgid "Coffee capsule"
msgstr ""

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_project_project__consumable_count
msgid "Consumable Count"
msgstr "Nombre d'enregistrements"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.timesheet_plan
msgid "Consumable costs"
msgstr "Coûts consomables"

#. module: project_consumable
#: model:ir.actions.act_window,name:project_consumable.act_consumable_line_by_project
msgid "Consumables"
msgstr "Consomables"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.timesheet_plan
msgid "Costs from consumable consumbed by the project."
msgstr "Coût des consomables utilisé par le projet."

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "Date"
msgstr "Date"

#. module: project_consumable
#: code:addons/project_consumable/models/project_project.py:0
#, python-format
msgid "Days"
msgstr "Jours"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_account_analytic_line__display_name
#: model:ir.model.fields,field_description:project_consumable.field_product_template__display_name
#: model:ir.model.fields,field_description:project_consumable.field_project_profitability_report__display_name
#: model:ir.model.fields,field_description:project_consumable.field_project_project__display_name
#: model:ir.model.fields,field_description:project_consumable.field_project_task__display_name
msgid "Display Name"
msgstr "Libellé"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "Group By"
msgstr "Grouper par"

#. module: project_consumable
#: code:addons/project_consumable/models/project_project.py:0
#, python-format
msgid "Hours"
msgstr "Heures"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_account_analytic_line__id
#: model:ir.model.fields,field_description:project_consumable.field_product_template__id
#: model:ir.model.fields,field_description:project_consumable.field_project_profitability_report__id
#: model:ir.model.fields,field_description:project_consumable.field_project_project__id
#: model:ir.model.fields,field_description:project_consumable.field_project_task__id
msgid "ID"
msgstr ""

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_account_analytic_line____last_update
#: model:ir.model.fields,field_description:project_consumable.field_product_template____last_update
#: model:ir.model.fields,field_description:project_consumable.field_project_profitability_report____last_update
#: model:ir.model.fields,field_description:project_consumable.field_project_project____last_update
#: model:ir.model.fields,field_description:project_consumable.field_project_task____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_graph
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_pivot
Expand All @@ -175,11 +128,6 @@ msgstr "Coûts des matériels"
msgid "Material by Date"
msgstr "Matériels par date"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_tree
msgid "Material consumption"
msgstr "Consomation des matériels"

#. module: project_consumable
#: model:ir.actions.act_window,name:project_consumable.consumable_action_report_by_project
msgid "Material/Consumable By Project"
Expand Down Expand Up @@ -215,29 +163,20 @@ msgstr "Aucun produit trouvé."
#. module: project_consumable
#: model:ir.model.fields,help:project_consumable.field_project_project__consumable_count
msgid "Number of consumable lines collected."
msgstr ""
msgstr "Nombre de lignes de consommation saisies."

#. module: project_consumable
#: model:ir.model,name:project_consumable.model_product_template
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "Product"
msgstr "Produit"

#. module: project_consumable
#: model:ir.model,name:project_consumable.model_product_template
msgid "Product Template"
msgstr "Modèle de produit"

#. module: project_consumable
#: model:ir.model,name:project_consumable.model_project_project
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "Project"
msgstr "Projet"

#. module: project_consumable
#: model:ir.model,name:project_consumable.model_project_profitability_report
msgid "Project Profitability Report"
msgstr ""

#. module: project_consumable
#: model:ir.actions.act_window,name:project_consumable.material_action_project
msgid "Project's Materials"
Expand All @@ -248,28 +187,6 @@ msgstr "Matériels du projet"
msgid "Record a new activity"
msgstr ""

#. module: project_consumable
#: code:addons/project_consumable/models/project_project.py:0
#, python-format
msgid "Recorded"
msgstr "Enregistré"

#. module: project_consumable
#: model:ir.model,name:project_consumable.model_project_task
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "Task"
msgstr "Tâche"

#. module: project_consumable
#: model:ir.actions.act_window,name:project_consumable.material_action_task
msgid "Task's Materials"
msgstr "Matériels de la tâche"

#. module: project_consumable
#: model:ir.model.fields,field_description:project_consumable.field_project_task__timesheet_ids
msgid "Timesheets"
msgstr "Feuille de temps"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_tree
msgid "Total"
Expand All @@ -278,19 +195,18 @@ msgstr "Total"
#. module: project_consumable
#: model_terms:ir.actions.act_window,help:project_consumable.act_project_consumable_product_line
msgid ""
"Track consummed products by projects every day and analyse cost per projects."
"Track consumed products by projects every day and analysis cost per projects."
msgstr ""
"Suivez la consomation des produits par projet au jour le jour pour analyser "
"leurs coûts par projet/tâche."
"Suivez vos produits consommés par projet au jour le jour pour analyser leurs coûts."

#. module: project_consumable
#: model_terms:ir.actions.act_window,help:project_consumable.consumable_action_report_by_project
#: model_terms:ir.actions.act_window,help:project_consumable.act_consumable_line_by_project
msgid ""
"Track your consumable products by projects every day and analyse associated "
"cost."
"Track your consumable by projects every day and invoice those materials to "
"your customers."
msgstr ""
"Suivez vos consomables par projet au jour le jour pour permettre l'analyse "
"des coûts associés."
"Suivez vos produits consommés par projet au jour le jour pour facturer ces "
"matériels à vos clients."

#. module: project_consumable
#: model_terms:ir.actions.act_window,help:project_consumable.act_project_consumable_product_line_all
Expand All @@ -299,22 +215,18 @@ msgstr ""
"Suivez vos consomables par projet au jour le jour pour analyser leurs coûts."

#. module: project_consumable
#: model_terms:ir.actions.act_window,help:project_consumable.act_consumable_line_by_project
#: model_terms:ir.actions.act_window,help:project_consumable.consumable_action_report_by_project
msgid ""
"Track your working hours by projects every day and invoice this time to your "
"customers."
"Track your consumable products by projects every day and analyze associated "
"cost."
msgstr ""
"Suivez vos consomables par projet au jour le jour pour analyser leurs coûts."

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_consumable_product_line_search
msgid "User"
msgstr "Utilisateur"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.timesheet_plan
msgid "and consumable costs"
msgstr "et coûts des consomables"

#. module: project_consumable
#: model_terms:ir.ui.view,arch_db:project_consumable.project_invoice_form
msgid "records"
Expand Down
Loading

0 comments on commit 74a568c

Please sign in to comment.