fixes in stock entry

This commit is contained in:
Anand Doshi
2013-03-26 12:33:43 +05:30
parent 9f91053201
commit acec0227c5
5 changed files with 83 additions and 94 deletions

View File

@@ -55,6 +55,7 @@ class DocType(StockController):
self.validate_finished_goods()
self.validate_return_reference_doc()
self.validate_with_material_request()
self.validate_fiscal_year()
def on_submit(self):
self.update_serial_no(1)
@@ -68,6 +69,11 @@ class DocType(StockController):
self.update_production_order(0)
self.make_gl_entries()
def validate_fiscal_year(self):
import accounts.utils
accounts.utils.validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year,
self.meta.get_label("posting_date"))
def validate_purpose(self):
valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer",
"Manufacture/Repack", "Subcontract", "Sales Return", "Purchase Return"]

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-03-11 12:34:40",
"creation": "2013-03-26 06:51:17",
"docstatus": 0,
"modified": "2013-03-19 17:48:29",
"modified": "2013-03-26 07:24:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -542,6 +542,16 @@
"reqd": 0,
"search_index": 0
},
{
"doctype": "DocField",
"fieldname": "fiscal_year",
"fieldtype": "Select",
"in_filter": 0,
"label": "Fiscal Year",
"options": "link:Fiscal Year",
"print_hide": 1,
"reqd": 1
},
{
"allow_on_submit": 0,
"doctype": "DocField",
@@ -610,13 +620,5 @@
{
"doctype": "DocPerm",
"role": "Manufacturing User"
},
{
"doctype": "DocPerm",
"role": "Manufacturing Manager"
},
{
"doctype": "DocPerm",
"role": "Material Manager"
}
]

View File

@@ -490,7 +490,7 @@ class TestStockEntry(unittest.TestCase):
def test_make_return_jv_for_purchase_receipt(self):
se, pr_name = self.test_purchase_receipt_return()
self._test_purchase_return_jv(se)
se, pr_name = self._test_purchase_return_return_against_purchase_order()
self._test_purchase_return_jv(se)