Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5138 Visualizzazioni

Hello !

 
Here is my structure : I have my main model that is linked to product.product thanks to a many2many field.

 

I can already link products to my main model from my model but now i would like to create this link starting from a list of selected products in a tree view (or one product from form view). This means i would like to call a ir_values structure linked to product model. When i click on this action it would show me list of all the records from my main model and i would select one to erase any products that is already link to it to replace by the previously selected ones.
 
I hope i'm clear enough on my needs.

 

I know the existence of workflows and wizard but i don't understand in which situation i should use one or the other.
I already have my button/smart button present on product's form and tree view, i just don't know what to put in the action function to display all records of the model to link with.

If you could enlighten me on these points i would be very thankful !
 

Avatar
Abbandona
Risposta migliore

In your action just make a domain to filter out with the related field. In the case of products you should have a relation with the product_id Many2one field, and in the domain just make condition satisfies with your current product Id.

eg:

'domain': [('product_id', '=', active_id)],
or you can use context as like for sales info on partner view.
<field name="context">{'search_default_partner_id': active_id, 'show_sale': True}</field>
for this you have to make a search view.



Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
gen 25
1220
1
nov 24
1394
1
mar 16
3135
2
mar 15
5726
1
mar 15
6880