production order naming series patch
This commit is contained in:
parent
b5d23ee554
commit
2880a55a01
@ -33,11 +33,6 @@ class DocType:
|
|||||||
self.doc = doc
|
self.doc = doc
|
||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
|
|
||||||
|
|
||||||
def autoname(self):
|
|
||||||
self.doc.name = make_autoname('PRO/' + self.doc.fiscal_year[2:5] +
|
|
||||||
self.doc.fiscal_year[7:9] + '/.######')
|
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.doc.production_item :
|
if self.doc.production_item :
|
||||||
item_detail = sql("select name from `tabItem` where name = '%s' and docstatus != 2"
|
item_detail = sql("select name from `tabItem` where name = '%s' and docstatus != 2"
|
||||||
|
|||||||
@ -2,12 +2,13 @@
|
|||||||
{
|
{
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-12-19 22:39:06",
|
"creation": "2012-12-20 14:31:18",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-12-20 13:57:10"
|
"modified": "2012-12-20 15:50:43"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
|
"autoname": "naming_series:",
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
@ -22,18 +23,33 @@
|
|||||||
"parentfield": "fields"
|
"parentfield": "fields"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "__common__",
|
|
||||||
"parent": "Production Order",
|
"parent": "Production Order",
|
||||||
"read": 1,
|
"read": 1,
|
||||||
|
"cancel": 1,
|
||||||
|
"name": "__common__",
|
||||||
|
"amend": 1,
|
||||||
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1,
|
||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"role": "Manufacturing User",
|
"role": "Manufacturing User",
|
||||||
|
"permlevel": 0,
|
||||||
"parentfield": "permissions"
|
"parentfield": "permissions"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Production Order",
|
"name": "Production Order",
|
||||||
"doctype": "DocType"
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": "PRO",
|
||||||
|
"doctype": "DocField",
|
||||||
|
"label": "Series",
|
||||||
|
"fieldname": "naming_series",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"reqd": 1,
|
||||||
|
"options": "\nPRO"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
@ -171,14 +187,6 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"options": "Company"
|
"options": "Company"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Fiscal Year",
|
|
||||||
"fieldname": "fiscal_year",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"reqd": 1,
|
|
||||||
"options": "link:Fiscal Year"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
@ -190,16 +198,6 @@
|
|||||||
"fieldtype": "Data"
|
"fieldtype": "Data"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 1,
|
"doctype": "DocPerm"
|
||||||
"create": 1,
|
|
||||||
"doctype": "DocPerm",
|
|
||||||
"submit": 1,
|
|
||||||
"write": 1,
|
|
||||||
"cancel": 1,
|
|
||||||
"permlevel": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"doctype": "DocPerm",
|
|
||||||
"permlevel": 1
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
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_module': 'patches.december_2012',
|
||||||
'patch_file': 'stock_entry_cleanup',
|
'patch_file': 'stock_entry_cleanup',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'patch_module': 'patches.december_2012',
|
||||||
|
'patch_file': 'production_order_naming_series',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user