Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1389 Zobrazení

Hi All

i am working on small module this is my first module i have created a search view as bellow but problem is when you click on late or today on activity menu all the activity will open and it will not filter the late or today activity i was wondering if some one can help me to solve it.

Best Regard







domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/>


Avatar
Zrušit
Nejlepší odpověď

Hi,


It seems like there is a potential issue with the formatting of the domain in your search view. Additionally, you may need to handle the context in a way that dynamically updates the date values based on the selected filter.


Here's an example of how you can modify your search view to handle late and today activities:


<record id="view_activity_search" model="ir.ui.view">

<field name="name">crm.activity.search</field>

<field name="model">crm.activity</field>

    <field name="arch" type="xml">

        <search>

<filter string="Late Activities" name="late" domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]" />

<filter string="Today's Activities" name="today" domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]" />

<filter string="Future Activities" name="future" domain="[('my_activity_date_deadline','&gt;', context_today().strftime('%Y-%m-%d'))]" />

        </search>

    </field>

</record>


Please make sure to replace 'crm.activity' with the actual model name


Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
zář 23
1847
0
čvc 25
789
1
čvc 25
289
1
kvě 25
1521
ADD PROPERTIES Vyřešeno
1
kvě 25
1736