This question has been flagged
1 Reply
6468 Views

Hello,

i have a calendar view like the following:

  <calendar  color="categ" date_start="date_debut" date_stop="date_fin" string="organisation salon">
        <field name="sujet"/>    
  </calendar>
   categ is many2one fields and i want to define a domain on this field in the calendar view, please any idea ?

Avatar
Discard

You can create an action for this calendar view with a "Domain values"... Eg: [('categ', '!=', False)]

Best Answer

In "Calendar Views" the only supported  attributes are: string, date_start, date_stop, date_delay, dat_lenght, color, and mode.

So i think it's not possible !

But maybe you can switch to "Gantt Views", which have the same attributes, with one additionnal attributes "level".

The level tag can be used to achive your need.

 

Avatar
Discard

http://openerp-server.readthedocs.org/en/latest/03_module_dev_03.html#calendar-views

Author

Thanx Med Said, but i need a calendar view not a gantt view

try using https://www.odoo.com/apps/7.0/super_calendar/

Or just take a look in the super_calendar.py and super_calendar_view.xml code to see how domain is used on a many2one fields ...