On 21 Jun 03:52, Markus Bala wrote:
> Below is the python code to get the table for the "acccount_account":
> 
>  Account = pool.get('account.account')
>  account = Account.__table__()
> 
> How to call the view?
> 
> 
> Example of my view (only for example):
> create view AccountMoveView as
> select party.name, acc.name from account_move_line aml
> inner join account_account acc on acc.id = aml.account
> inner join party_party party on aml.party = party.id
> 
> How am I going to call "AccountMoveView" in the python code?

You have to create a ModelSQL for which you override the method
table_query then no table will be created for it but it will use the
query of this method as base table.

http://doc.tryton.org/3.2/trytond/doc/ref/models/models.html?highlight=sql#trytond.model.ModelSQL.table_query

PS: Such question are better on tryton@ because tryton-dev@ is about the
development of Tryton.

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

Attachment: pgpIOpviz_O7P.pgp
Description: PGP signature

Reply via email to