[minor] Added batch item in the demo data
This commit is contained in:
parent
946e182564
commit
c4ee77a3cc
@ -278,5 +278,16 @@
|
||||
"item_code": "Autocad",
|
||||
"item_name": "Autocad",
|
||||
"item_group": "All Item Groups"
|
||||
},
|
||||
{
|
||||
"is_stock_item": 1,
|
||||
"has_batch_no": 1,
|
||||
"create_new_batch": 1,
|
||||
"valuation_rate": 200,
|
||||
"default_warehouse": "Stores",
|
||||
"description": "Corrugated Box",
|
||||
"item_code": "Corrugated Box",
|
||||
"item_name": "Corrugated Box",
|
||||
"item_group": "All Item Groups"
|
||||
}
|
||||
]
|
@ -16,6 +16,7 @@ def setup(domain):
|
||||
setup_user()
|
||||
setup_employee()
|
||||
setup_user_roles()
|
||||
setup_role_permissions()
|
||||
|
||||
employees = frappe.get_all('Employee', fields=['name', 'date_of_joining'])
|
||||
|
||||
@ -91,6 +92,7 @@ def setup_fiscal_year():
|
||||
pass
|
||||
|
||||
# set the last fiscal year (current year) as default
|
||||
if fiscal_year:
|
||||
fiscal_year.set_as_default()
|
||||
|
||||
def setup_holiday_list():
|
||||
@ -374,6 +376,22 @@ def setup_pos_profile():
|
||||
|
||||
pos.insert()
|
||||
|
||||
def setup_role_permissions():
|
||||
role_permissions = {'Batch': ['Accounts User', 'Item Manager']}
|
||||
for doctype, roles in role_permissions.items():
|
||||
for role in roles:
|
||||
if not frappe.db.get_value('Custom DocPerm',
|
||||
{'parent': doctype, 'role': role}):
|
||||
frappe.get_doc({
|
||||
'doctype': 'Custom DocPerm',
|
||||
'role': role,
|
||||
'read': 1,
|
||||
'write': 1,
|
||||
'create': 1,
|
||||
'delete': 1,
|
||||
'parent': doctype
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
def import_json(doctype, submit=False, values=None):
|
||||
frappe.flags.in_import = True
|
||||
data = json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data',
|
||||
|
@ -7,6 +7,7 @@ import frappe, random
|
||||
from frappe.desk import query_report
|
||||
from erpnext.stock.stock_ledger import NegativeStockError
|
||||
from erpnext.stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError
|
||||
from erpnext.stock.doctype.batch.batch import UnableToSelectBatchError
|
||||
from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_return
|
||||
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_return
|
||||
|
||||
@ -59,7 +60,7 @@ def make_delivery_note():
|
||||
try:
|
||||
dn.submit()
|
||||
frappe.db.commit()
|
||||
except (NegativeStockError, SerialNoRequiredError, SerialNoQtyError):
|
||||
except (NegativeStockError, SerialNoRequiredError, SerialNoQtyError, UnableToSelectBatchError):
|
||||
frappe.db.rollback()
|
||||
|
||||
def make_stock_reconciliation():
|
||||
|
Loading…
x
Reference in New Issue
Block a user