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.

2

project issue statusbar onchange override

By
Dariusz Kubiak
on 10/23/13, 1:04 PM 2,133 views

I want to implement workflow to process project issues. Some of actions will be available for customers via portal and statusbar widget will be read only. The action will be perform by buttons deppends the issue state and logged user.

The problem is to perform statusbar action by buttons. I add on_click to statusbar, but it doesn't perform the function.

project_issue_view.xml

<field name="stage_id" widget="statusbar" clickable="True" on_change="onchange_stage_id(stage_id)"/>

project_issue.py

class my_issue(osv.osv):
    _inherit = 'project.issue'

def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
    _logger.warning("\n onchange_stage_id")
    return True
1
Darek
On 10/25/13, 5:31 AM

I found the solution on my own again :) Statusbar state changes automatically after write() or create().

state_ids = self.pool.get('project.task.type').search(cr, uid, [('state','=','new')])
if state_ids:
    vals['state'] = 'new'
    vals['stage_id'] = state_ids[0]

{...} return super(my_issue, self).create(cr, uid, vals, context=create_context)

0
Maximiliano
On 7/26/14, 8:06 PM

can you find a solution?? i need the same!!

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

0 follower(s)

Stats

Asked: 10/23/13, 1:04 PM
Seen: 2133 times
Last updated: 3/16/15, 8:10 AM