Auto Id

26 views
Skip to first unread message

pjalrimba rimbabara

unread,
May 18, 2012, 11:37:54 AM5/18/12
to tryton
Hai everybody I just to know how to make auto ID example
1,2,3,4,5,6,7,....

Please help me with coding

Cédric Krier

unread,
May 23, 2012, 7:19:51 AM5/23/12
to tryton
On 18/05/12 08:37 -0700, pjalrimba rimbabara wrote:
> Hai everybody I just to know how to make auto ID example
> 1,2,3,4,5,6,7,....

Please explain exactly what you want to do?
Because with such question, I will simply reply :-)

range(sys.maxint)

--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/

Triztian

unread,
May 24, 2012, 10:44:05 PM5/24/12
to try...@googlegroups.com
I think he means, on how to create an auto increment field, which is a question for which I'd like to know the answer too

regards.

Nicolas Évrard

unread,
May 25, 2012, 3:17:26 AM5/25/12
to try...@googlegroups.com
* Triztian [2012-05-25 04:44 +0200]:
>I think he means, on how to create an auto increment field, which is a
>question for which I'd like to know the answer too

Why do you want another auto increment field when you already have the
id column ?

--
Nicolas Évrard

B2CK SPRL
rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
E-mail/Jabber: nicolas...@b2ck.com
Website: http://www.b2ck.com/
signature.asc

Cédric Krier

unread,
May 25, 2012, 3:17:35 AM5/25/12
to try...@googlegroups.com
On 24/05/12 19:44 -0700, Triztian wrote:
> I think he means, on how to create an auto increment field, which is a
> question for which I'd like to know the answer too

There is no such functionnality but Tryton put an id on each Model.

--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59

Jean Cavallo

unread,
May 25, 2012, 3:19:39 AM5/25/12
to try...@googlegroups.com
Why do you want another auto increment field when you already have the
id column ?

He may be talking of something more like a sequence generator
(Administration => Sequence) ?

Jean CAVALLO

Cédric Krier

unread,
May 25, 2012, 4:25:52 AM5/25/12
to try...@googlegroups.com
So here is an example:
http://hg.tryton.org/modules/sale/file/b327f5a0bff1/sale.py#l679

--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59

Tristian Paul Lopez Azuara

unread,
May 28, 2012, 10:36:03 PM5/28/12
to try...@googlegroups.com
Actually, as Cedric mentioned, tryton does generate an Id automatically, you can view 
it in the tree view by placing the field id in the CDATA of a tree view: 

                <tree string="Inventory Parts">
                     <field name="id" />
                </tree>


 Hope it helps.
Reply all
Reply to author
Forward
0 new messages