Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6749 Zobrazení

Hi,

I have a one2many field. I would like to block the "create and Edit" when referring it in another class.

The below are Working

Field with domain filter

<field name="prod_ser_no_id" domain="[('product_id','=',parent.product_id)]"
    on_change="onchange_serial_id(prod_ser_no_id)" />

Field with selection widget

<field name="prod_ser_no_id" on_change="onchange_serial_id(prod_ser_no_id)" widget="selection"/>

The below is not Working

Field with domain filter and selection widget

<field name="prod_ser_no_id" domain="[('product_id','=',parent.product_id)]"
    on_change="onchange_serial_id(prod_ser_no_id)" widget="selection"/>

Thanks for your help and please revert me for clarifications.

Avatar
Zrušit

Hi,,I used the below code but the domain part not working..Please help me to solve this..Thanks

'moves': fields.many2many('stock.production.lot','out_grn_lines','grn_id','lot_id', 'GRN Entry', domain="[('product_id','=','product_id')]" ,readonly=True, states={'confirmed':[('readonly', False)],'assigned':[('readonly',False)]}),

Nejlepší odpověď

Hello All,

If you want many2one Field with domain filter and selection widget, it will not allow.

but you can remove 'Create and Edit...' from many2one field and it looks like a selection widget.

Please follows the steps:

1: Go to : web/addons/web/static/src/js

2: Open view_form.js

3: Go to line number : 2958 or find 'Create and Edit...'

4: remove this line.

Enjoy you can not see the 'Create and Edit...' option.

Note : This will affect each many2one field (version 7.0).

Thanks,

Bipin Rathod,

Serpent Consulting Services Pvt. Ltd.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvc 25
138
0
čvc 25
3
0
čvc 25
200
1
čvc 25
299
0
čvc 25
247