-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] crm_location: Migrated to 10.0
- Loading branch information
1 parent
e77d85c
commit 7461c1b
Showing
8 changed files
with
90 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright : | ||
# (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) | ||
# Endika Iglesias <endikaig@antiun.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/>. | ||
# | ||
############################################################################## | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright : | ||
# (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) | ||
# Endika Iglesias <endikaig@antiun.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/>. | ||
# | ||
############################################################################## | ||
# Copyright 2015 Antiun Ingenieria - Endika Iglesias <endikaig@antiun.com> | ||
# Copyright 2017 Tecnativa - Luis Martínez | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
{ | ||
'name': 'CRM location', | ||
'category': 'Customer Relationship Management', | ||
'version': '8.0.1.0.0', | ||
'version': '10.0.1.0.0', | ||
'depends': [ | ||
'crm', | ||
'base_location', | ||
], | ||
'data': ['views/crm_lead_view.xml'], | ||
'author': 'Antiun Ingeniería S.L., ' | ||
'author': 'Tecnativa, ' | ||
'Odoo Community Association (OCA)', | ||
'website': 'http://www.antiun.com', | ||
'website': 'https://www.tecnativa.com', | ||
'license': 'AGPL-3', | ||
'installable': False, | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# Python source code encoding : https://www.python.org/dev/peps/pep-0263/ | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright : | ||
# (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com) | ||
# Endika Iglesias <endikaig@antiun.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/>. | ||
# | ||
############################################################################## | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import crm_lead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 | ||
|
||
from . import test_crm_location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Tecnativa - Luis M. Ontalba | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 | ||
|
||
from odoo.tests import common | ||
|
||
|
||
class TestCrmLocation(common.SavepointCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
super(TestCrmLocation, cls).setUpClass() | ||
cls.country = cls.env['res.country'].create({ | ||
'name': 'Country test', | ||
}) | ||
cls.state = cls.env['res.country.state'].create({ | ||
'name': 'Test state', | ||
'code': 'Test state code', | ||
'country_id': cls.country.id, | ||
}) | ||
cls.location = cls.env['res.better.zip'].create({ | ||
'name': '12345', | ||
'city': 'Test city', | ||
'country_id': cls.country.id, | ||
'code': 'Test code', | ||
'state_id': cls.state.id, | ||
}) | ||
cls.lead = cls.env['crm.lead'].create({ | ||
'name': 'Test lead', | ||
}) | ||
cls.partner = cls.env['res.partner'].create({ | ||
'name': 'Test partner name', | ||
}) | ||
|
||
def test_on_change_city(self): | ||
lead = self.lead | ||
location = self.location | ||
lead.location_id = location.id | ||
lead.on_change_city() | ||
self.assertEqual(lead.zip, location.name) | ||
self.assertEqual(lead.city, location.city) | ||
self.assertEqual(lead.state_id, location.state_id) | ||
self.assertEqual(lead.country_id, location.country_id) | ||
|
||
def test_onchange_partner_id_crm_location(self): | ||
lead = self.lead | ||
partner = self.partner | ||
location = self.location | ||
partner.zip_id = location.id | ||
lead.partner_id = partner.id | ||
lead.onchange_partner_id_crm_location() | ||
self.assertEqual(lead.location_id, partner.zip_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters