Default manual fiscal sequences to current company
Publicar paquete PyPI / publish (push) Successful in 1m5s
Publicar paquete PyPI / publish (push) Successful in 1m5s
This commit is contained in:
@@ -307,6 +307,9 @@ class NCFManagerSequences(Workflow, ModelSQL, ModelView):
|
||||
depends=_depends, sort=False)
|
||||
|
||||
ncf_sequences = fields.Many2One('ir.sequence.strict', 'Fiscal Sequence',
|
||||
context={
|
||||
'company': Eval('company', -1),
|
||||
},
|
||||
domain=[
|
||||
['OR',
|
||||
('company', '=', Eval('company', -1)),
|
||||
|
||||
@@ -374,6 +374,17 @@ class NcfManagerTestCase(ModuleTestCase):
|
||||
|
||||
self.assertEqual(line.ncf_sequences, strict_sequence)
|
||||
|
||||
@with_transaction()
|
||||
def test_manual_sequence_creation_defaults_to_current_company(self):
|
||||
'Manual sequence creation uses the current company from context'
|
||||
StrictSequence = Pool().get('ir.sequence.strict')
|
||||
company = self._create_company()
|
||||
|
||||
with Transaction().set_context(company=company.id):
|
||||
defaults = StrictSequence.default_get(['company'])
|
||||
|
||||
self.assertEqual(defaults['company'], company.id)
|
||||
|
||||
@with_transaction()
|
||||
def test_overlap_is_independent_by_invoice_direction(self):
|
||||
'A supplier range must not block the company outgoing authorization'
|
||||
|
||||
Reference in New Issue
Block a user