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

How Can I use the buttons from project.project in the hr.timesheet.sheet view?

By
wizardz
on 6/23/16, 5:46 AM 205 views

I have made a field in hr.timesheet.sheet view, with that I can select all projects like this:

class hr_timesheet_sheet(osv.osv): _inherit = "hr_timesheet_sheet.sheet" _columns = { 'project_field': fields.many2one('project.project', 'name'), }

I put that in the timesheet like this:

<record id="hr_timesheet_sheet_tree_test_fields" model="ir.ui.view"> <field name="name">hr.test.fields.tree</field> <field name="model">hr_timesheet_sheet.sheet</field> <field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/> <field name="arch" type="xml"> <xpath expr="//sheet/group/group" position="inside"> <field name="project_field" string="Project"/> </xpath> </field> </record>

How Can I make now 2 buttons that show me exactly the tasks and the documents of the project that I selected in the timesheet view?

I need to take the project.project function and then use them in the hr_timesheet_sheet view with new buttons...

 

This 2 buttons with the same function per project in this view:


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/23/16, 5:46 AM
Seen: 205 times
Last updated: 6/23/16, 5:46 AM