Community mailing list archives

community@mail.odoo.com

automated action to cancel invoices created on sundays

by
Mohamed Hagag
- 05/28/2015 20:22:45

Dears,


How can I create an automated action or server action to cancel recurring invoices created on sundays ?



I already tried this domain filter

[[time.strftime('%A',time.strptime(date_invoice,'%Y-%m-%d')), '=', 'Friday']]


but I get JS error that strptime is not definded.


also I tried this code in a server action

time.strftime('%A',time.strptime(date_invoice,'%Y-%m-%d'))='Friday' and workflow.model.cancel_invoice()


but I get another error .





Regards,