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

[17.0] project consumable #1419

Open
wants to merge 4 commits into
base: 17.0
Choose a base branch
from
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
126 changes: 126 additions & 0 deletions project_consumable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
==================
Project consumable
==================

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

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

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

This module allow to collect materials/consumable linked to a project
adding account analytic lines.

**Table of contents**

.. contents::
:local:

Configuration
=============

To be able to track consumable products (or avoid to link un-followed
products) to project, you have to configure each products to be
available in projects.

1. Go to Product form view (ie: *Invoicing > customers > Products*) and
make sure the project_ok field is checked (by default consumable
products are available).

.. note::

This module do not depends on sales or accounting modules so you may
need to install extra modules to get menu entry to products or
analytic account line views.

Usage
=====

Link products to a project
--------------------------

This can be done from different places as describe bellow.

In facts this add ``account.analytic.line`` with proper product,
quantities and Unit of Mesure provided by users, analytic amount will be
computed based on product cost.

- Material & Consumable Menu
- Project tab

Review consumable amount
------------------------

You can analyse consumable amount per project from different places:

- project dashboard
- Analytic account line analyse
- Project analyse

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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/project/issues/new?body=module:%20project_consumable%0Aversion:%2017.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
-------

* Pierre Verkest

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

- Pierre Verkest <[email protected]>

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-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.
5 changes: 5 additions & 0 deletions project_consumable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +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 .hooks import set_project_ok_for_consumable_products
28 changes: 28 additions & 0 deletions project_consumable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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",
"summary": "Track the use of consumables by project with analytic accounting.",
"author": "Pierre Verkest, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"category": "Project Management",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"maintainers": ["petrus-v"],
"depends": [
"account",
"hr_timesheet",
],
"data": [
"views/analytic_account_line.xml",
"views/analytic_account_line_report.xml",
"views/product.xml",
"views/project_views.xml",
"security/project_consumable_security.xml",
],
"demo": [
"demo/product-product.xml",
],
"post_init_hook": "set_project_ok_for_consumable_products",
}
28 changes: 28 additions & 0 deletions project_consumable/demo/product-product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="uom_category_coffee_capsule" model="uom.category">
<field name="name">Coffee capsule</field>
</record>
<record id="uom_cat_coffee_capsule_unit" model="uom.uom">
<field name="category_id" ref="uom_category_coffee_capsule" />
<field name="name">1 capsule</field>
<field name="factor" eval="1.0" />
<field name="uom_type">reference</field>
</record>
<record id="uom_cat_coffee_capsule_box_10" model="uom.uom">
<field name="category_id" ref="uom_category_coffee_capsule" />
<field name="name">10 capsules box</field>
<field name="factor_inv" eval="10" />
<field name="uom_type">bigger</field>
</record>
<record id="product_coffee_capsule" model="product.product">
<field name="sale_ok">False</field>
<field name="purchase_ok">True</field>
<field name="name">Coffee capsule</field>
<field name="standard_price">0.33</field>
<field name="type">consu</field>
<field name="categ_id" ref="product.product_category_consumable" />
<field name="uom_id" ref="uom_cat_coffee_capsule_unit" />
<field name="uom_po_id" ref="uom_cat_coffee_capsule_box_10" />
</record>
</odoo>
2 changes: 2 additions & 0 deletions project_consumable/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def set_project_ok_for_consumable_products(env):
env["product.template"].search([("type", "=", "consu")]).write({"project_ok": True})
Loading