brotherton-erpnext/erpnext/patches/edigest_enable_income_year_to_date.py
2011-12-22 18:21:57 +05:30

12 lines
370 B
Python

import webnotes
from webnotes.model.doc import Document
def execute():
companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
for company in companies_list:
if company and company[0]:
edigest = Document('Email Digest', "Default Weekly Digest - " + company[0])
if edigest:
edigest.income_year_to_date = 1
edigest.save()