Compare commits
36 Commits
fix-get_si
...
v10.x.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49b0afccbd | ||
|
|
1183d3e1bc | ||
|
|
f876f4c2b2 | ||
|
|
ac4a3057cf | ||
|
|
999216e727 | ||
|
|
a5fa29f256 | ||
|
|
1fddde0c0e | ||
|
|
e269aa9781 | ||
|
|
30be1181ea | ||
|
|
5a1b778cd2 | ||
|
|
6dcc3a7596 | ||
|
|
3657b2b0a4 | ||
|
|
cd701e3e6f | ||
|
|
55e54ef6a1 | ||
|
|
fb12805435 | ||
|
|
d21f1c0ce2 | ||
|
|
60b6f79349 | ||
|
|
9366449cb4 | ||
|
|
d12ede8510 | ||
|
|
63f1eded95 | ||
|
|
a34f459065 | ||
|
|
ff1bd34e4c | ||
|
|
6e63de447a | ||
|
|
d7ae52cd49 | ||
|
|
57646ec7de | ||
|
|
d492db4ccb | ||
|
|
16651241e8 | ||
|
|
e87e6d07ba | ||
|
|
a75973e9e5 | ||
|
|
4802fc018b | ||
|
|
e012e2207a | ||
|
|
b7e0ae68ca | ||
|
|
0e971f5088 | ||
|
|
79936fa949 | ||
|
|
203a712071 | ||
|
|
c4bdefe666 |
16
.travis.yml
16
.travis.yml
@@ -1,5 +1,12 @@
|
|||||||
language: python
|
language: python
|
||||||
dist: trusty
|
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- "python3"
|
||||||
|
- "python3-pip"
|
||||||
|
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
@@ -9,14 +16,13 @@ services:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install flake8==3.3.0
|
- pip install flake8==3.3.0
|
||||||
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
|
- sudo -H python3 -m pip install --upgrade setuptools pip
|
||||||
- sudo rm /etc/apt/sources.list.d/docker.list
|
|
||||||
- sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
|
- sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
|
||||||
- sudo apt-get purge -y mysql-common mysql-server mysql-client
|
- sudo apt-get purge -y mysql-common mysql-server mysql-client
|
||||||
- nvm install v7.10.0
|
- nvm install v7.10.0
|
||||||
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
|
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
|
||||||
- sudo python install.py --develop --user travis --without-bench-setup
|
- sudo python3 install.py --develop --user travis --without-bench-setup
|
||||||
- sudo pip install -e ~/bench
|
- sudo python3 -m pip install -e ~/bench
|
||||||
|
|
||||||
- rm $TRAVIS_BUILD_DIR/.git/shallow
|
- rm $TRAVIS_BUILD_DIR/.git/shallow
|
||||||
- bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
|
- bash $TRAVIS_BUILD_DIR/travis/bench_init.sh
|
||||||
|
|||||||
20
MANIFEST.in
20
MANIFEST.in
@@ -1,20 +0,0 @@
|
|||||||
include MANIFEST.in
|
|
||||||
include requirements.txt
|
|
||||||
include *.json
|
|
||||||
include *.md
|
|
||||||
include *.py
|
|
||||||
include *.txt
|
|
||||||
include .travis.yml
|
|
||||||
recursive-include erpnext *.txt
|
|
||||||
recursive-include erpnext *.css
|
|
||||||
recursive-include erpnext *.csv
|
|
||||||
recursive-include erpnext *.html
|
|
||||||
recursive-include erpnext *.ico
|
|
||||||
recursive-include erpnext *.js
|
|
||||||
recursive-include erpnext *.json
|
|
||||||
recursive-include erpnext *.md
|
|
||||||
recursive-include erpnext *.png
|
|
||||||
recursive-include erpnext *.py
|
|
||||||
recursive-include erpnext *.svg
|
|
||||||
recursive-include erpnext/public *
|
|
||||||
recursive-exclude * *.pyc
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"Accrued Rebates Due from Suppliers": {
|
"Accrued Rebates Due from Suppliers": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"Accured Income from Suppliers": {
|
"Accrued Income from Suppliers": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"Other Debtors": {
|
"Other Debtors": {
|
||||||
@@ -82,16 +82,14 @@
|
|||||||
},
|
},
|
||||||
"Inventory": {
|
"Inventory": {
|
||||||
"Consigned Stock": {
|
"Consigned Stock": {
|
||||||
"Handling Difference in Inventory": {
|
"Handling Difference in Inventory": {},
|
||||||
"account_type": "Stock Adjustment"
|
"Items Delivered to Customs on temporary Base": {}
|
||||||
},
|
|
||||||
"Items Delivered to Customs on temprary Base": {}
|
|
||||||
},
|
},
|
||||||
"Stock in Hand": {
|
"Stock in Hand": {
|
||||||
"account_type": "Stock"
|
"account_type": "Stock"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Perliminary and Preoperating Expenses": {
|
"Preliminary and Preoperating Expenses": {
|
||||||
"Preoperating Expenses": {}
|
"Preoperating Expenses": {}
|
||||||
},
|
},
|
||||||
"Prepayments & Deposits": {
|
"Prepayments & Deposits": {
|
||||||
@@ -150,16 +148,16 @@
|
|||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
},
|
},
|
||||||
"Leasehold Improvement": {},
|
"Leasehold Improvement": {},
|
||||||
"Motor Vehicules": {
|
"Motor Vehicles": {
|
||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
},
|
},
|
||||||
"Work In Progrees": {},
|
"Work In Progress": {},
|
||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Intangible Assets": {
|
"Intangible Assets": {
|
||||||
"Computer Card Renewal": {},
|
"Computer Card Renewal": {},
|
||||||
"Dispoal of Outlets": {},
|
"Disposal of Outlets": {},
|
||||||
"Registration of Trademarks": {}
|
"Registration of Trademarks": {}
|
||||||
},
|
},
|
||||||
"Intercompany Accounts": {},
|
"Intercompany Accounts": {},
|
||||||
@@ -190,6 +188,9 @@
|
|||||||
},
|
},
|
||||||
"Expenses Included In Valuation": {
|
"Expenses Included In Valuation": {
|
||||||
"account_type": "Expenses Included In Valuation"
|
"account_type": "Expenses Included In Valuation"
|
||||||
|
},
|
||||||
|
"Stock Adjustment": {
|
||||||
|
"account_type": "Stock Adjustment"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Depreciation": {
|
"Depreciation": {
|
||||||
@@ -218,7 +219,7 @@
|
|||||||
},
|
},
|
||||||
"MISC Charges": {
|
"MISC Charges": {
|
||||||
"Other Charges": {
|
"Other Charges": {
|
||||||
"Captial Loss": {
|
"Capital Loss": {
|
||||||
"Disposal of Business Branch": {},
|
"Disposal of Business Branch": {},
|
||||||
"Loss On Fixed Assets Disposal": {},
|
"Loss On Fixed Assets Disposal": {},
|
||||||
"Loss on Difference on Exchange": {}
|
"Loss on Difference on Exchange": {}
|
||||||
@@ -253,14 +254,14 @@
|
|||||||
"Other Bank Charges": {}
|
"Other Bank Charges": {}
|
||||||
},
|
},
|
||||||
"Communications": {
|
"Communications": {
|
||||||
"Courrier": {},
|
"Courier": {},
|
||||||
"Others - Communication": {},
|
"Others - Communication": {},
|
||||||
"Telephone": {},
|
"Telephone": {},
|
||||||
"Web Site Hosting Fees": {}
|
"Web Site Hosting Fees": {}
|
||||||
},
|
},
|
||||||
"Office & Various Expenses": {
|
"Office & Various Expenses": {
|
||||||
"Cleaning": {},
|
"Cleaning": {},
|
||||||
"Convoyance Expenses": {},
|
"Conveyance Expenses": {},
|
||||||
"Gifts & Donations": {},
|
"Gifts & Donations": {},
|
||||||
"Insurance": {},
|
"Insurance": {},
|
||||||
"Kitchen and Buffet Expenses": {},
|
"Kitchen and Buffet Expenses": {},
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ def get_columns(filters):
|
|||||||
{
|
{
|
||||||
"label": _("Balance") + " (" + filters.account_currency + ")",
|
"label": _("Balance") + " (" + filters.account_currency + ")",
|
||||||
"fieldname": "balance_in_account_currency",
|
"fieldname": "balance_in_account_currency",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Float",
|
||||||
"width": 100
|
"width": 100
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ source_link = "https://github.com/frappe/erpnext"
|
|||||||
|
|
||||||
develop_version = '10.x.x-develop'
|
develop_version = '10.x.x-develop'
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
|
||||||
|
|
||||||
app_include_js = "assets/js/erpnext.min.js"
|
app_include_js = "assets/js/erpnext.min.js"
|
||||||
app_include_css = "assets/css/erpnext.css"
|
app_include_css = "assets/css/erpnext.css"
|
||||||
web_include_js = "assets/js/erpnext-web.min.js"
|
web_include_js = "assets/js/erpnext-web.min.js"
|
||||||
|
|||||||
@@ -381,6 +381,19 @@ def get_leave_balance_on(employee, leave_type, date, allocation_records=None,
|
|||||||
|
|
||||||
return flt(allocation.total_leaves_allocated) - flt(leaves_taken)
|
return flt(allocation.total_leaves_allocated) - flt(leaves_taken)
|
||||||
|
|
||||||
|
def get_total_allocated_leaves(employee, leave_type, date):
|
||||||
|
filters= {
|
||||||
|
'from_date': ['<=', date],
|
||||||
|
'to_date': ['>=', date],
|
||||||
|
'docstatus': 1,
|
||||||
|
'leave_type': leave_type,
|
||||||
|
'employee': employee
|
||||||
|
}
|
||||||
|
|
||||||
|
leave_allocation_records = frappe.db.get_all('Leave Allocation', filters=filters, fields=['total_leaves_allocated'])
|
||||||
|
|
||||||
|
return flt(leave_allocation_records[0]['total_leaves_allocated']) if leave_allocation_records else flt(0)
|
||||||
|
|
||||||
def get_approved_leaves_for_period(employee, leave_type, from_date, to_date):
|
def get_approved_leaves_for_period(employee, leave_type, from_date, to_date):
|
||||||
leave_applications = frappe.db.sql("""
|
leave_applications = frappe.db.sql("""
|
||||||
select employee, leave_type, from_date, to_date, total_leave_days
|
select employee, leave_type, from_date, to_date, total_leave_days
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from erpnext.hr.doctype.leave_application.leave_application \
|
from erpnext.hr.doctype.leave_application.leave_application \
|
||||||
import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period
|
import get_leave_allocation_records, get_leave_balance_on, get_approved_leaves_for_period, get_total_allocated_leaves
|
||||||
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
@@ -52,8 +52,7 @@ def get_data(filters, leave_types):
|
|||||||
filters.from_date, filters.to_date)
|
filters.from_date, filters.to_date)
|
||||||
|
|
||||||
# opening balance
|
# opening balance
|
||||||
opening = get_leave_balance_on(employee.name, leave_type, filters.from_date,
|
opening = get_total_allocated_leaves(employee.name, leave_type, filters.to_date)
|
||||||
allocation_records_based_on_from_date.get(employee.name, frappe._dict()))
|
|
||||||
|
|
||||||
# closing balance
|
# closing balance
|
||||||
closing = get_leave_balance_on(employee.name, leave_type, filters.to_date,
|
closing = get_leave_balance_on(employee.name, leave_type, filters.to_date,
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ erpnext.patches.v8_0.save_system_settings
|
|||||||
erpnext.patches.v8_1.delete_deprecated_reports
|
erpnext.patches.v8_1.delete_deprecated_reports
|
||||||
erpnext.patches.v9_0.remove_subscription_module
|
erpnext.patches.v9_0.remove_subscription_module
|
||||||
erpnext.patches.v8_7.make_subscription_from_recurring_data
|
erpnext.patches.v8_7.make_subscription_from_recurring_data
|
||||||
erpnext.patches.v8_1.setup_gst_india #2017-06-27
|
erpnext.patches.v8_1.setup_gst_india #2019-04-04
|
||||||
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
|
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
|
||||||
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
|
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
|
||||||
erpnext.patches.v8_1.gst_fixes #2017-07-06
|
erpnext.patches.v8_1.gst_fixes #2017-07-06
|
||||||
@@ -498,6 +498,7 @@ erpnext.patches.v10_0.update_hub_connector_domain
|
|||||||
erpnext.patches.v10_0.set_student_party_type
|
erpnext.patches.v10_0.set_student_party_type
|
||||||
erpnext.patches.v10_0.update_project_in_sle
|
erpnext.patches.v10_0.update_project_in_sle
|
||||||
erpnext.patches.v10_0.fix_reserved_qty_for_sub_contract
|
erpnext.patches.v10_0.fix_reserved_qty_for_sub_contract
|
||||||
|
erpnext.patches.v10_0.repost_requested_qty_for_non_stock_uom_items
|
||||||
erpnext.patches.v10_0.taxes_issue_with_pos
|
erpnext.patches.v10_0.taxes_issue_with_pos
|
||||||
erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input
|
erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input
|
||||||
erpnext.patches.v10_0.show_leaves_of_all_department_members_in_calendar
|
erpnext.patches.v10_0.show_leaves_of_all_department_members_in_calendar
|
||||||
@@ -509,3 +510,4 @@ erpnext.patches.v10_0.delete_hub_documents
|
|||||||
erpnext.patches.v10_0.update_user_image_in_employee
|
erpnext.patches.v10_0.update_user_image_in_employee
|
||||||
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
|
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
|
||||||
erpnext.patches.v10_0.allow_operators_in_supplier_scorecard
|
erpnext.patches.v10_0.allow_operators_in_supplier_scorecard
|
||||||
|
erpnext.patches.v10_0.gst_hsn_fixes
|
||||||
|
|||||||
18
erpnext/patches/v10_0/gst_hsn_fixes.py
Normal file
18
erpnext/patches/v10_0/gst_hsn_fixes.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import frappe
|
||||||
|
from erpnext.regional.india.setup import setup
|
||||||
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||||
|
if not company:
|
||||||
|
return
|
||||||
|
|
||||||
|
hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
|
||||||
|
fieldtype='Data', options='item_code.gst_hsn_code', insert_after='description',
|
||||||
|
allow_on_submit=1, print_hide=1)
|
||||||
|
|
||||||
|
custom_fields = {
|
||||||
|
'Material Request Item': [hsn_sac_field]
|
||||||
|
}
|
||||||
|
|
||||||
|
create_custom_fields(custom_fields)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Copyright (c) 2019, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty
|
||||||
|
|
||||||
|
count=0
|
||||||
|
for item_code, warehouse in frappe.db.sql("""select distinct item_code, warehouse
|
||||||
|
from `tabMaterial Request Item` where docstatus = 1 and stock_uom<>uom"""):
|
||||||
|
try:
|
||||||
|
count += 1
|
||||||
|
update_bin_qty(item_code, warehouse, {
|
||||||
|
"indented_qty": get_indented_qty(item_code, warehouse),
|
||||||
|
})
|
||||||
|
if count % 200 == 0:
|
||||||
|
frappe.db.commit()
|
||||||
|
except:
|
||||||
|
frappe.db.rollback()
|
||||||
@@ -143,6 +143,13 @@ class Task(NestedSet):
|
|||||||
|
|
||||||
self.update_nsm_model()
|
self.update_nsm_model()
|
||||||
|
|
||||||
|
def update_status(self):
|
||||||
|
if self.status not in ('Cancelled', 'Closed') and self.exp_end_date:
|
||||||
|
from datetime import datetime
|
||||||
|
if self.exp_end_date < datetime.now().date():
|
||||||
|
self.db_set('status', 'Overdue')
|
||||||
|
self.update_project()
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def check_if_child_exists(name):
|
def check_if_child_exists(name):
|
||||||
return frappe.db.sql("""select name from `tabTask`
|
return frappe.db.sql("""select name from `tabTask`
|
||||||
@@ -168,10 +175,9 @@ def set_multiple_status(names, status):
|
|||||||
task.save()
|
task.save()
|
||||||
|
|
||||||
def set_tasks_as_overdue():
|
def set_tasks_as_overdue():
|
||||||
frappe.db.sql("""update tabTask set `status`='Overdue'
|
tasks = frappe.get_all("Task", filters={'status':['not in',['Cancelled', 'Closed']]})
|
||||||
where exp_end_date is not null
|
for task in tasks:
|
||||||
and exp_end_date < CURDATE()
|
frappe.get_doc("Task", task.name).update_status()
|
||||||
and `status` not in ('Closed', 'Cancelled')""")
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_children(doctype, parent, task=None, project=None, is_root=False):
|
def get_children(doctype, parent, task=None, project=None, is_root=False):
|
||||||
|
|||||||
@@ -180,7 +180,8 @@ def make_custom_fields():
|
|||||||
'Sales Invoice Item': [hsn_sac_field],
|
'Sales Invoice Item': [hsn_sac_field],
|
||||||
'Purchase Order Item': [hsn_sac_field],
|
'Purchase Order Item': [hsn_sac_field],
|
||||||
'Purchase Receipt Item': [hsn_sac_field],
|
'Purchase Receipt Item': [hsn_sac_field],
|
||||||
'Purchase Invoice Item': [hsn_sac_field]
|
'Purchase Invoice Item': [hsn_sac_field],
|
||||||
|
'Material Request Item': [hsn_sac_field]
|
||||||
}
|
}
|
||||||
|
|
||||||
create_custom_fields(custom_fields)
|
create_custom_fields(custom_fields)
|
||||||
|
|||||||
@@ -93,6 +93,29 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
|||||||
refresh: function(doc, dt, dn) {
|
refresh: function(doc, dt, dn) {
|
||||||
var me = this;
|
var me = this;
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
|
if((!doc.is_return) && (doc.status!="Closed" || this.frm.is_new())) {
|
||||||
|
if (this.frm.doc.docstatus===0) {
|
||||||
|
this.frm.add_custom_button(__('Sales Order'),
|
||||||
|
function() {
|
||||||
|
erpnext.utils.map_current_doc({
|
||||||
|
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
||||||
|
source_doctype: "Sales Order",
|
||||||
|
target: me.frm,
|
||||||
|
setters: {
|
||||||
|
customer: me.frm.doc.customer || undefined,
|
||||||
|
},
|
||||||
|
get_query_filters: {
|
||||||
|
docstatus: 1,
|
||||||
|
status: ["!=", "Closed"],
|
||||||
|
per_delivered: ["<", 99.99],
|
||||||
|
company: me.frm.doc.company,
|
||||||
|
project: me.frm.doc.project || undefined,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, __("Get items from"));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!doc.is_return && doc.status!="Closed") {
|
if (!doc.is_return && doc.status!="Closed") {
|
||||||
if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1)
|
if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1)
|
||||||
this.frm.add_custom_button(__('Installation Note'), function() {
|
this.frm.add_custom_button(__('Installation Note'), function() {
|
||||||
@@ -114,27 +137,6 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
|||||||
if (!doc.__islocal && doc.docstatus==1) {
|
if (!doc.__islocal && doc.docstatus==1) {
|
||||||
this.frm.page.set_inner_btn_group_as_primary(__("Make"));
|
this.frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.frm.doc.docstatus===0) {
|
|
||||||
this.frm.add_custom_button(__('Sales Order'),
|
|
||||||
function() {
|
|
||||||
erpnext.utils.map_current_doc({
|
|
||||||
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
|
||||||
source_doctype: "Sales Order",
|
|
||||||
target: me.frm,
|
|
||||||
setters: {
|
|
||||||
customer: me.frm.doc.customer || undefined,
|
|
||||||
},
|
|
||||||
get_query_filters: {
|
|
||||||
docstatus: 1,
|
|
||||||
status: ["!=", "Closed"],
|
|
||||||
per_delivered: ["<", 99.99],
|
|
||||||
company: me.frm.doc.company,
|
|
||||||
project: me.frm.doc.project || undefined,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, __("Get items from"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc.docstatus==1) {
|
if (doc.docstatus==1) {
|
||||||
|
|||||||
@@ -381,6 +381,9 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
doclist = get_mapped_doc("Purchase Receipt", source_name, {
|
doclist = get_mapped_doc("Purchase Receipt", source_name, {
|
||||||
"Purchase Receipt": {
|
"Purchase Receipt": {
|
||||||
"doctype": "Purchase Invoice",
|
"doctype": "Purchase Invoice",
|
||||||
|
"field_map": {
|
||||||
|
"supplier_warehouse": "supplier_warehouse"
|
||||||
|
},
|
||||||
"validation": {
|
"validation": {
|
||||||
"docstatus": ["=", 1],
|
"docstatus": ["=", 1],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ def get_reserved_qty(item_code, warehouse):
|
|||||||
return flt(reserved_qty[0][0]) if reserved_qty else 0
|
return flt(reserved_qty[0][0]) if reserved_qty else 0
|
||||||
|
|
||||||
def get_indented_qty(item_code, warehouse):
|
def get_indented_qty(item_code, warehouse):
|
||||||
indented_qty = frappe.db.sql("""select sum(mr_item.qty - mr_item.ordered_qty)
|
indented_qty = frappe.db.sql("""select sum((mr_item.qty - mr_item.ordered_qty) * mr_item.conversion_factor)
|
||||||
from `tabMaterial Request Item` mr_item, `tabMaterial Request` mr
|
from `tabMaterial Request Item` mr_item, `tabMaterial Request` mr
|
||||||
where mr_item.item_code=%s and mr_item.warehouse=%s
|
where mr_item.item_code=%s and mr_item.warehouse=%s
|
||||||
and mr_item.qty > mr_item.ordered_qty and mr_item.parent=mr.name
|
and mr_item.qty > mr_item.ordered_qty and mr_item.parent=mr.name
|
||||||
|
|||||||
@@ -4,50 +4,35 @@
|
|||||||
import frappe, erpnext
|
import frappe, erpnext
|
||||||
|
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from six import iteritems
|
||||||
|
|
||||||
def get_level():
|
def get_level():
|
||||||
|
|
||||||
activation_level = 0
|
activation_level = 0
|
||||||
|
sales_data = []
|
||||||
|
doctypes = {"Item": 5, "Customer": 5, "Sales Order": 2, "Sales Invoice": 2, "Purchase Order": 2, "Employee": 3, "Lead": 3, "Quotation": 3,
|
||||||
|
"Payment Entry": 2, "User": 5, "Student": 5, "Instructor": 5, "BOM": 3, "Journal Entry": 3, "Stock Entry": 3}
|
||||||
|
for doctype, min_count in iteritems(doctypes):
|
||||||
|
count = frappe.db.count(doctype)
|
||||||
|
if count > min_count:
|
||||||
|
activation_level += 1
|
||||||
|
sales_data.append({doctype: count})
|
||||||
|
|
||||||
if frappe.db.get_single_value('System Settings', 'setup_complete'):
|
if frappe.db.get_single_value('System Settings', 'setup_complete'):
|
||||||
activation_level = 1
|
|
||||||
|
|
||||||
if frappe.db.count('Item') > 5:
|
|
||||||
activation_level += 1
|
activation_level += 1
|
||||||
|
|
||||||
if frappe.db.count('Customer') > 5:
|
communication_number = frappe.db.count('Communication', dict(communication_medium='Email'))
|
||||||
activation_level += 1
|
if communication_number > 10:
|
||||||
|
|
||||||
if frappe.db.count('Sales Order') > 2:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Purchase Order') > 2:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Employee') > 3:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Lead') > 3:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Payment Entry') > 2:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Communication', dict(communication_medium='Email')) > 10:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('User') > 5:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Student') > 5:
|
|
||||||
activation_level += 1
|
|
||||||
|
|
||||||
if frappe.db.count('Instructor') > 5:
|
|
||||||
activation_level += 1
|
activation_level += 1
|
||||||
|
sales_data.append({"Communication": communication_number})
|
||||||
|
|
||||||
# recent login
|
# recent login
|
||||||
if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'):
|
if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'):
|
||||||
activation_level += 1
|
activation_level += 1
|
||||||
|
|
||||||
return activation_level
|
level = {"activation_level": activation_level, "sales_data": sales_data}
|
||||||
|
|
||||||
|
return level
|
||||||
|
|
||||||
def get_help_messages():
|
def get_help_messages():
|
||||||
'''Returns help messages to be shown on Desktop'''
|
'''Returns help messages to be shown on Desktop'''
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
frappe
|
frappe
|
||||||
unidecode
|
Unidecode==1.1.1
|
||||||
pygithub
|
PyGithub==1.43.8
|
||||||
googlemaps
|
googlemaps==3.0.2
|
||||||
|
|||||||
Reference in New Issue
Block a user