Skip to content

Commit

Permalink
Merge PR #178 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Jan 24, 2025
2 parents 2a51b45 + 20481c8 commit 7e0f352
Show file tree
Hide file tree
Showing 43 changed files with 1,372 additions and 31 deletions.
118 changes: 118 additions & 0 deletions product_food/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
============================
Products - Food Informations
============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ecfaf240c3715a7c432e398dbd4668caed8e92dbc38dd773d64e780df60fba27
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-grap%2Fgrap--odoo--business-lightgray.png?logo=github
:target: https://github.com/grap/grap-odoo-business/tree/12.0/product_food
:alt: grap/grap-odoo-business

|badge1| |badge2| |badge3|

This module extends the functionality of sale module to support food features.

It provides a new model ``product.allergen``

It also adds many fields on product models. (templates and variants)

* ``is_alimentary``, boolean for analysis purpose.
* ``best_before_date_day`` that mentions for how many days a product can
be eaten, after having packed. (for cheese, meats, etc.)
* ``has_alcohol``, boolean to mention if the product contains alcohol.
* ``allergen_ids`` to mention the list of allergens.
* ``ingredients``. (free text).

Alls the fields are defined on ``product.product`` model and can be set also
on ``product.template`` models, in a mono variant context.

**Table of contents**

.. contents::
:local:

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

* Go to 'Sale > Configuration > Allergens' and create new items.

.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-business/12.0/product_food/static/description/product_allergen_form.png

* Go to 'Inventory > Configuration > Product Categories' and check new fields:
* ``Contain Alimentary Products``
* ``Contain Vegan Products``
* ``Contain Alcohol Products``

.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-business/12.0/product_food/static/description/product_category_form.png

* Go to 'Sale > Configuration > Product Labels' and update your labels,
setting two new fields ``Has Alcohol`` and ``Is Vegan``.

.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-business/12.0/product_food/static/description/product_label_form.png

Usage
=====

* Go to your product variants or templates form and set the information in the following two tabs.

.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-business/12.0/product_food/static/description/product_product_alimentary_tab.png

Known issues / Roadmap
======================

* It could be great to have the possibility to manage the certification
document that provide certification organization with the following model
``res.company.certification`` and the fields ``company_id``,
``organization_id``, ``date_start``, ``date_end``

* In the same way, it could be great to have the possibility to store
the certification document of each supplier with the following model
``res.partner.certification`` and the fields ``partner_id``,
``organization_id``, ``date_start``, ``date_end``

* Make a dependency to the new module ``product_net_weight`` and update
algorithm + create a new module ``product_volumen_price``.
https://github.com/OCA/product-attribute/pull/894

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

Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-business/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/grap/grap-odoo-business/issues/new?body=module:%20product_food%0Aversion:%2012.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
~~~~~~~

* GRAP

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

* Julien WESTE
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)

Maintainers
~~~~~~~~~~~

