[demo] help
This commit is contained in:
parent
c748e9c991
commit
8cfe18eccd
@ -228,7 +228,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Mode of Payment",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@ -1349,8 +1349,8 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 06:25:00.248907",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2016-07-11 08:06:33.121527",
|
||||
"modified_by": "NuranVerkleij@example.com",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry",
|
||||
"name_case": "",
|
||||
|
@ -0,0 +1,6 @@
|
||||
frappe.listview_settings['Payment Entry'] = {
|
||||
add_fields: ["payment_type"],
|
||||
get_indicator: function(doc) {
|
||||
return [__(doc.payment_type), (doc.docstatus==0 ? 'red' : 'blue'), 'status=' + doc.payment_type]
|
||||
}
|
||||
}
|
@ -147,7 +147,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Outstanding Amount",
|
||||
"label": "Outstanding",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@ -172,7 +172,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Allocated Amount",
|
||||
"label": "Allocated",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@ -222,7 +222,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 03:28:03.493863",
|
||||
"modified": "2016-07-11 07:55:04.131655",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry Reference",
|
||||
|
@ -6,6 +6,23 @@ import frappe.utils
|
||||
from erpnext.demo.setup_data import setup_data
|
||||
from erpnext.demo.user import hr, sales, purchase, manufacturing, stock
|
||||
|
||||
"""
|
||||
Make a demo
|
||||
|
||||
1. Start with a fresh account
|
||||
|
||||
bench --site demo.erpnext.dev reinstall
|
||||
|
||||
2. Install Demo
|
||||
|
||||
bench --site demo.erpnext.dev execute erpnext.demo.demo.make
|
||||
|
||||
3. If Demo breaks, to continue
|
||||
|
||||
bench --site demo.erpnext.dev execute erpnext.demo.demo.simulate
|
||||
|
||||
"""
|
||||
|
||||
def make(domain='Manufacturing'):
|
||||
frappe.flags.domain = domain
|
||||
setup_data()
|
||||
|
@ -328,3 +328,8 @@ def setup_user_roles():
|
||||
user.add_roles('Manufacturing User', 'Stock User', 'Purchase User', 'Accounts User')
|
||||
frappe.db.set_global('demo_stock_user', user.name)
|
||||
|
||||
if not frappe.db.get_global('demo_accounts_user'):
|
||||
user = frappe.get_doc('User', 'LeonAbdulov@example.com')
|
||||
user.add_roles('Accounts User', 'Accounts Manager')
|
||||
frappe.db.set_global('demo_accounts_user', user.name)
|
||||
|
||||
|
68
erpnext/demo/user/accounts.py
Normal file
68
erpnext/demo/user/accounts.py
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import random
|
||||
from frappe.utils import random_string
|
||||
from frappe.desk import query_report
|
||||
|
||||
def work():
|
||||
frappe.set_user(frappe.db.get_global('demo_accounts_user'))
|
||||
|
||||
if random.random() < 0.5:
|
||||
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
|
||||
report = "Ordered Items to be Billed"
|
||||
for so in list(set([r[0] for r in
|
||||
query_report.run(report)["result"]
|
||||
if r[0]!="Total"]))[:random.randint(1, 5)]:
|
||||
si = frappe.get_doc(make_sales_invoice(so))
|
||||
si.posting_date = frappe.flags.current_date
|
||||
for d in si.get("items"):
|
||||
if not d.income_account:
|
||||
d.income_account = "Sales - {}".format(frappe.db.get_value('Company', si.company, 'abbr'))
|
||||
si.insert()
|
||||
si.submit()
|
||||
frappe.db.commit()
|
||||
|
||||
if random.random() < 0.5:
|
||||
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice
|
||||
report = "Received Items to be Billed"
|
||||
for pr in list(set([r[0] for r in query_report.run(report)["result"]
|
||||
if r[0]!="Total"]))[:random.randint(1, 5)]:
|
||||
pi = frappe.get_doc(make_purchase_invoice(pr))
|
||||
pi.posting_date = frappe.flags.current_date
|
||||
pi.bill_no = random_string(6)
|
||||
pi.insert()
|
||||
pi.submit()
|
||||
frappe.db.commit()
|
||||
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry_against_invoice
|
||||
|
||||
if random.random() < 0.5:
|
||||
report = "Accounts Receivable"
|
||||
for si in list(set([r[3] for r in query_report.run(report,
|
||||
{"report_date": frappe.flags.current_date })["result"]
|
||||
if r[2]=="Sales Invoice"]))[:random.randint(1, 5)]:
|
||||
jv = frappe.get_doc(get_payment_entry_against_invoice("Sales Invoice", si))
|
||||
jv.posting_date = frappe.flags.current_date
|
||||
jv.cheque_no = random_string(6)
|
||||
jv.cheque_date = frappe.flags.current_date
|
||||
jv.insert()
|
||||
jv.submit()
|
||||
frappe.db.commit()
|
||||
|
||||
if random.random() < 0.5:
|
||||
report = "Accounts Payable"
|
||||
for pi in list(set([r[3] for r in query_report.run(report,
|
||||
{"report_date": frappe.flags.current_date })["result"]
|
||||
if r[2]=="Purchase Invoice"]))[:random.randint(1, 5)]:
|
||||
jv = frappe.get_doc(get_payment_entry_against_invoice("Purchase Invoice", pi))
|
||||
jv.posting_date = frappe.flags.current_date
|
||||
jv.cheque_no = random_string(6)
|
||||
jv.cheque_date = frappe.flags.current_date
|
||||
jv.insert()
|
||||
jv.submit()
|
||||
frappe.db.commit()
|
Loading…
x
Reference in New Issue
Block a user