2015-01-20 9:40 GMT-02:00 Albert Cervera i Areny <[email protected]>:
> 2015-01-20 12:16 GMT+01:00 Rafael do Nascimento Júnior <[email protected] > >: > > > > > > 2015-01-20 6:20 GMT-02:00 Sergi Almacellas Abellana <[email protected]>: > > > >> El 19/01/15 a les 17:00, Rafael do Nascimento Junior ha escrit: > >> > >>> Hi, > >>> > >>> I've installed the party_relationship module and I want to create a > >>> field in another module that searches all the contacts of the party. > >>> > >>> I have a class called Contact in work_order module. In Contact class I > >>> want to save the person who contacted me. The work_order has a party > and > >>> I want to search the contacts of this party. > >>> > >>> I did this > >>> > >>> relation = fields.Many2One('party.relation.all', 'Relation', > >>> domain=[('from_', '=', 'work_order.party')]) > >>> > >> I think you need a One2Many instead of a Many2One, as every party can be > >> related to multiple contacts. > >> > >> > >> > >> -- > >> Sergi Almacellas Abellana > >> www.koolpi.com > >> Twitter: @pokoli_srk > > > > > > > > Yes, I know that parties can be related to multiple contacts. But how > can I > > select one with domain? > > > > For instance, sale module has a M2O relation with party. When I click on > the > > icon to search one party, it shows me a list of parties and I can select > > one. > > > > I want to do the same with the contacts of a party. I have the party and, > > when I click the icon it shows me all its contacts and allows me to > select > > one. > > Maybe you'd want to take a look at sale_contact, > sale_opportunity_contact, purchase_contact modules > > > > > Thanks, > > > > -- > > > > Rafael Junior > > > > -- > Albert Cervera i Areny > Tel. 93 553 18 03 > @albertnan > www.NaN-tic.com > But what I want is not what has in this modules. I want to show the list of the contacts of a respective party and allow the user to select one. Why this domain does not work? relation = fields.Many2One('party.relation.all', 'Relation', domain=[('from_', '=', 'work_order.party')]) Thanks, -- Rafael Junior
