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
2492 Zobrazení

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"/>


Avatar
Zrušit
Autor

Thank you my friend

Nejlepší odpověď

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

Avatar
Zrušit
Autor

I got this error

name 'context_today' is not defined" while evaluating

Related Posts Odpovědi Zobrazení Aktivita
3
kvě 18
7882
2
srp 25
2409
1
čvc 25
909
1
srp 25
1151
0
kvě 25
1344