Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1444 Widoki

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'))]"/>


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 23
1896
0
lip 25
825
1
lip 25
327
1
maj 25
1553
ADD PROPERTIES Rozwiązane
1
maj 25
1909