Richard deMeester
9 years ago
7 changed files with 86 additions and 75 deletions
-
48partner_contact_gender/README.rst
-
2partner_contact_gender/__init__.py
-
19partner_contact_gender/__openerp__.py
-
26partner_contact_gender/models.py
-
3partner_contact_gender/models/__init__.py
-
32partner_contact_gender/models/partner_gender.py
-
31partner_contact_gender/views/res_partner.xml
@ -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')]) |
|
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import partner_gender |
@ -0,0 +1,32 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# OpenERP, Open Source Management Solution |
||||
|
# Copyright (C) 2013-TODAY OpenERP SA (<http://www.openerp.com>). |
||||
|
# |
||||
|
# 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, _, api |
||||
|
from openerp.osv import expression |
||||
|
|
||||
|
|
||||
|
class ResPartner(models.Model): |
||||
|
_inherit = 'res.partner' |
||||
|
|
||||
|
gender = fields.Selection([('male', 'Male'), |
||||
|
('female', 'Female'), |
||||
|
('other', 'Other') |
||||
|
]) |
@ -1,38 +1,19 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?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> |
<data> |
||||
|
|
||||
<record id="form" model="ir.ui.view"> |
|
||||
<field name="name">Partner gender</field> |
|
||||
|
<record id="view_res_partner_personal_information" model="ir.ui.view"> |
||||
|
<field name="name">Partner gender: personal info</field> |
||||
<field name="model">res.partner</field> |
<field name="model">res.partner</field> |
||||
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/> |
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/> |
||||
<field name="arch" type="xml"> |
<field name="arch" type="xml"> |
||||
<data> |
<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> |
</xpath> |
||||
</data> |
</data> |
||||
</field> |
</field> |
||||
</record> |
</record> |
||||
|
|
||||
</data> |
</data> |
||||
</openerp> |
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue