I want to get a treview editable inline, I want also to disable the button create.
the problem is: when I hide the button create ( with the arrtibute create=false)
I can't save my edition on the tree.
try as follow. and when put the cursor on "pod_date" field, keying the data and press the "Enter" key. the data will record into the db table.
<tree string="Picking list" create="false">
<field name="sale_id" readonly="1"/>
<field name="pod_date" />
</tree>
Related
In Odoo 12, I've defined a form containing a One2many field.
<field name="child_ids">
<tree>
<field name="child_attr"/>
</tree>
</field>
In both models (parent and child), all fields are defined as readonly=True. Clicking on a line of child_ids's list yields a popup, a behavior I'd like to suppress.
So far I have tried, in all possible combinations, to no avail:
adding create="false" edit="false" editable="bottom" to the <tree> tag (and some variations)
adding options="{'no_create': True, 'no_open': True}" to the <field> tag
creating an extra ir.actions.act_window for child_ids's model that includes only tree as view_mode
creating an empty form definition for child_ids's model (this opens an empty popup)
What am I missing?
I guess You have only created the tree view means form view used is default view meaning options="{'no_open': True}" is not for the form view
make form view also and add options="{'no_open': True}" as you yourself suggested and it should work
Good Day! is it possible to disable pop of tree view in the form. I tried no_open="True" readonly="1" edit="False" both on field and tree view but didn't worked.
<field name="payment_line">
<tree editable="top" create="false">
<field name="product"/>
<field name="description"/>
<field name="account"/>
<field name="unit"/>
<field name="qty"/>
<field name="amount"/>
<field name="total"/>
</tree>
</field>
I've coped with the same issue in odoo 10, my one2many treeview always make a popup on click. No matter editable='bottom' option was set.
Suddenly I've found web_tree_no_open module from codingforfun, that adds a new option:
< tree open="false" >
It's for version 8 but it can be used in 10 just renaming openerp.py to manifest.py
It can be downloaded from here:
https://github.com/initOS/web/tree/8.0-tree-view-no-select/web_tree_no_open
Worked for me, I hope it helps
Use this style to disable click in read as well as edit mode:
<field name="your_o2m" style="pointer-events:none;" />
Use editable='bottom' in this case, like:
<field name='line_ids'>
<tree create='false' editable='bottom'>
<field name='so_line_id' readonly='1'/>
<tree>
</field>
Odoo Version 10.0
web_tree_no_open module adds a new option: <tree open="false">
Lists
The root element of list views is <tree> 3. The list view's root can have the following attributes:
editable
by default, selecting a list view's row opens the corresponding form view. The editable attributes makes the list view itself editable in-place.
Valid values are top and bottom, making new records appear respectively at the top or bottom of the list.
The architecture for the inline form view is derived from the list view. Most attributes valid on a form view's fields and buttons are thus accepted by list views although they may not have any meaning if the list view is non-editable
default_order
overrides the ordering of the view, replacing the model's default order. The value is a comma-separated list of fields, postfixed by desc to sort in reverse order:
<tree default_order="sequence,name desc">
create, edit, delete
allows disabling the corresponding action in the view by setting the corresponding attribute to false
on_write
only makes sense on an editable list. Should be the name of a method on the list's model. The method will be called with the id of a record after having created or edited that record (in database).
The method should return a list of ids of other records to load or update.
string
alternative translatable label for the view
Deprecated since version 8.0: not displayed anymore
Note
if the list view is editable, any field attribute from the form view is also valid and will be used when setting up the inline form
view
in the form and tree view you can add create='false' to disable the create button and edit='false' to disable the edit button.Also use editable="top" or editable="bottom" if you dont want the form view to popup. for example
<tree string="Sale Order" create="false" edit="false" editable="bottom">
...
...
...
</tree>
Unfortunately I can't post pictures with a reputation lower than 10. 8-/
In a inherited view I want to add a button beside the red "Create" Button in the employees Kanban view. You can reach it over the menus "Human Resources"->"Employees".
I've searched for that button in the "hr_view.xml" file but couldn't find it so I assume that it isn't part of the view but it reacts on switching through the views (kanban to list to form view) so there must be a relation anywhere!?
But where is this relation defined?
Now I tried the following code out to add a simple action button which I wanted to place in the (new) "header" of the view:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_kanban_hr_employees_inherited" model="ir.ui.view">
<field name="name">HR - Employees Kanban extension</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees" />
<field name="arch" type="xml">
<field name="name" position="before">
<header>
<button string="Calculate Employee Timeaccounts" name="button_calc_employee_timeaccounts" type="object"/>
</header>
</field>
</field>
</record>
</data>
</openerp>
The result is that every kanban vignette now has that (small) button with no text in it.
What I wanted to achieve was to only add one button at th top of the page and didn't want to add a button to every single kanban vignette.
Does anyone have suggestions for me? Where should I insert the button??
The nicest solution would be right beside the red "Create" button on top. But like I mentioned before I think this isn't part of the inheritable view.
Seeing forward for great solutions and thank you for reading!
I want to change the tabindex in a form in opererp
how can I change it in the xml file or the python code
I am using openerp 6.1
example to what I need
in sales order form ,user want to change the focus of the element using tab button
he need to write first the order reference field then go to customer service field using a tab button,but when I press tab I go to the date button not the custom service even that the date button has a default value
Thanks
You can inherit and change both the models (defined in python files) and views (defined in xml files). More details about inheritance can be found here Object Inheritance
and Inheritance in Views
you can overwrite the original xml arch in your view and change the sequence of pages as per your requirement
like:
<record id="**account.invoice_supplier_form**" model="ir.ui.view">
<field name="name">account.invoice.supplier.form</field>
<field name="model">account.invoice</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<form string="Supplier Invoice" version="7.0">
as shown above you can write the same xml arch as define in account for supplier invoice,
and you can now change sequence of pages
hope this help
By default, OpenERP displays 20 records when retrieving data. Is there any way I can change the default no of records to something else? I can't find it anywhere
If you want to change the limit of the items displayed in a view, you have to edit the Window Action attached to it.
Go to Settings > Technical > Actions > Window Actions (Odoo v10).
Select the action you want to change, edit and change the field Limit, for the number of records you want to display.
Alternately, with Developer Mode activated, open the view. Open Developer Tools (the bug icon) > Edit Action and change field Limit.
To change the default number of records to display in a tree view, When you define the action
add <field name="limit">your_record_limit</field>
For example, in sale order the default number of record is 80, we can change it to 150 by adding <field name="limit">150</field> to the ir.action.act_window
<record id="action_order_form" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="limit">150</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
</record>