Browse Source

Add module partner_gender.

pull/147/head
Jairo Llopis 10 years ago
parent
commit
861abca714
  1. 59
      partner_gender/README.rst
  2. 19
      partner_gender/__init__.py
  3. 35
      partner_gender/__openerp__.py
  4. 38
      partner_gender/i18n/es.po
  5. 37
      partner_gender/i18n/partner_gender.pot
  6. 26
      partner_gender/models.py
  7. BIN
      partner_gender/static/description/icon.png
  8. 49
      partner_gender/static/description/icon.svg
  9. 38
      partner_gender/views/res_partner.xml

59
partner_gender/README.rst

@ -0,0 +1,59 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Partner Gender
==============
This module was written to extend the functionality of `base_contact`_ to
support setting the gender of a partner.
.. _base_contact: https://github.com/OCA/partner-contact/tree/8.0/base_contact
Installation
============
To install this module, you need to:
* Install the `partner-contact`_ repository.
.. _partner-contact: https://github.com/OCA/partner-contact/
Usage
=====
To use this module, you need to:
* Edit a partner or create a new one.
* Ensure the partner is **not** a company.
* Go to the *Personal information* sheet.
* Set the gender there.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Credits
=======
Contributors
------------
* Jairo Llopis <j.llopis@grupoesoc.es>
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 http://odoo-community.org.

19
partner_gender/__init__.py

@ -0,0 +1,19 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import models

35
partner_gender/__openerp__.py

@ -0,0 +1,35 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Partner gender",
"version": "1.0",
"category": "Customer Relationship Management",
"author": "Odoo Community Association (OCA), Grupo ESOC",
"license": "AGPL-3",
"website": "https://odoo-community.org/",
"installable": True,
"application": False,
"summary": "Add gender field to partners",
"depends": [
"base_contact",
],
"data": [
"views/res_partner.xml",
],
}

38
partner_gender/i18n/es.po

@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_gender
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-18 10:55+0000\n"
"PO-Revision-Date: 2015-05-18 12:57+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
"Language: es_ES\n"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Female"
msgstr "Femenino"
#. module: partner_gender
#: field:res.partner,gender:0
msgid "Gender"
msgstr "Género"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Male"
msgstr "Masculino"
#. module: partner_gender
#: model:ir.model,name:partner_gender.model_res_partner
msgid "Partner"
msgstr "Empresa"

37
partner_gender/i18n/partner_gender.pot

@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_gender
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-18 10:55+0000\n"
"PO-Revision-Date: 2015-05-18 10:55+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Female"
msgstr ""
#. module: partner_gender
#: field:res.partner,gender:0
msgid "Gender"
msgstr ""
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Male"
msgstr ""
#. module: partner_gender
#: model:ir.model,name:partner_gender.model_res_partner
msgid "Partner"
msgstr ""

26
partner_gender/models.py

@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp import fields, models
class Partner(models.Model):
"""Partners with gender."""
_inherit = "res.partner"
gender = fields.Selection([('male', 'Male'), ('female', 'Female')])

BIN
partner_gender/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 1.9 KiB

49
partner_gender/static/description/icon.svg

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
id="svg2"
viewBox="0 0 99.999997 99.999997"
height="100"
width="100">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-952.36225)"
id="layer1">
<text
id="text3344"
y="1020.0374"
x="85.610428"
style="font-style:normal;font-weight:normal;font-size:30px;line-height:125%;font-family:Sans;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="1020.0374"
x="85.610428"
id="tspan3346" /></text>
<text
id="text3707"
y="1037.699"
x="53.543034"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:98.94290924px;line-height:125%;font-family:Sans;-inkscape-font-specification:'Sans Bold';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="1037.699"
x="53.543034"
id="tspan3709"></tspan></text>
</g>
</svg>

38
partner_gender/views/res_partner.xml

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Odoo, Open Source Management Solution
Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<openerp>
<data>
<record id="form" model="ir.ui.view">
<field name="name">Partner gender</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base_contact.view_partner_form_inherit"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='nationality_id']" position="after">
<field name="gender"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save