Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2483 Prikazi

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
Opusti
Avtor

Thank you my friend

Best Answer

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
Opusti
Avtor

I got this error

name 'context_today' is not defined" while evaluating

Related Posts Odgovori Prikazi Aktivnost
3
maj 18
7870
2
avg. 25
2401
1
jul. 25
905
1
avg. 25
1151
0
maj 25
1344