Friends, Need to remove this option from pop up manyone fields. (not in all fields.some fields need to remove this feature).i used widget="selection".then my domain filter not working.so please help me to find a solution.
45 Відповіді
hi,
I reopen this question because priyankahdp link is out, and I think no answer have been written.
So, For this need, I wrote a new OpenERP V7 module web_m2o_enhanced
that add some options tu many2one field xml definition:
create
: true/false -> disable "create" entry in dropdown panelcreate_edit
: true/false -> disable "create and edit" entry in dropdown panellimit
: 10 (int) -> change number of selected record return in dropdown panelm2o_dialog
: true/false -> disable quick create M20Dialog triggered on error.
Example:
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
you can clone it from github web_m2o_enhanced repo
Update:
- 29/05/2013: we add using of access right to show
create
orcreate and edit
if you what write access on linked object by default. - Openerp provide by default a
no_open
option to disable right edit item for many2one widget. - 23/09/2013: Be sure to reload openerp web page after installing this module and have an empty javascript cache !
- 15/10/2013: Now support many2manytag widget ! (OpenERP help)
- 2/12/2013: Now in community modules: https://www.openerp.com/apps/7.0/web_m2x_options/
Nicolas you should be knighted for this, I have started working on the exact same module and to see it written is a relief! Thank you for the wonderful contribution, the need for this module is pretty high!
One thing though, when typing something in the many2one that does not exist on the other side and pressing tab (field losing focus) a quick-create form pops up that yet again enabled the user to create the object himself.Do you know if anything could be done about that?
Sincere regards! Paul
Ok now you can directly install this: https://www.openerp.com/apps/7.0/web_m2x_options/ (from openerp apps) this is the same module but released with community.
What browser do you use ?
Yes a propose a merge in community web-addons one day before and wait for review and approve. https://code.launchpad.net/~0k.io/web-addons/7.0_web_m2x_options_fix_can_create_2
This issue is ok in this revision / branch .. will be soon approved :)
Hi Boris,
U can try adding an attribute "options" to the field where u want to hide "create and edit" option in xml file as:
< field name=[name] options="{'no_quick_create':True,'no_create_edit':True}"/>
This will possibly solve your problem.
thanks
How to install the web_m2o_enhanced addon ?
I put this to my xml view
<field name="codetype" options="{'create': false, 'create_edit': false}"/>
But i always see the create edit link
Hello, I have updated your module, but still the same result. I have no idea what I'm doing wrong, so here is my view:
<record id="product_normal_form_view_intrastat" model="ir.ui.view"> <field name="name">product.normal.form.intrastat</field> <field name="model">product.product</field> <field name="inherit_id" ref="product.product_normal_form_view"/> <field name="arch" type="xml"> <field name="product_manager" position="after"> <field name="intrastat_id" options="{'create': false, 'create_edit': false}"/> </field> </field> </record>
I will check on my install to see what is wrong .. I think this view is update by an other after your mods. you use a personnal module ? can you say where you define intrastat_id ? Can you check on an other field that this works ? Can you check in debug mode and using your browser debug tools that web_m2o_enahnced js is correctly load ?
Hello priyankahdp,
Please use below code.
<attribute name="options">{'no_create_edit': True, 'no_create':True, 'no_open':True}</attribute>
or
<attribute name="widget">selection</attribute>
I hope this help you.
Best Thanks,
Ankit H Gandhi.
Hi ,
Perhaps you can use text widget , such as <field name="division_id" /> with nothing specified in the field tag.
But in the first place why do u want to remove it ? and what do you mean by domain filter not working ? (the model that you are working on or the one2many field e.g. division that show in your screen that is not working ?
yes friend.its not working.in here i can insert records without parent company also.then domain filter may useless & user can create estates without company
refer my codes in github https://github.com/priyankahdp/openerp/
Add widget="selection"