allow route-id to be optional
This commit is contained in:
parent
004f35ad13
commit
61cf85eb0b
14 changed files with 132 additions and 10 deletions
|
@ -11,6 +11,7 @@ from datetime import date
|
|||
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.edocument_uncefact.tests.test_edocument_uncefact import get_invoice
|
||||
from trytond.exceptions import UserError
|
||||
from unittest.mock import Mock
|
||||
from decimal import Decimal
|
||||
|
||||
|
@ -19,6 +20,34 @@ class EdocTestCase(ModuleTestCase):
|
|||
'Test e-rechnung module'
|
||||
module = 'edocument_xrechnung'
|
||||
|
||||
@with_transaction()
|
||||
def test_xrechn_check_validator(self):
|
||||
""" check validation of optional route-id
|
||||
"""
|
||||
Party = Pool().get('party.party')
|
||||
|
||||
party, = Party.create([{'name': 'P1'}])
|
||||
self.assertEqual(party.xrechnung_routeid, False)
|
||||
|
||||
Party.write(*[
|
||||
[party],
|
||||
{
|
||||
'xrechnung_routeid': True,
|
||||
'identifiers': [('create', [{
|
||||
'type': 'edoc_route_id',
|
||||
'code': '1234'}])]}])
|
||||
self.assertEqual(party.xrechnung_routeid, True)
|
||||
self.assertEqual(party.get_xrechnung_route_id(), '1234')
|
||||
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
"No XRechnung routing ID is stored for the party 'P1'.",
|
||||
Party.write,
|
||||
*[
|
||||
[party],
|
||||
{'identifiers': [('delete', [party.identifiers[0].id])]}]
|
||||
)
|
||||
|
||||
@with_transaction()
|
||||
def test_xrechn_export_xml_invoice(self):
|
||||
""" run export - invoice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue