Hi,
I tried to mimic hr_recruitment module by allowing customisable of stages instead of a static one.
So instead of doing the below
state = fields.Selection([
('draft', "Draft"),
('confirmed', "Confirmed"),
('done', "Done"),
])
I'm create a Stage class
class Stage(models.Model):
_name = "warranty.stage"
_description = "Stage of Warranty Tracking"
_order = 'sequence'
name = fields.Char('Name', required=True)
sequence = fields.Integer('Sequence', help="Gives the sequence order when displaying a list of stages.")
description = fields.Text('Description')
fold = fields.Boolean('Folded in Kanban View',
help='This stage is folded in the kanban view when'
'there are no records in that stage to display.')
registration_ids = fields.One2many(
'warranty.registration', 'stage_id', string="Registrations")
_defaults = {
'sequence': 1,
'fold': False,
}
and then in another class Registration, it wiill have the stage_id attribute.
stage_id = fields.Many2one('warranty.stage', ondelete='set null', string="Stage")
The Registration view form will have the
<form string="Registration Form">
<header>
<field name="stage_id" widget="statusbar" clickable="True"/>
</header>
However, I have 3 Stages configure, namely New, Registered, Rejected.
However, if my Registration object that is under New, for example will not highlight in the form view.
What am I missing here?