Odoo Help

Welcome!

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.

1

Relative Date Dashboard?

By
Robert Klüsener
on 9/6/13, 3:11 AM 1,943 views

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.

0
Robert Klüsener
On 9/9/13, 11:13 AM

I used

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

and it works.

0

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"

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

Feuerwear GmbH & Co. KG, Robert Klüsener
on 9/6/13, 3:16 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

2 follower(s)

Stats

Asked: 9/6/13, 3:11 AM
Seen: 1943 times
Last updated: 3/16/15, 8:10 AM