Re: [tryton] setting sequence.number_next[_internal] via proteus

2017-09-21 Thread Richard PALO

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

--
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/5cb0e2f0-8158-abaa-e699-284261c403b6%40free.fr.


Re: [tryton] setting sequence.number_next[_internal] via proteus

2017-09-20 Thread Cédric Krier
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.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20170920221120.GN3532%40kei.


[tryton] setting sequence.number_next[_internal] via proteus

2017-09-20 Thread Richard PALO

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

--
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/ae573768-8249-118e-76ac-0c3b4cbb38ad%40free.fr.