How to get the default party address

23 views
Skip to first unread message

Vincent Bastos

unread,
Mar 8, 2016, 7:42:30 AM3/8/16
to tryton
Hi,

I was wondering how I can "get" the default party address. I think that by convention the first address is the default one.

Is it as simple as something like lease.party.address?

lease is an model with a Many2One field party.party.

Thanks.

Sergi Almacellas Abellana

unread,
Mar 8, 2016, 7:53:28 AM3/8/16
to try...@googlegroups.com
El 08/03/16 a les 13:42, Vincent Bastos ha escrit:
> Hi,
>
> I was wondering how I can "get" the default party address. I think that
> by convention the first address is the default one.
>
> Is it as simple as something like lease.party.address?

It seems you are searching address_get method [1]

[1] http://hg.tryton.org/modules/party/file/6716ff45f83e/party.py#l204

>
> lease is an model with a Many2One field party.party.
>
> Thanks.
>
> --
> 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/a917ea82-5739-4b60-9412-ba3677c9caa9%40googlegroups.com
> <https://groups.google.com/d/msgid/tryton/a917ea82-5739-4b60-9412-ba3677c9caa9%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Vincent Bastos

unread,
Mar 8, 2016, 7:56:14 AM3/8/16
to try...@googlegroups.com
On Tue, Mar 8, 2016 at 10:53 PM, Sergi Almacellas Abellana <se...@koolpi.com> wrote:
El 08/03/16 a les 13:42, Vincent Bastos ha escrit:
Hi,

I was wondering how I can "get" the default party address. I think that
by convention the first address is the default one.

Is it as simple as something like lease.party.address?

It seems you are searching address_get method [1]

[1] http://hg.tryton.org/modules/party/file/6716ff45f83e/party.py#l204

Thanks mate! 


--
Vincent Bastos
Lava Lab Software

Vincent Bastos

unread,
Mar 8, 2016, 8:14:48 AM3/8/16
to try...@googlegroups.com
I am actually using 3.4 so the method is address_get in my case. 
Reply all
Reply to author
Forward
0 new messages