setting sequence.number_next[_internal] via proteus

28 views
Skip to first unread message

Richard PALO

unread,
Sep 20, 2017, 1:26:37 PM9/20/17
to try...@googlegroups.com
I'm curious how to currectly set the next_number_internal for an ir.sequence,
namely for reconciliations using proteus.

Setting, for example, seq.prefix='A' works just fine but seq.number_next_internal=10 seems to be a no-op.

Using the tryton client, I can change the sequence manually from the sequences form, is that the
only way to do it? Hints on doing so?

I tried Sequence.write([seq.id], {'number_next_internal': 10,})
but I get:
> TypeError: write() missing 1 required positional argument: 'values'

cheers
--

Richard PALO

Cédric Krier

unread,
Sep 20, 2017, 6:15:06 PM9/20/17
to try...@googlegroups.com
On 2017-09-20 19:26, Richard PALO wrote:
> I'm curious how to currectly set the next_number_internal for an ir.sequence,
> namely for reconciliations using proteus.
>
> Setting, for example, seq.prefix='A' works just fine but seq.number_next_internal=10 seems to be a no-op.
>
> Using the tryton client, I can change the sequence manually from the sequences form, is that the
> only way to do it? Hints on doing so?

You should write 'number_next' which is the field show in the UI.
It is because the sequence could be a SQL sequence and so
number_next_internal will not be used.

> I tried Sequence.write([seq.id], {'number_next_internal': 10,})
> but I get:
> > TypeError: write() missing 1 required positional argument: 'values'

If you call raw API from proteus, you must always add the context as
last parameter.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Richard PALO

unread,
Sep 21, 2017, 9:16:01 AM9/21/17
to tryton
Le 21/09/2017 à 00:11, Cédric Krier a écrit :
> On 2017-09-20 19:26, Richard PALO wrote:
>> I'm curious how to currectly set the next_number_internal for an ir.sequence,
>> namely for reconciliations using proteus.
>>
>> Setting, for example, seq.prefix='A' works just fine but seq.number_next_internal=10 seems to be a no-op.
>>
>> Using the tryton client, I can change the sequence manually from the sequences form, is that the
>> only way to do it? Hints on doing so?
>
> You should write 'number_next' which is the field show in the UI.
> It is because the sequence could be a SQL sequence and so
> number_next_internal will not be used.
> ... >8

Guess I was misled by the what I saw in the module file sequence.py, namely:
>
> # Migration from 2.0 rename number_next into number_next_internal
> table.column_rename('number_next', 'number_next_internal')
>
>

Seems to work much better! Kudos.

cheers,
--

Richard PALO
Reply all
Reply to author
Forward
0 new messages