Browse Source

[9.0] Upgrade Partner Gender module

14.0
Richard deMeester 9 years ago
committed by newtratip
parent
commit
b3d86c6c05
  1. 48
      partner_contact_gender/README.rst
  2. 18
      partner_contact_gender/__init__.py
  3. 37
      partner_contact_gender/__openerp__.py
  4. 26
      partner_contact_gender/models.py
  5. 5
      partner_contact_gender/models/__init__.py
  6. 14
      partner_contact_gender/models/res_partner.py
  7. 52
      partner_contact_gender/views/res_partner.xml

48
partner_contact_gender/README.rst

@ -1,46 +1,64 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
Partner Gender
==============
This module was written to extend the functionality of Odoo contacts manager to
support setting the gender of a partner.
This module extends the contact management functionality. It allows recording
of a partner's gender.
Installation
============
To install this module, you need to:
* Install the `partner-contact`_ repository.
There are no special instructions regarding installation.
Configuration
=============
.. _partner-contact: https://github.com/OCA/partner-contact/
No configuration is needed.
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.
New item for 'Gender' can be edited on the 'Personal Information' tab of
the partner contact form.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
.. 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
======================
* No known issues.
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 `here <https://github.com/OCA/
partner-contact/issues/new?body=module:%20
partner_contact_gender%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
* Icon from `Font Awesome <http://fontawesome.io/>`_.
Contributors
------------
* Jairo Llopis <j.llopis@grupoesoc.es>
* Richard deMeester <richard@willowit.com.au>
Maintainer
----------

18
partner_contact_gender/__init__.py

@ -1,19 +1,5 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# -*- coding: utf-8 -*-
# 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/>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

37
partner_contact_gender/__openerp__.py

@ -1,33 +1,24 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# -*- coding: utf-8 -*-
# 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/>.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Contact gender",
"version": "8.0.1.0.0",
"summary": "Add gender field to contacts",
"version": "9.0.1.0.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 contacts",
"author": "Grupo ESOC, Odoo Community Association (OCA)",
"contributors": [
'Jairo Llopis <j.llopis@grupoesoc.es>',
'Richard deMeester <richard@willowit.com.au>',
],
"license": "AGPL-3",
'application': False,
'installable': True,
'auto_install': False,
"depends": [
"partner_contact_personal_information_page",
"base",
],
"data": [
"views/res_partner.xml",

26
partner_contact_gender/models.py

@ -1,26 +0,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/>.
from openerp import fields, models
class Partner(models.Model):
"""Partners with gender."""
_inherit = "res.partner"
gender = fields.Selection([('male', 'Male'), ('female', 'Female')])

5
partner_contact_gender/models/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import res_partner

14
partner_contact_gender/models/res_partner.py

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
gender = fields.Selection([('male', 'Male'),
('female', 'Female'),
('other', 'Other')
])

52
partner_contact_gender/views/res_partner.xml

@ -1,38 +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>
<odoo>
<data>
<record id="form" model="ir.ui.view">
<field name="name">Partner gender</field>
<!-- Declared the same in every module that may need it -->
<record id="base.personal_contact_information" model="ir.ui.view">
<field name="name">Personal information page for contacts form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">2</field>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='internal_notes']" position="after">
<page name="personal_information_page"
string="Personal Information"
attrs="{'invisible': [('is_company','=',True)]}">
<group name="personal_information_group"/>
</page>
</xpath>
</data>
</field>
</record>
<record id="personal_contact_information" model="ir.ui.view">
<field name="name">Partner gender: personal info</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="inherit_id" ref="base.personal_contact_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='personal_information_group']">
<field name="gender"/>
<xpath expr="//page[@name='personal_information_page']/group[@name='personal_information_group']">
<field name='gender'/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save