Browse Source

Port event_phone and hr_recruitment_phone to v9

pull/88/head
Alexis de Lattre 9 years ago
parent
commit
949222daf2
  1. 24
      crm_phone/crm_phone.py
  2. 19
      event_phone/__init__.py
  3. 29
      event_phone/__openerp__.py
  4. 46
      event_phone/event_phone.py
  5. 23
      event_phone/event_view.xml
  6. 4
      hr_phone/hr_view.xml
  7. 19
      hr_recruitment_phone/__init__.py
  8. 30
      hr_recruitment_phone/__openerp__.py
  9. 46
      hr_recruitment_phone/hr_recruitment_phone.py
  10. 10
      hr_recruitment_phone/hr_recruitment_view.xml

24
crm_phone/crm_phone.py

@ -1,24 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# CRM phone module for Odoo/OpenERP
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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 -*-
# © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api, _

19
event_phone/__init__.py

@ -1,22 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Event Phone module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# 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 event_phone

29
event_phone/__openerp__.py

@ -1,28 +1,11 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Event Phone module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# 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 -*-
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Event Phone',
'version': '8.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Validate phone numbers in Events',
@ -46,8 +29,6 @@ for any help or question about this module.
'security/ir.model.access.csv',
'event_view.xml',
],
'images': [],
'installable': False,
'installable': True,
'auto_install': True,
'active': False,
}

46
event_phone/event_phone.py

@ -1,29 +1,11 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Event phone module for Odoo/OpenERP
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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 -*-
# © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.osv import orm
from openerp import models, api
class event_registration(orm.Model):
class EventRegistration(models.Model):
_name = 'event.registration'
_inherit = ['event.registration', 'phone.common']
_phone_fields = ['phone']
@ -31,14 +13,12 @@ class event_registration(orm.Model):
_country_field = None
_partner_field = 'partner_id'
def create(self, cr, uid, vals, context=None):
vals_reformated = self._generic_reformat_phonenumbers(
cr, uid, None, vals, context=context)
return super(event_registration, self).create(
cr, uid, vals_reformated, context=context)
@api.model
def create(self, vals):
vals_reformated = self._reformat_phonenumbers_create(vals)
return super(EventRegistration, self).create(vals_reformated)
def write(self, cr, uid, ids, vals, context=None):
vals_reformated = self._generic_reformat_phonenumbers(
cr, uid, ids, vals, context=context)
return super(event_registration, self).write(
cr, uid, ids, vals_reformated, context=context)
@api.multi
def write(self, vals):
vals_reformated = self._reformat_phonenumbers_write(vals)
return super(EventRegistration, self).write(vals_reformated)

23
event_phone/event_view.xml

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
The licence is in the file __openerp__.py
© 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<openerp>
<odoo>
<data>
<record id="view_event_registration_form" model="ir.ui.view">
<field name="name">event_phone.event_registration.form</field>
<field name="model">event.registration</field>
@ -18,20 +19,6 @@
</field>
</record>
<record id="view_event_form" model="ir.ui.view">
<field name="name">event_phone.event.form</field>
<field name="model">event.event</field>
<field name="inherit_id" ref="event.view_event_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='registration_ids']/form//field[@name='phone']" position="attributes">
<attribute name="widget">phone</attribute>
</xpath>
<xpath expr="////field[@name='registration_ids']/tree/field[@name='phone']" position="attributes">
<attribute name="widget">phone</attribute>
</xpath>
</field>
</record>
</data>
</openerp>
</odoo>

4
hr_phone/hr_view.xml

@ -4,7 +4,7 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<odoo>
<data>
@ -46,4 +46,4 @@
</data>
</openerp>
</odoo>

19
hr_recruitment_phone/__init__.py

@ -1,22 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# HR Recruitment Phone module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# 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 hr_recruitment_phone

30
hr_recruitment_phone/__openerp__.py

@ -1,28 +1,10 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# HR Recruitment Phone module for OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# 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 -*-
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'HR Recruitment Phone',
'version': '8.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Validate phone numbers in HR Recruitment',
@ -46,8 +28,6 @@ for any help or question about this module.
'security/ir.model.access.csv',
'hr_recruitment_view.xml',
],
'images': [],
'installable': False,
'installable': True,
'auto_install': True,
'active': False,
}

46
hr_recruitment_phone/hr_recruitment_phone.py

@ -1,29 +1,11 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# HR Recruitment phone module for Odoo/OpenERP
# Copyright (c) 2012-2014 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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 -*-
# © 2012-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.osv import orm
from openerp import models, api
class hr_applicant(orm.Model):
class HrApplicant(models.Model):
_name = 'hr.applicant'
_inherit = ['hr.applicant', 'phone.common']
_phone_fields = ['partner_phone', 'partner_mobile']
@ -31,14 +13,12 @@ class hr_applicant(orm.Model):
_country_field = None
_partner_field = 'partner_id'
def create(self, cr, uid, vals, context=None):
vals_reformated = self._generic_reformat_phonenumbers(
cr, uid, None, vals, context=context)
return super(hr_applicant, self).create(
cr, uid, vals_reformated, context=context)
@api.model
def create(self, vals):
vals_reformated = self._reformat_phonenumbers_create(vals)
return super(HrApplicant, self).create(vals_reformated)
def write(self, cr, uid, ids, vals, context=None):
vals_reformated = self._generic_reformat_phonenumbers(
cr, uid, ids, vals, context=context)
return super(hr_applicant, self).write(
cr, uid, ids, vals_reformated, context=context)
@api.multi
def write(self, vals):
vals_reformated = self._reformat_phonenumbers_write(vals)
return super(HrApplicant, self).write(vals_reformated)

10
hr_recruitment_phone/hr_recruitment_view.xml

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
The licence is in the file __openerp__.py
© 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
-->
<openerp>
<odoo>
<data>
<record id="crm_case_form_view_job" model="ir.ui.view">
<field name="name">hr_recruitment_phone.hr_applicant.form</field>
<field name="model">hr.applicant</field>
@ -32,5 +33,6 @@
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save