Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
8704 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor

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!

Powiązane posty Odpowiedzi Widoki Czynność
2
kwi 24
2798
2
lip 18
8601
1
sty 22
3386
0
sie 17
3693
0
gru 15
5240