production order naming series patch

This commit is contained in:
Nabin Hait
2012-12-20 16:00:27 +05:30
parent b5d23ee554
commit 2880a55a01
4 changed files with 39 additions and 27 deletions

View File

@@ -0,0 +1,15 @@
import webnotes
def execute():
from webnotes.utils import cstr
from webnotes.model.code import get_obj
fy_list = webnotes.conn.sql("""select name from `tabFiscal Year`
where docstatus < 2 order by year_start_date desc""")
series_list = []
for fy in fy_list:
series_list.append("PRO/" + cstr(fy[0][2:5]) + cstr(fy[0][7:9]) + "/")
naming_series_obj = get_obj("Naming Series")
naming_series_obj.doc.user_must_always_select = 1
naming_series_obj.set_series_for("Production Order", series_list)

View File

@@ -550,4 +550,8 @@ patch_list = [
'patch_module': 'patches.december_2012',
'patch_file': 'stock_entry_cleanup',
},
{
'patch_module': 'patches.december_2012',
'patch_file': 'production_order_naming_series',
},
]