mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
production order naming series patch
This commit is contained in:
15
patches/december_2012/production_order_naming_series.py
Normal file
15
patches/december_2012/production_order_naming_series.py
Normal 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)
|
||||
@@ -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',
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user