跳至內容
選單
此問題已被標幟
1 回覆
2482 瀏覽次數

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
7870
2
8月 25
2401
1
7月 25
905
1
8月 25
1151
0
5月 25
1344