From 0285a2d3901c40adc191435e419a2fdbd416a804 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Wed, 17 Apr 2019 14:58:06 -0300 Subject: [PATCH] add tooltip to create group of taxes --- tests/__init__.py | 4 ++-- tests/{tests.py => test_account_invoice.py} | 0 tests/tools.py | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) rename tests/{tests.py => test_account_invoice.py} (100%) diff --git a/tests/__init__.py b/tests/__init__.py index b0039cc..7cd843b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,8 +2,8 @@ # this repository contains the full copyright notices and license terms. try: - from trytond.modules.account_invoice_ar.tests.tests import suite + from trytond.modules.account_invoice_ar.tests.test_account_invoice_ar import suite except ImportError: - from .tests import suite + from .test_account_invoice_ar import suite __all__ = ['suite'] diff --git a/tests/tests.py b/tests/test_account_invoice.py similarity index 100% rename from tests/tests.py rename to tests/test_account_invoice.py diff --git a/tests/tools.py b/tests/tools.py index 6ee19c4..8dd1b64 100644 --- a/tests/tools.py +++ b/tests/tools.py @@ -77,3 +77,19 @@ def get_invoice_types(company=None, pos=None, config=None): ]) invoice_types = {i.invoice_type: i for i in invoice_types} return invoice_types + + +def create_tax_groups(company=None, config=None): + "Create tax groups" + TaxGroup = Model.get('account.tax.group', config=config) + types = ['iva', 'nacional', 'iibb', 'municipal', 'interno'] + groups = {} + + for type in types: + group = TaxGroup() + group.name = type + group.code = type + group.kind = 'both' + group.save() + groups[type] = group + return groups