Browse Source

[ADD] partner_contact_nutrition_allergen (#340)

* [ADD] partner_contact_nutrition_allergen
pull/213/merge
Maxime Chambreuil 8 years ago
committed by GitHub
parent
commit
4e2f7d0ec2
  1. 59
      partner_contact_nutrition_allergen/README.rst
  2. 5
      partner_contact_nutrition_allergen/__init__.py
  3. 21
      partner_contact_nutrition_allergen/__openerp__.py
  4. 5
      partner_contact_nutrition_allergen/models/__init__.py
  5. 15
      partner_contact_nutrition_allergen/models/res_partner.py
  6. BIN
      partner_contact_nutrition_allergen/static/description/icon.png
  7. 17
      partner_contact_nutrition_allergen/views/res_partner_view.xml
  8. 1
      setup/partner_contact_nutrition_allergen/odoo_addons/__init__.py
  9. 1
      setup/partner_contact_nutrition_allergen/odoo_addons/partner_contact_nutrition_allergen
  10. 6
      setup/partner_contact_nutrition_allergen/setup.py

59
partner_contact_nutrition_allergen/README.rst

@ -0,0 +1,59 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==================================
Partner Contact Nutrition Allergen
==================================
This module adds the list of allergen to a partner contact.
Allergen should be created as stockable products.
Usage
=====
* Go to Contacts
* Create or select a contact
* Go to the Nutrition tab to select their allergens
Known issues / Roadmap
======================
* None yet
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Maxime Chambreuil <mchambreuil@ursainfosystems.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

5
partner_contact_nutrition_allergen/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Ursa Information Systems <http://ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

21
partner_contact_nutrition_allergen/__openerp__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Ursa Information Systems <http://ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner Contact Nutrition Allergens",
"summary": "Set the nutrition allergens of your contacts",
"version": "9.0.1.0.0",
"category": "Health",
"website": "http://ursainfosystems.com",
"author": "Ursa Information Systems, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"partner_contact_nutrition",
"stock",
],
"data": [
"views/res_partner_view.xml",
],
}

5
partner_contact_nutrition_allergen/models/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Ursa Information Systems <http://ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import res_partner

15
partner_contact_nutrition_allergen/models/res_partner.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Ursa Information Systems <http://ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
nutrition_allergen_ids = fields.Many2many(comodel_name='product.product',
string='Allergens',
domain="[('type', '=',"
" 'stockable')]")

BIN
partner_contact_nutrition_allergen/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

17
partner_contact_nutrition_allergen/views/res_partner_view.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_contact_nutrition_allergen" model="ir.ui.view">
<field name="name">Partner Contact Nutrition Allergens</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_nutrition.view_nutrition_information"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='nutrition']/group/group[@name='other_info']" position="after">
<group name="allergen" string="Allergens">
<field name="nutrition_allergen_ids" nolabel="1"/>
</group>
</xpath>
</field>
</record>
</odoo>

1
setup/partner_contact_nutrition_allergen/odoo_addons/__init__.py

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

1
setup/partner_contact_nutrition_allergen/odoo_addons/partner_contact_nutrition_allergen

@ -0,0 +1 @@
../../../partner_contact_nutrition_allergen

6
setup/partner_contact_nutrition_allergen/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save