Pedro M. Baeza
8 years ago
8 changed files with 51 additions and 126 deletions
-
1partner_sector/README.rst
-
2partner_sector/__openerp__.py
-
0partner_sector/i18n/.gitkeep
-
106partner_sector/i18n/partner_sector.pot
-
9partner_sector/models/res_partner_sector.py
-
2partner_sector/tests/__init__.py
-
17partner_sector/tests/test_res_partner.py
-
40partner_sector/tests/test_res_partner_sector.py
@ -1,106 +0,0 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * partner_sector |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: Odoo Server 8.0\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2015-12-17 13:49+0000\n" |
|||
"PO-Revision-Date: 2015-12-17 13:49+0000\n" |
|||
"Last-Translator: <>\n" |
|||
"Language-Team: \n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Plural-Forms: \n" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,child_ids:0 |
|||
msgid "Children" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,create_uid:0 |
|||
msgid "Created by" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,create_date:0 |
|||
msgid "Created on" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,id:0 |
|||
msgid "ID" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,write_uid:0 |
|||
msgid "Last Updated by" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,write_date:0 |
|||
msgid "Last Updated on" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner,sector_id:0 |
|||
msgid "Main Sector" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,name:0 |
|||
msgid "Name" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,parent_left:0 |
|||
msgid "Parent Left" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,parent_right:0 |
|||
msgid "Parent Right" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner.sector,parent_id:0 |
|||
msgid "Parent id" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: model:ir.model,name:partner_sector.model_res_partner |
|||
msgid "Partner" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: view:res.partner:partner_sector.view_res_partner_filter_sector |
|||
msgid "Salesperson" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: field:res.partner,secondary_sector_ids:0 |
|||
msgid "Secondary Sectors" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: model:ir.model,name:partner_sector.model_res_partner_sector |
|||
#: view:res.partner:partner_sector.view_partner_form_sector |
|||
#: view:res.partner:partner_sector.view_res_partner_filter_sector |
|||
msgid "Sector" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action |
|||
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector |
|||
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view |
|||
msgid "Sectors" |
|||
msgstr "" |
|||
|
|||
#. module: partner_sector |
|||
#: code:addons/partner_sector/models/res_partner.py:21 |
|||
#, python-format |
|||
msgid "The main sector must be different from the secondary sectors." |
|||
msgstr "" |
@ -1,17 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
|||
# © 2016 Tecnativa S.L. - Vicent Cubells |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from openerp.tests.common import TransactionCase |
|||
from openerp.exceptions import ValidationError |
|||
|
|||
|
|||
class TestResPartner(TransactionCase): |
|||
|
|||
def test_check_sectors(self): |
|||
sector = self.env['res.partner.sector'].create({'name': 'Test'}) |
|||
with self.assertRaises(ValidationError): |
|||
self.env['res.partner'].create( |
|||
{'name': 'Test', 'sector_id': sector.id, |
|||
'secondary_sector_ids': [(4, sector.id)]}) |
@ -0,0 +1,40 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
|||
# © 2016 Tecnativa S.L. - Vicent Cubells |
|||
# © 2016 Tecnativa S.L. - Pedro M. Baeza |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from openerp.tests import common |
|||
from openerp.exceptions import ValidationError |
|||
|
|||
|
|||
class TestResPartnerSector(common.SavepointCase): |
|||
@classmethod |
|||
def setUpClass(cls): |
|||
super(TestResPartnerSector, cls).setUpClass() |
|||
cls.Sector = cls.env['res.partner.sector'] |
|||
cls.sector_main = cls.Sector.create({ |
|||
'name': 'Test', |
|||
}) |
|||
cls.sector_child = cls.Sector.create({ |
|||
'name': 'Test child', |
|||
'parent_id': cls.sector_main.id, |
|||
}) |
|||
|
|||
def test_check_sectors(self): |
|||
with self.assertRaises(ValidationError): |
|||
self.env['res.partner'].create({ |
|||
'name': 'Test', |
|||
'sector_id': self.sector_main.id, |
|||
'secondary_sector_ids': [(4, self.sector_main.id)], |
|||
}) |
|||
|
|||
def test_check_recursion(self): |
|||
with self.assertRaises(ValidationError): |
|||
self.sector_main.parent_id = self.sector_child.id |
|||
|
|||
def test_name(self): |
|||
self.assertEqual( |
|||
self.sector_child.name_get()[0][1], |
|||
"Test / Test child", |
|||
) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue