Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2474 Представления

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

Related Posts Ответы Просмотры Активность
3
мая 18
7857
2
авг. 25
2383
1
июл. 25
889
1
авг. 25
1151
0
мая 25
1335