Browse Source

[ADD] partner_contact_height and partner_contact_weight (#336)

* [ADD] partner_contact_height
* [ADD] partner_contact_weight
pull/342/head
Maxime Chambreuil 8 years ago
committed by GitHub
parent
commit
fc506cb06c
  1. 63
      partner_contact_height/README.rst
  2. 5
      partner_contact_height/__init__.py
  3. 21
      partner_contact_height/__openerp__.py
  4. 5
      partner_contact_height/models/__init__.py
  5. 16
      partner_contact_height/models/res_partner.py
  6. BIN
      partner_contact_height/static/description/icon.png
  7. 23
      partner_contact_height/views/res_partner_view.xml
  8. 63
      partner_contact_weight/README.rst
  9. 5
      partner_contact_weight/__init__.py
  10. 21
      partner_contact_weight/__openerp__.py
  11. 5
      partner_contact_weight/models/__init__.py
  12. 16
      partner_contact_weight/models/res_partner.py
  13. BIN
      partner_contact_weight/static/description/icon.png
  14. 23
      partner_contact_weight/views/res_partner_view.xml
  15. 1
      setup/partner_contact_height/odoo_addons/__init__.py
  16. 1
      setup/partner_contact_height/odoo_addons/partner_contact_height
  17. 6
      setup/partner_contact_height/setup.py
  18. 1
      setup/partner_contact_weight/odoo_addons/__init__.py
  19. 1
      setup/partner_contact_weight/odoo_addons/partner_contact_weight
  20. 6
      setup/partner_contact_weight/setup.py

63
partner_contact_height/README.rst

@ -0,0 +1,63 @@
.. 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 Height
======================
This module adds the height to a contact.
Usage
=====
To use this module, you need to:
#. Go to Contacts
#. Create or select a contact
#. In the Personal Information tab, enter its height and the unit of measure
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/9.0
Known issues / Roadmap
======================
* ...
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_height/__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_height/__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 Height",
"summary": "Provide contact height.",
"version": "9.0.1.0.0",
"category": "Uncategorized",
"website": "https://ursainfosystems.com",
"author": "Ursa Information Systems, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"product",
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner_view.xml",
],
}

5
partner_contact_height/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

16
partner_contact_height/models/res_partner.py

@ -0,0 +1,16 @@
# -*- 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'
height = fields.Float("Height")
height_uom = fields.Many2one("product.uom", "Height UoM",
domain="[('category_id', '=', "
"self.env.ref('product.\
uom_categ_length').id)]")

BIN
partner_contact_height/static/description/icon.png

After

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

23
partner_contact_height/views/res_partner_view.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_contact_height" model="ir.ui.view">
<field name="name">Partner Contact Height</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']">
<label for="height"/>
<div>
<field name='height' class="oe_inline"/>
<field name='height_uom'
class="oe_inline"
placeholder="UoM"/>
</div>
</xpath>
</data>
</field>
</record>
</odoo>

63
partner_contact_weight/README.rst

@ -0,0 +1,63 @@
.. 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 Weight
======================
This module adds the weight to a contact.
Usage
=====
To use this module, you need to:
#. Go to Contacts
#. Create or select a contact
#. In the Personal Information tab, enter its weight and the unit of measure
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/9.0
Known issues / Roadmap
======================
* ...
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_weight/__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_weight/__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 Weight",
"summary": "Provide contact weight",
"version": "9.0.1.0.0",
"category": "Uncategorized",
"website": "https://ursainfosystems.com",
"author": "Ursa Information Systems, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"product",
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner_view.xml",
],
}

5
partner_contact_weight/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

16
partner_contact_weight/models/res_partner.py

@ -0,0 +1,16 @@
# -*- 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'
weight = fields.Float("Weight")
weight_uom = fields.Many2one("product.uom", "Weight UoM",
domain="[('category_id', '=', "
"self.env.ref('product.\
product_uom_categ_kgm').id)]")

BIN
partner_contact_weight/static/description/icon.png

After

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

23
partner_contact_weight/views/res_partner_view.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_contact_weight" model="ir.ui.view">
<field name="name">Partner Contact Weight</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']">
<label for="weight"/>
<div>
<field name='weight' class="oe_inline"/>
<field name='weight_uom'
class="oe_inline"
placeholder="UoM"/>
</div>
</xpath>
</data>
</field>
</record>
</odoo>

1
setup/partner_contact_height/odoo_addons/__init__.py

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

1
setup/partner_contact_height/odoo_addons/partner_contact_height

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

6
setup/partner_contact_height/setup.py

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

1
setup/partner_contact_weight/odoo_addons/__init__.py

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

1
setup/partner_contact_weight/odoo_addons/partner_contact_weight

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

6
setup/partner_contact_weight/setup.py

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