first commit

This commit is contained in:
root
2026-03-14 09:42:12 +00:00
commit 0adbd20c2c
10991 changed files with 1646955 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,54 @@
==================================
Document Incoming Invoice Scenario
==================================
Imports::
>>> from proteus import Model
>>> from trytond.modules.account.tests.tools import create_chart, create_fiscalyear
>>> from trytond.modules.account_invoice.tests.tools import (
... set_fiscalyear_invoice_sequences)
>>> from trytond.modules.company.tests.tools import create_company, get_company
>>> from trytond.tests.tools import activate_modules, assertEqual
Activate modules::
>>> config = activate_modules(
... 'document_incoming_invoice', create_company, create_chart)
>>> Document = Model.get('document.incoming')
>>> DocumentConfiguration = Model.get('document.incoming.configuration')
>>> Party = Model.get('party.party')
Get company::
>>> company = get_company()
Create fiscal year::
>>> fiscalyear = set_fiscalyear_invoice_sequences(create_fiscalyear())
>>> fiscalyear.click('create_period')
Set default supplier::
>>> suppplier = Party(name="Supplier")
>>> suppplier.save()
>>> document_configuration = DocumentConfiguration(1)
>>> document_configuration.default_supplier = suppplier
>>> document_configuration.save()
Create incoming document::
>>> document = Document()
>>> document.name = 'invoice.pdf'
>>> document.data = b'invoice'
>>> document.company = company
>>> document.type = 'supplier_invoice'
>>> document.save()
Process document::
>>> document.click('process')
>>> invoice = document.result
>>> assertEqual(invoice.party, suppplier)

View File

@@ -0,0 +1,11 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.tests.test_tryton import ModuleTestCase
class DocumentIncomingInvoiceTestCase(ModuleTestCase):
"Test Document Incoming Invoice module"
module = 'document_incoming_invoice'
del ModuleTestCase

View File

@@ -0,0 +1,8 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.tests.test_tryton import load_doc_tests
def load_tests(*args, **kwargs):
return load_doc_tests(__name__, __file__, *args, **kwargs)