Hi,
I’m trying to use calendar view on a model with workflow (draft, waiting, done, cancel).
Here’s my model:
company = fields.Many2One('company.company', "Company", required=True)
shipment = fields.Reference("Shipment", selection='get_shipment',
select=True, required=True,
states={
'readonly': Eval('state') != 'draft',
},
domain=[
('company', '=', Eval('company', -1)),
],
depends=['state', 'company'],
help="The shipment that should be planned.")
planned_date = fields.Date("Planned Date",
select=True, required=True,
states={
'readonly': Eval('state').in_(['cancelled', 'done']),
},
depends=['state'],
help="When the shipement is expected to be shipped or received.")
calendar_background_color = fields.Function(
fields.Char("Background Color"), 'get_calendar_background_color')
state = fields.Selection([
('draft', 'Draft'),
('waiting', 'Waiting'),
('done', 'Done'),
('cancelled', 'Cancelled'),
], 'State', select=True, readonly=True,
help="The current state of the event.")
Is it possible to filter calendar view based on specific states ? (i mean, for instance, i don’t want to see cancelled events in the calendar view).
Thanks for help