Community mailing list archives

community@mail.odoo.com

Re: automated action to cancel invoices created on sundays

by
Mohamed Hagag
- 06/23/2015 20:39:53

anyone got this question ?!


On 05/29/2015 02:22 AM, Mohamed M. Hagag wrote:
<blockquote cite="mid:5567B155.1030409@gmail.com" type="cite">

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,