Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2471 Vizualizări

Hello,


I have this button that i want to be invisible after a certain amount of days after payment date

I tried different things but no luck .

  <button name="cancel" attrs="{'invisible': [('state', '=', 'draft'), ('payment_date', '&lt;', datetime.datetime.strftime('%d-%m-%Y'))]}" groups="account.group_account_manager" string="Cancel" type="object"/>


Imagine profil
Abandonează
Autor

Thank you my friend

Cel mai bun răspuns

Hello Chgh,

Please try below code. Hope it helps.

<button 
    name="cancel" 
    attrs="{'invisible': [('state', '=', 'draft'), ('payment_date', '&lt;', context_today().strftime('%Y-%m-%d'))]}" 
    groups="account.group_account_manager" 
    string="Cancel" 
    type="object"/>

Regards,
Pranjal

Imagine profil
Abandonează
Autor

I got this error

name 'context_today' is not defined" while evaluating

Related Posts Răspunsuri Vizualizări Activitate
3
mai 18
7856
2
aug. 25
2379
1
iul. 25
885
1
aug. 25
1151
0
mai 25
1332