← Back to team overview

openerp-community team mailing list archive

Re: custom view in OpenERP

 

Hi !

It works fine now, thanks for all these useful resources ;)

Regards,
Michel


On 17/10/2013 22:55, Jean-Sébastien Suzanne wrote:
Hi other example on bitbucket

* https://bitbucket.org/anybox/web_dynatree
In branch 6.1 add dynatree widget. In branch 7.0 add m2o widget and new type of view

https://bitbucket.org/anybox/list_multiheader
Add a new type of view which inherit list view to allow more than 1 header line (easier)




2013/10/17 Yannick Vaucher <yannick.vaucher@xxxxxxxxxxxxxx <mailto:yannick.vaucher@xxxxxxxxxxxxxx>>

    Hello,

    You might want to have a look in base_geoengine module to see how
    the view type geoengine was added:

    http://bazaar.launchpad.net/~geospatial-addons-core-editors/geospatial-addons/7.0/view/head:/base_geoengine/geo_view/ir_view.py
    <http://bazaar.launchpad.net/%7Egeospatial-addons-core-editors/geospatial-addons/7.0/view/head:/base_geoengine/geo_view/ir_view.py>

    Regards,
    Yannick


    On Thu, Oct 17, 2013 at 1:38 PM, Michel Meyer <michel@xxxxxxxxx
    <mailto:michel@xxxxxxxxx>> wrote:

        Dear all !

        I think there's no real way to add a custom view type in
        OpenERP without using a dirty trick.

        For my needs, i did something like this:

        /register a js view:/

        |<
          span clas
        s="pln" style="color: rgb(0, 0, 0);">instance.web.views.add('foobar_view',  'instance.foobar.FooBarView');
        instance.foobar.FooBarView  =  instance.web.View.extend({...})
        |

        /add a act_window entry:/

        |<
          span clas
        s="pun" style="color: rgb(102, 102, 0);"><record  id="action_view_foobar"  model="ir.actions.act_window">
             <field  name="name">FooBar</field>
             <field  name="view_mode">foobar_view</field>
             <field  name="res_model">foo.bar</field>
        </record>
        |

        It works fine for a fully new view, but I have the feeling
        it's more a hack.

        Also, my view can't be integrated with other views (in the
        top-right menu, where you can switch from form, tree,
        calendar, gantt views) and I can't use my|foobar_view|as
        a|view_type|and use some|archi|parameters to configure it...


        Someone has a better solution ?
        If not, is there any plane to fully support custom view type
        in the future ?

        Regards,
        Michel


        _______________________________________________
        Mailing list: https://launchpad.net/~openerp-community
        <https://launchpad.net/%7Eopenerp-community>
        Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
        <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
        Unsubscribe : https://launchpad.net/~openerp-community
        <https://launchpad.net/%7Eopenerp-community>
        More help   : https://help.launchpad.net/ListHelp




-- Yannick Vaucher
    Business Solutions Software Developer

    Camptocamp SA
    PSE A, CH-1015 Lausanne
    Phone: +41 21 619 10 30 <tel:%2B41%2021%20619%2010%2030>
    Office: +41 21 619 10 10 <tel:%2B41%2021%20619%2010%2010>
    http://www.camptocamp.com/

    _______________________________________________
    Mailing list: https://launchpad.net/~openerp-community
    <https://launchpad.net/%7Eopenerp-community>
    Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
    <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~openerp-community
    <https://launchpad.net/%7Eopenerp-community>
    More help   : https://help.launchpad.net/ListHelp




--
Jean-Sébastien SUZANNE
jssuzanne@xxxxxxxxx  <mailto:jssuzanne@xxxxxxxxx>


References