Skip to Content
Menu
This question has been flagged
1 Atsakyti
2466 Rodiniai

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


Portretas
Atmesti
Autorius

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

Portretas
Atmesti
Autorius

I got this error

name 'context_today' is not defined" while evaluating

Related Posts Replies Rodiniai Veikla
3
geg. 18
7854
2
rugp. 25
2366
1
liep. 25
878
1
rugp. 25
1151
0
geg. 25
1329