Allow closing protected legacy NCF ranges
Publicar paquete PyPI / publish (push) Successful in 1m42s
Publicar paquete PyPI / publish (push) Successful in 1m42s
This commit is contained in:
@@ -396,6 +396,28 @@ class NcfManagerTestCase(ModuleTestCase):
|
||||
with self.assertRaises(UserError):
|
||||
Manager.activate([manager])
|
||||
|
||||
@with_transaction()
|
||||
def test_finish_preserves_bound_legacy_migration_sequence(self):
|
||||
'Finishing must not invalidate an immutable historical sequence'
|
||||
pool = Pool()
|
||||
Manager = pool.get('ncf.manager')
|
||||
StrictSequence = pool.get('ir.sequence.strict')
|
||||
company = self._create_company()
|
||||
|
||||
line = self._create_ncf_sequence(company)
|
||||
strict_sequence = line.ncf_sequences
|
||||
StrictSequence.write([strict_sequence], {
|
||||
'prefix': 'MIG1',
|
||||
'padding': 9,
|
||||
})
|
||||
|
||||
Manager.finish([line.pos])
|
||||
|
||||
line = line.__class__(line.id)
|
||||
self.assertEqual(line.state, 'finished')
|
||||
self.assertEqual(line.ncf_sequences.id, strict_sequence.id)
|
||||
self.assertEqual(line.ncf_sequences.prefix, 'MIG1')
|
||||
|
||||
@with_transaction()
|
||||
def test_import_dgii_authorization_is_idempotent(self):
|
||||
pool = Pool()
|
||||
|
||||
Reference in New Issue
Block a user