Browse Source

[MIG] partner_phone_extension v8

pull/401/head
darshan-serpent 8 years ago
parent
commit
c1d8a45956
  1. 27
      partner_phone_extension/__init__.py
  2. 39
      partner_phone_extension/__openerp__.py
  3. 6
      partner_phone_extension/models/__init__.py
  4. 12
      partner_phone_extension/models/res_partner.py
  5. 30
      partner_phone_extension/res_partner.py
  6. 38
      partner_phone_extension/res_partner_view.xml
  7. 32
      partner_phone_extension/views/res_partner_view.xml

27
partner_phone_extension/__init__.py

@ -1,23 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# Copyright 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner
from . import models

39
partner_phone_extension/__openerp__.py

@ -1,45 +1,18 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# Copyright 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
'name': 'Partner Phone Number Extension',
'version': '1.1',
'version': '8.0.1.0.0',
'category': 'Customer Relationship Management',
'summary': 'Partner Phone Number Extension',
'description': """
Partner Phone Number Extension
==============================
This module allows to add a phone number extension field in partner form view.
Contributors
------------
* El Hadji Dem (elhadji.dem@savoirfairelinux.com)
""",
'author': "Savoir-faire Linux,Odoo Community Association (OCA)",
'website': 'www.savoirfairelinux.com',
'license': 'AGPL-3',
'data': [
'res_partner_view.xml',
'views/res_partner_view.xml',
],
'installable': True,
}

6
partner_phone_extension/models/__init__.py

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner

12
partner_phone_extension/models/res_partner.py

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
extension = fields.Char('Extension', help="Phone Number Extension.")

30
partner_phone_extension/res_partner.py

@ -1,30 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013-2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.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.osv import orm, fields
class res_partner(orm.Model):
_inherit = 'res.partner'
_columns = {
'extension': fields.char('Extension', help="Phone Number Extension."),
}

38
partner_phone_extension/res_partner_view.xml

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add phone number extension fields for partner -->
<record id="view_partner_simple_number_extension_form" model="ir.ui.view">
<field name="name">view.partner.simple.number.extension.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_simple_form"/>
<field name="arch" type="xml">
<field name="phone" position="after">
<field name="extension"/>
</field>
</field>
</record>
<record id="view_partner_number_extension_form" model="ir.ui.view">
<field name="name">view.partner.number.extension.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="phone" position="after">
<field name="extension"/>
</field>
<xpath expr="//form[@string='Contact']//field[@name='phone']"
position="after">
<field name="extension"/>
</xpath>
</field>
</record>
</data>
</openerp>

32
partner_phone_extension/views/res_partner_view.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add phone number extension fields for partner -->
<record id="view_partner_simple_number_extension_form" model="ir.ui.view">
<field name="name">view.partner.simple.number.extension.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_simple_form"/>
<field name="arch" type="xml">
<field name="phone" position="after">
<field name="extension"/>
</field>
</field>
</record>
<record id="view_partner_number_extension_form" model="ir.ui.view">
<field name="name">view.partner.number.extension.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="phone" position="after">
<field name="extension"/>
</field>
<xpath expr="//form[@string='Contact']//field[@name='phone']" position="after">
<field name="extension"/>
</xpath>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save