Re: [tryton] New Module using existing database table(s)?

64 views
Skip to first unread message

Cédric Krier

unread,
Aug 31, 2012, 5:44:33 AM8/31/12
to try...@googlegroups.com
On 31/08/12 02:32 -0700, erik.vh wrote:
> Hi,
>
> Is there a possibility to start developing a new module, tarting from an
> existing database table?

Yes.

> If yes, what's the most convenient way to do this? How to get started?

You must create a ModelSQL that will use this table by setting the
attribute _table [1].

[1]
http://doc.tryton.org/2.4/trytond/doc/ref/models/models.html#trytond.model.ModelSQL._table

--
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/

Cédric Krier

unread,
Sep 4, 2012, 5:25:21 AM9/4/12
to try...@googlegroups.com
On 03/09/12 05:29 -0700, erik.vh wrote:
> Op vrijdag 31 augustus 2012 11:44:35 UTC+2 schreef Cédric Krier het
> volgende:
> >
> > On 31/08/12 02:32 -0700, erik.vh wrote:
> > > Hi,
> > >
> > > Is there a possibility to start developing a new module, tarting from an
> > > existing database table?
> >
> > Yes.
> >
> > > If yes, what's the most convenient way to do this? How to get started?
> >
> > You must create a ModelSQL that will use this table by setting the
> > attribute _table [1].
> >
> >
> OK, is it then possible that the python code for the class gets generated?

No, Tryton works the otherway, it is the class that define the table.

> Same question for Views and other UI elements, or is this coding a required
> manual effort.

Tryton will generate a default view for each missing view but they are
not the best views :-)
Reply all
Reply to author
Forward
0 new messages