5.0: compatibility to Tryton 5.0

This commit is contained in:
Frederik Jaeckel 2024-12-11 18:06:33 +01:00
parent 6b33fdfd2f
commit da12aac254
8 changed files with 15 additions and 41 deletions

View file

@ -18,16 +18,10 @@ from .xml_data import xml_from_pdf
def set_invoice_sequences(fiscalyear):
pool = Pool()
Sequence = pool.get('ir.sequence.strict')
SequenceType = pool.get('ir.sequence.type')
InvoiceSequence = pool.get('account.fiscalyear.invoice_sequence')
ModelData = pool.get('ir.model.data')
sequence = Sequence(
name=fiscalyear.name,
sequence_type=SequenceType(ModelData.get_id(
'account_invoice', 'sequence_type_account_invoice')),
company=fiscalyear.company,
)
sequence = Sequence(name=fiscalyear.name, code='account.invoice')
sequence.company = fiscalyear.company
sequence.save()
fiscalyear.invoice_sequences = []
invoice_sequence = InvoiceSequence()
@ -132,7 +126,7 @@ class InvoiceTestCase(ModuleTestCase):
'addresses': [('create', [{
'invoice': True,
'street': 'Applicant Street 1',
'postal_code': '12345',
'zip': '12345',
'city': 'Usertown',
'country': country_de.id,
}])],
@ -199,7 +193,7 @@ class InvoiceTestCase(ModuleTestCase):
self.assertEqual(
list(result['view']['defaults'].keys()), [
'as_zip', 'edocument', 'invoice', 'state',
'invoice.'])
'invoice.rec_name'])
data = {}
for x in result['view']['defaults'].keys():
@ -225,7 +219,6 @@ class InvoiceTestCase(ModuleTestCase):
action['report_name'],
'account_invoice_xrechnung.export')
self.assertEqual(action['type'], 'ir.action.report')
self.assertEqual(action['records'], 'selected')
# 2nd step, wizard told us which report we must execute
ReportExport = pool.get(