Odoo Help

1

How to override on_click statusbar function?

By
Dariusz Kubiak
on 10/23/13, 1:11 PM 1,776 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.

How to perform by buttons the same action like statusbar? I add on_click to statusbar, but it doesn't perform the function. How to override on_click statusbar 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
0
ricardo
On 10/23/13, 3:15 PM

Have yo tried to inherit that xml form and do a replace for the same field but without the clickable:

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

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

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