I have a tree view in my custom module. When user clicks on an item of tree view it takes user to the form view and user have to click edit button in order to edit the form. I want to open the form view automatically in edit mode. So, user didn't have to click specially on Edit button
Pls try with this in ir.actions.act_window:
<field name='flags'>{'initial_mode': 'edit'}</field>
Use this:
In form's ir.actions.act_window record add:
<field name='target'>inline</field>
Related
I'm working on a Laravel-admin project with Laravel9 and I have an edit form that fetches a single piece of data from the DB and updates it.
Therefore, I don't want to have a grid panel or create form.
Is there any way to remove the grid panel and create form and show only the edit form when people visit the page?
I'm a newbie and I don't know much about it.
Any advise would be appreciated.
1.Changed the path to this but showed grid panel:
http://localhots/admin/management/1/edit
2.Tried to put $form in $grid, grid panel didn't show up but a create form with create button was displayed.
There is no Save / Cancel button in the create and edit pop up of a many2many relation.
Buttons appear only in debug mode.
Any idea ?
check the rules and if in the xml the button's attribute invisible are true
Is it possible hide button in odoo ir.model.access.csv security file.
For example on form I have two button (Button 1 and Button 2) admin can see both button, user only Button 1.
Any simple solution?
If these are buttons on a form view you can show Button 2 only for certain user groups for by adding a groups attribute on it, eg.:
<button string="Button 2" groups="base.group_system" name="..." type="..."/>
This will only show Button 2 to users belonging to the Administration -> Settings group.
I have added a button to existing form of purchase order in Purchase order Line Tree. But i want to show that button only in edit mode. I tried:
<button name="adjust_received_qty" string="⇒ Adjust" type="object" class="oe_edit_only"/>
i tried to put class = oe_read_only, but it does not work in odoo 8.
Thanks,
UPDATE
My requirement is : i want to show the button when user clicks edit button. if i use the suggested approach, i will able to hide button in create view.but it will be visible in form view even in view mode. I want to show the button only in edit view ( when user clicks the edit button )
Please Help,
try class=oe_edit_only
it's working fine for me
Standard Odoo work must be using python+xml in general, and it's not recommended to use javascript long codes with it because it may cause performance problems.
I've not done this but I think you can achieve this using javascript and add on click event listener on edit button and use show()-hide() function on the fields/button which you want to hide/show so it may help you to solve this issue.
Maybe digging in deep odoo codes may give you another solutions who knows :D
I have created a menu item- 'Personal Profile'.
On click, it should open the candidate profile in a form view.
I have set rules so that each candidate can see only his/her profile.
In action part of the menu I have - defined view_type as form & view_mode as form,kanban
But,by default on click of the menu item a new form is opened for create.
Instead I want my existing record form view(i.e user/candidate profile) should be displayed every time when I click the menu item.
Please Help..
You need to save the user data in preferences (user defaults) or plist file,database any of these data source.
Than on click you need to check if data exist in these data source than fetch and fill out data in form or if no data exist than open blank form.