コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8694 ビュー

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!

関連投稿 返信 ビュー 活動
2
4月 24
2798
2
7月 18
8598
1
1月 22
3383
0
8月 17
3693
0
12月 15
5239