This module is part of the `grap/grap-odoo-business <https://github.com/grap/grap-odoo-business/tree/12.0/product_food>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions product_food/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
35 changes: 35 additions & 0 deletions product_food/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2012 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# @author Julien WESTE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Products - Food Informations",
"version": "16.0.1.0.0",
"category": "Sales",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-business",
"license": "AGPL-3",
"depends": [
# OCA
"product_usability",
"product_compute_template_field_from_variant_helper",
# GRAP
"product_label",
],
"data": [
"security/res_groups.xml",
"security/ir.model.access.csv",
"views/view_product_label.xml",
"views/view_product_allergen.xml",
"views/view_product_category.xml",
"views/view_product_product.xml",
"views/view_product_template.xml",
],
"demo": [
"demo/product_label.xml",
"demo/product_allergen.xml",
"demo/product_category.xml",
"demo/product_product.xml",
],
"installable": True,
}
79 changes: 79 additions & 0 deletions product_food/demo/product_allergen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="allergen_ARA" model="product.allergen">
<field name="code">ARA</field>
<field name="name">Arachide</field>
</record>

<record id="allergen_CEL" model="product.allergen">
<field name="code">CEL</field>
<field name="name">Céleri</field>
</record>

<record id="allergen_CRU" model="product.allergen">
<field name="code">CRU</field>
<field name="name">Crustacés</field>
</record>

<record id="allergen_FAC" model="product.allergen">
<field name="code">FAC</field>
<field name="name">Fruits à coques (oléagineux)</field>
</record>

<record id="allergen_GLU" model="product.allergen">
<field name="code">GLU</field>
<field name="name">Gluten</field>
</record>

<record id="allergen_LAIT" model="product.allergen">
<field name="code">LAIT</field>
<field name="name">Lait</field>
</record>

<record id="allergen_LUP" model="product.allergen">
<field name="code">LUP</field>
<field name="name">Lupin</field>
</record>

<record id="allergen_MOL" model="product.allergen">
<field name="code">MOL</field>
<field name="name">Mollusques</field>
</record>

<record id="allergen_MOU" model="product.allergen">
<field name="code">MOU</field>
<field name="name">Moutarde</field>
</record>

<record id="allergen_POI" model="product.allergen">
<field name="code">POI</field>
<field name="name">Poissons</field>
</record>

<record id="allergen_SES" model="product.allergen">
<field name="code">SES</field>
<field name="name">Sésame</field>
</record>

<record id="allergen_SOJA" model="product.allergen">
<field name="code">SOJA</field>
<field name="name">Soja</field>
</record>

<record id="allergen_SUL" model="product.allergen">
<field name="code">SUL</field>
<field name="name">Sulfites</field>
</record>

<record id="allergen_OEUF" model="product.allergen">
<field name="code">ŒUF</field>
<field name="name">Oeuf</field>
</record>

</odoo>
22 changes: 22 additions & 0 deletions product_food/demo/product_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2018 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="alimentary_category" model="product.category">
<field name="name">Alimentary</field>
<field name="is_alimentary" eval="True"/>
<field name="parent_id" ref="product.product_category_1"/>
</record>

<record id="beer_category" model="product.category">
<field name="name">Beers</field>
<field name="is_alimentary" eval="True"/>
<field name="has_alcohol" eval="True"/>
<field name="parent_id" ref="product_food.alimentary_category"/>
</record>

</odoo>
25 changes: 25 additions & 0 deletions product_food/demo/product_label.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2012 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
@author Julien WESTE
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="label_demeter" model="product.label">
<field name="name">Demeter</field>
<field name="code">DEM</field>
<field name="website">https://www.demeter.fr/</field>
<field name="image_1920" type="base64" file="product_food/static/img/label_demeter-image.png"/>
</record>

<record id="label_vegan" model="product.label">
<field name="name">Vegan</field>
<field name="code">VEG</field>
<field name="website">https://www.vegan.org/</field>
<field name="is_vegan" eval="1"/>
<field name="image_1920" type="base64" file="product_food/static/img/label_vegan-image.png"/>
</record>

</odoo>
42 changes: 42 additions & 0 deletions product_food/demo/product_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2012 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
@author Julien WESTE
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>

<record id="product_arachide_toaste" model="product.product">
<field name="name">Arachide Bio Toasté - Jean Hervé</field>
<field name="categ_id" ref="alimentary_category" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="is_alimentary" eval="True" />
<field name="list_price">2.70</field>
<field name="allergen_ids" eval="[
(4, ref('allergen_ARA')),
]"/>
<field name="label_ids" eval="[
(4, ref('product_label.label_agriculture_biologique')),
]"/>
<field name="ingredients">Arachides de Chine issues de l'agriculture biologique</field>
<field name="best_before_date_day">365</field>
</record>


<record id="product_biere_sans_gluten" model="product.product">
<field name="name">Bière Lammsbrau sans gluten 33cl</field>
<field name="categ_id" ref="alimentary_category" />
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="is_alimentary" eval="True" />
<field name="has_alcohol" eval="True" />
<field name="barcode">4012852001698</field>
<field name="list_price">2.30</field>
<field name="volume">0.33</field>
<field name="label_ids" eval="[
(4, ref('product_label.label_agriculture_biologique')),
(4, ref('product_label.label_gluten_free')),
]"/>
</record>

</odoo>
Loading

0 comments on commit 7e0f352

Please sign in to comment.