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

i have a many2one field. It is in a line(part of tree for one2many.)

<tree string="PLD" editable="bottom">                               

<field name="priority_set" />                         

<field name="shop_id"  domain="[('is_shop', '=', True),('usage','=','internal')]"    options="{'no_open':True,'no_create':1,'no_create_edit':1}" />          //shop_id = fields.many2one('stock.location')                     

<field name="temp_id"      options="{'no_open':True,'no_create':1,'no_create_edit':1}" />                           

</tree>

i want to select a shop for 1st line. In the 2nd line, the selected shop value should not be shown in the many2one dropdown. How can it be done?

Avatar
Abbandona
Risposta migliore

Hai Tanvir Faisal,

You can done it by different ways.

One solution is here.

Just add a Many2many field in the model that One2many field exist. write a function in the onchange of your Many2one field.inside the function write the selected Many2one value to the Many2many field. pass the Many2many value through context to the One2many field from the model of One2many. you can put it that context value in your domain.


Thank you.

Avatar
Abbandona
Autore

Can you explain a bit more? I am new in odoo...may be thats why i am not visualizing it !

In my case, in line, when user 1st selects any shop from dropdown, in the next line, the previously selected shop should not be shown in the dropdown. Thanks!

Post correlati Risposte Visualizzazioni Attività
2
apr 24
2790
2
lug 18
8590
1
gen 22
3380
0
ago 17
3685
0
dic 15
5233