It seems like its impossible to expose a field via child-navigation (one2many child) onto a parent view (e.g. tree view).
Parent-View:
<field name="child.child_field"/>
Doesn't matter if type of child_field is simple or complex, the error is always:
Error while validating view. The field child.child_field doesn't
exist.
Is this possible in ODOO 13 or not?
Best regards,
Lars
You have to define related field in parent model first. For e.g. related_child_field = fields.Char(related='child.child_field'). Then, use that field in view <field name="related_child_field"/>
I tried to do the same when I started with odoo. You cannot use dotted notion to child field in odoo list view, form view, etc. It is not just in odoo13, it also does not work in odoo11 which I usually use. So, I guess it will be the same for earlier versions.
As you can see in the views documentation, the field renders (and allow edition of, possibly) a single field of the current record.
Related
I have a common container component into which I would like to display different components depending on what the user has selected. I have got this working using the element in the container view and binding the view.model attribute to a model property, like this:
<compose view-model="./${componentName}" if.bind="haveComponent" model.bind="stuff"></compose>
I have methods in the view model which change the value of {componentName} and different views are displayed.It does seem to work but something doesn't feel right, I'm not quite sure.
Is this a legitimate way to achieve this? I'm pretty new to Aurelia so any pointers would be appreciated.
That is legitimate use case for compose
Don't be shy and join aurelia's discourse
I am trying inherit base.user_groups_view and base.view_users_form to hide some information which is not useful in my case.
base.view_users_form
I want to hide Preferences tab completely but this page have a string and doesn't have a name attribute that's why when i try to find out this page it says cannot locate in parent view and if i try to search using string attribute it says View inheritance may not use attribute 'string' as a selector.
base.view_users_form
Same a above when i try to hide Application spearator it says View inheritance may not use attribute 'string' as a selector.
How to hide these when we are in inherited view
Edit
I am using Odoo 10 Enterprise
In odoo 9 it is impossible to use 'string' in xpath expressions. In your case you should use an index. For example:
<xpath expr="//page[3]">
<!-- your code -->
</xpath>
This will search the third element that is a page in your view.
You could visit: xpath_string for more information.
I hope this help you!
I have an elm app designed with the Elm Architecture in mind. I've used it for all the samples in the tutorial and they work fine. I have the following components
ContainerListView
ContainerView
AddressView
RegistrationView
...
The ContainerView component is a very formatted div structure that is used to contain other views (but for now, only 1 at a time)
ContainerListView can contain multiple containerViews. It handles their presentation and positioning. You can think of it as an MDI surface
A menu from the main ui is used to add new container views to the container view list.
I'm presented with with three main questions. Two of them are
How do I create the components such that Container view can contain any other element is I pass in for example the init, update, and view functions and expect all things to be wired correctly? At the moment, the samle views I have are kinda hard-coded. They know exactly who the children is.
Some of the components require access to things like url, access token, etc. Does this always have to be passed in from main to the individual components or it can come from another source which will essentially be readonly and maybe updatable only from main?
I'm not sure if these two should be individual questions on their own. Any information on how to architect larger apps beyound hello world will also be appreciated.
I'm working on something similar! Nested controls. I too have a container object which knows about all the types that it can handle, and has basically case statements to handle each type. So I can't drop in a new control type and expect it to handle it, that requires altering the container.
As far as I know elm doesn't have type classes, which would be how I might try to handle that kind of abstraction in haskell or purescript. There's more about that here:
https://github.com/elm-lang/elm-compiler/issues/38
and here:
https://github.com/elm-lang/elm-compiler/issues/1039
The upshot appears to be that they don't know how they want to solve that problem yet, so they haven't.
As far as I know there was fundamental change of xml tag <group> between versions 6.x and 7.0. Could somebody explain or point to a resource where I could read how this tag behaves in OpenERP 7.0?
I haven't seen a definitive doc although I vaguely remember reading something on Launchpad but I can't find it now. The developer docs have this:
Technically, the layout of forms version 7.0 is different than former
versions. There is no longer a default “grid” layout; instead the
layout is more based on HTML and CSS. The following conventions are
now used:
The elements <form> and <page> no longer define groups; the elements inside are laid out inline. One should use explicit <div> or
to create blocks.
By default, the element <group> now defines two columns inside, unless an attribute col=”n” is used. The columns have the same width
(1/n th of the group’s width). Use a element to produce a
column of fields.
The element <separator string=”XXX”/> on top of a group can be replaced putting string=”XXX” inside the <group> element.
The element <field name=”XXX”/> does not produce a label, except when they are directly below a <group> element. Use <label for=”XXX”/>
to produce the label of the field.
I have found sometimes I need to define a top level group inside the form and then use groups inside that with the regular col and colspan attributes. Possibly the best is to find a form that matches what you are trying to achieve and see how it does it.
There is also the new, annoying sheet attribute as well, I just don't understand this one (I mean I don't understand why, I know what it does).
I'm using OpenERP 6.0.4 GTK client and the product tree view comes up with the UoM column too wide (wider than the product name).
Where is the place to control the column width in a tree view ?
Techically this whole is game of CSS but if you really courious and wanna check, How stuff going on then on OpenERP Web Project under addons/web/static/src/css/base.css check for the class oe_list_content you see width are 100% at rlative postion but each field type has their own attrib too. If you check stuff with Firebug you will each cell has mutiple CSS but oe_list_content in common, so all re kept in same tr, td at rleative position.
Thank You.
I guess you can't. The closest thing would be to use the colspan="x" field attribute, but unfortunately that doesn't work in tree views.