コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2500 ビュー

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


アバター
破棄
著作者

Thank you my friend

最善の回答

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

アバター
破棄
著作者

I got this error

name 'context_today' is not defined" while evaluating

関連投稿 返信 ビュー 活動
3
5月 18
7893
2
8月 25
2421
1
7月 25
916
1
8月 25
1151
0
5月 25
1347