Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

_inherits = "hr_timesheet_sheet" question , how to import in a new navigation button at the top bar.

By
wizardz
on 6/7/16, 10:30 AM 171 views

I'm making a new modul, in this modul I want to import the hr_timesheet stuff from the standard modul from odoo8.

I read that with _inherits = I can use the same for example "fields" from the standard hr_timesheet modul in my new modul.

I want to add those fields in a new view at a new navigation button in odoo.

How can I do that view in a simple way.


In the topbar in odoo I have make a button with this:


<openerp>

<data>

<!--Gets triggered by the record with id 'buttons_example_action'. Which in turn is triggered on click. -->

<record model="ir.ui.view" id="ir.ui.view">

<field name="name">Buttons</field>

<field name="model">button.demo</field>

 

<field name="type">form</field>

<field name="arch" type="xml">

<form string="Button record">

<group>


</group>

</form>

</field>

</record>

<!--The action -->

<record model="ir.actions.act_window" id="leistungserfassung_action">

<field name="name">meine Leistungserfassung</field>

<field name="res_model">button.demo</field>

<field name="view_type">form</field>

<field name="view_mode">form,tree</field>

<field name='view_id' ref='view_buttons_form'/>

</record>

<!-- top level menu: no parent -->

<menuitem id="main_button_menu" name="Leistungserfassung"/>

<menuitem id="button_menu" name="button demo"

parent="main_button_menu"/>

<menuitem id="menu_detail_logging"

action="leistungserfassung_action" parent="button_menu"

sequence="20"/>

</data>

</openerp>


How can I inherit the hr_timesheet view in this new button?

I try that with making a class like this:


from openerp import models, fields, api

#Non-odoo library

import random

from random import randint

import string

class button_action_demo(models.Model):

_inherits = "hr_timesheet_sheet.sheet"


but this is not working.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/7/16, 10:30 AM
Seen: 171 times
Last updated: 6/7/16, 10:32 AM