Help

2

Relative Date Dashboard?

Avatar
Robert Klüsener

I have a filter to filter my task that are due today

[['date_deadline','<=',time.strftime('%Y-%m-%d')], ['user_id', '=', 1], '|', '|', ['state', '=', 'draft'], ['state', '=', 'open'], ['state', '=', 'pending']]

when I add this view to my dashboard (ir.ui.view.custom,114) it replaces the relative date with a fix date

<form string="My Dashboard" version="7.0">
        <board style="2-1">
            <column>

            <action context="{'lang': 'de_DE', 'group_by': ['context_id'], 'tz': 'Europe/Berlin', 'uid': 1, 'dashboard_merge_domains_contexts': False}" domain="[['date_deadline', '&lt;=', '2013-09-06'], ['user_id', '=', 1], '|', '|', ['state', '=', 'draft'], ['state', '=', 'open'], ['state', '=', 'pending']]" name="192" string="Aufgaben" view_mode="kanban" /></column><column>

            </column><column>

            </column>
        </board>
    </form>

I am struggling changing this fix date in a relative date again in the setting. Just copy and paste the code from the filter does not work.

Avatar
Discard
2 Answers
1
Avatar
Robert Klüsener
Best Answer

I used

[['date_deadline', '<=', ((context_today()).strftime('%Y-%m-%d'))]

and it works.

Avatar
Discard
0
Best Answer

Hi,

In the name you can select your action %(module.xml id of my action)d. Put [['date_deadline','<=',time.strftime('%Y-%m-%d')] in the domain of the action.

try this

<record id="module.xml_id" model="model">
    ...
    <field name="domain">[['date_deadline','<=',time.strftime('%Y-%m-%d')]</field>
</record>

Remove this part of the domain in your board and in the attribute

name="%(module.xml_id)d"
1 Comment
Avatar
Discard
Avatar
Robert Klüsener
-

Like this?

        &lt;action context="{'lang': 'de_DE', 'group_by': ['context_id'], 'tz': 'Europe/Berlin', 'uid': 1, 'dashboard_merge_domains_contexts': False}" domain="['date_deadline','&lt;=',time.strftime('%Y-%m-%d')], ['user_id', '=', 1], '|', '|', ['state', '=', 'draft'], ['state', '=', 'open'], ['state', '=', 'pending']]" name="192" string="Aufgaben" view_mode="kanban" /&gt;

This does not work - am getting an error in the dashboard