Odoo Help


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.


Add Dynamic stages on Purchase Requisition like HR Applicant. [Closed]

Anil R. Kesariya
on 11/22/13, 8:19 AM 718 views

The Question has been closed for reason: not relevant or out dated

Anil R. Kesariya
on 09/10/2014 08:20:34

Hello Everyone,

I want to add User Define stages on Purchase Requisition form as we can add in HR Applicant. What I did for that.

Added New Object for Stages and added demo data for that which relates to state on purchase requisition This Ojbect is created sucussfully and I can see the demo data for this object. Here is the ojbect in py file.

.Py File

('draft', 'New'),
('in_progress', 'Sent to Suppliers'),
('cancel', 'Cancelled'),
('done', 'Purchase Done'),
class purchase_requisition_stage(osv.osv):
""" Stage of Purchase Requistion """

_name = "purchase.requisition.stage"
_description = "Stage of Purchase Requisition"
_order = 'sequence'
_columns = {
    'name': fields.char('Name', size=64, required=True, translate=True),
    'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of stages."),
    'state': fields.selection(AVAILABLE_STATES, 'Status', required=True ),
    'description': fields.text('Description'),
_defaults = {
    'sequence': 1,
    'state': 'draft',

class purchase_requisition(osv.osv):

_inherit = 'purchase.requisition'

_columns = {
'stage_id': fields.many2one ('purchase.requisition.stage', 'Stage', track_visibility='onchange',),
 'state': fields.related('stage_id','state', type="selection", string="Status", selection=AVAILABLE_STATES, store=True,   required=True),
defaults = {

.xml File :

<xpath expr="//form/header/field[@name='state']" position="replace">
    <field name="stage_id" widget="statusbar" clickable="True"/>

I have replaced the normal state filed on purchase with related field on py and xml file.

This is what I did to achive for adding extra stages on purchase requistion form.

When I am trying to open I am getting web client error.

image description

Any one has Idea what I am missing to achive this. Any suggestion appreciated

Thanks in Advance.

Regards, Anil Kesariya

About This Community

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

Question tools

0 follower(s)


Asked: 11/22/13, 8:19 AM
Seen: 718 times
Last updated: 3/16/15, 8:10 AM