Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
8671 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Автор

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!

Related Posts Відповіді Переглядів Дія
2
квіт. 24
2786
2
лип. 18
8589
1
січ. 22
3379
0
серп. 17
3683
0
груд. 15
5226