merge, fixed production cleanup patch
This commit is contained in:
commit
05de088473
@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-08-06 11:15:46",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-08-02 18:04:35"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"is_submittable": 1,
|
||||
@ -698,7 +698,7 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Production Manager",
|
||||
"role": "Manufacturing Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
|
@ -265,7 +265,7 @@ class DocType:
|
||||
# module settings
|
||||
# -------------------------------------------------------------------------------------------------------
|
||||
def get_module_order(self):
|
||||
show_list = ['Home','Setup','Accounts','Selling','Buying','Support','Stock','HR','Projects','Analysis','Production']
|
||||
show_list = ['Home','Setup','Accounts','Selling','Buying','Support','Stock','HR','Projects','Analysis','Manufacturing']
|
||||
ml = filter(lambda x: x[0] in show_list, \
|
||||
sql("select name, module_label, module_seq, is_hidden from `tabModule Def` where docstatus<2 order by module_seq asc, module_label asc"))
|
||||
return webnotes.conn.convert_to_lists(ml)
|
||||
|
@ -6,7 +6,7 @@
|
||||
.sprite-hr{ background-position: 0 -439px; width: 40px; height: 32px; }
|
||||
.sprite-kb{ background-position: 0 -521px; width: 24px; height: 39px; }
|
||||
.sprite-messages{ background-position: 0 -610px; width: 40px; height: 26px; }
|
||||
.sprite-production{ background-position: 0 -686px; width: 40px; height: 33px; }
|
||||
.sprite-manufacturing{ background-position: 0 -686px; width: 40px; height: 33px; }
|
||||
.sprite-project{ background-position: 0 -769px; width: 40px; height: 22px; }
|
||||
.sprite-report{ background-position: 0 -841px; width: 29px; height: 40px; }
|
||||
.sprite-selling{ background-position: 0 -931px; width: 34px; height: 40px; }
|
||||
@ -26,7 +26,7 @@
|
||||
.sprite-support{ margin-top: 8px; margin-left: 8px; }
|
||||
.sprite-hr{ margin-top: 12px; margin-left: 8px; }
|
||||
.sprite-project{ margin-top: 16px; margin-left: 8px; }
|
||||
.sprite-production{ margin-top: 10px; margin-left: 8px; }
|
||||
.sprite-manufacturing{ margin-top: 10px; margin-left: 8px; }
|
||||
.sprite-website{ margin-top: 8px; margin-left: 8px; }
|
||||
.sprite-setting{ margin-top: 8px; margin-left: 8px; }
|
||||
.sprite-report{ margin-top: 8px; margin-left: 14px; }
|
||||
|
@ -33,7 +33,7 @@ erpnext.desktop.render = function() {
|
||||
'Support': { sprite: 'support', label: 'Support'},
|
||||
'HR': { sprite: 'hr', label: 'Human<br />Resources'},
|
||||
'Projects': { sprite: 'project', label: 'Projects'},
|
||||
'Production': { sprite: 'production', label: 'Production'},
|
||||
'Manufacturing': { sprite: 'manufacturing', label: 'Manufacturing'},
|
||||
'Website': { sprite: 'website', label: 'Website'},
|
||||
'Activity': { sprite: 'feed', label: 'Activity'},
|
||||
'Setup': { sprite: 'setting', label: 'Setup'},
|
||||
|
5
manufacturing/__init__.py
Normal file
5
manufacturing/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
install_docs = [
|
||||
{"doctype":"Role", "role_name":"Manufacturing Manager", "name":"Manufacturing Manager"},
|
||||
{"doctype":"Role", "role_name":"Manufacturing User", "name":"Manufacturing User"},
|
||||
]
|
@ -4,14 +4,14 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:03",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-10 12:03:14"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"istable": 0,
|
||||
"in_create": 0,
|
||||
"allow_print": 0,
|
||||
"search_fields": "item",
|
||||
"module": "Production",
|
||||
"module": "Manufacturing",
|
||||
"document_type": "Master",
|
||||
"allow_attach": 0,
|
||||
"read_only": 0,
|
||||
@ -316,13 +316,13 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Production Manager",
|
||||
"role": "Manufacturing Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Production Manager",
|
||||
"role": "Manufacturing Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
@ -330,13 +330,13 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Production User",
|
||||
"role": "Manufacturing User",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Production User",
|
||||
"role": "Manufacturing User",
|
||||
"permlevel": 1
|
||||
}
|
||||
]
|
@ -1,10 +1,10 @@
|
||||
[
|
||||
{
|
||||
"owner": "jai@webnotestech.com",
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:04",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-10 12:05:27"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"read_only": 0,
|
||||
@ -13,7 +13,7 @@
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"doctype": "DocType",
|
||||
"module": "Production"
|
||||
"module": "Manufacturing"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-03-27 14:36:02',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:02',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -16,7 +16,7 @@
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
'istable': 1,
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-03-27 14:36:02',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:02',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -16,7 +16,7 @@
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
'istable': 1,
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
@ -4,14 +4,14 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:03",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 15:38:54"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"is_submittable": 1,
|
||||
"in_create": 0,
|
||||
"default_print_format": "Standard",
|
||||
"doctype": "DocType",
|
||||
"module": "Production",
|
||||
"module": "Manufacturing",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
@ -307,7 +307,7 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Production Manager",
|
||||
"role": "Manufacturing Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
@ -317,7 +317,7 @@
|
||||
"doctype": "DocPerm",
|
||||
"submit": 1,
|
||||
"write": 1,
|
||||
"role": "Production User",
|
||||
"role": "Manufacturing User",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:04",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-29 19:02:38"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"istable": 1,
|
||||
@ -12,7 +12,7 @@
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"doctype": "DocType",
|
||||
"module": "Production"
|
||||
"module": "Manufacturing"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:04",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-11-29 17:49:15"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"istable": 1,
|
||||
@ -12,7 +12,7 @@
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"doctype": "DocType",
|
||||
"module": "Production"
|
||||
"module": "Manufacturing"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:03",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-03 15:39:44"
|
||||
"modified": "2012-12-10 18:30:00"
|
||||
},
|
||||
{
|
||||
"read_only": 1,
|
||||
@ -12,7 +12,7 @@
|
||||
"in_create": 1,
|
||||
"default_print_format": "Standard",
|
||||
"doctype": "DocType",
|
||||
"module": "Production",
|
||||
"module": "Manufacturing",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
@ -209,11 +209,11 @@
|
||||
"doctype": "DocPerm"
|
||||
},
|
||||
{
|
||||
"role": "Production User",
|
||||
"role": "Manufacturing User",
|
||||
"doctype": "DocPerm"
|
||||
},
|
||||
{
|
||||
"role": "Production Manager",
|
||||
"role": "Manufacturing Manager",
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-03-27 14:36:05',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 18:46:49',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -20,7 +20,7 @@
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
@ -76,7 +76,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Production User',
|
||||
'role': u'Manufacturing User',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Production User',
|
||||
'role': u'Manufacturing User',
|
||||
'write': 1
|
||||
},
|
||||
|
||||
@ -94,14 +94,14 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Production Manager'
|
||||
'role': u'Manufacturing Manager'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Production User'
|
||||
'role': u'Manufacturing User'
|
||||
},
|
||||
|
||||
# DocField
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pscript['onload_production-home'] = function(wrapper) {
|
||||
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'Production');
|
||||
erpnext.module_page.setup_page('Production', wrapper);
|
||||
pscript['onload_manufacturing-home'] = function(wrapper) {
|
||||
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'Manufacturing');
|
||||
erpnext.module_page.setup_page('Manufacturing', wrapper);
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-02-21 13:24:34',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-02-21 13:24:34',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -13,16 +13,16 @@
|
||||
# These values are common for all Page
|
||||
{
|
||||
'doctype': 'Page',
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'page_name': u'production-home',
|
||||
'page_name': u'manufacturing-home',
|
||||
'standard': u'Yes',
|
||||
'title': u'Production Home'
|
||||
'title': u'Manufacturing Home'
|
||||
},
|
||||
|
||||
# Page, production-home
|
||||
{
|
||||
'doctype': 'Page',
|
||||
'name': u'production-home'
|
||||
'name': u'manufacturing-home'
|
||||
}
|
||||
]
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-03 12:49:50',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-03 12:49:50',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'jai@webnotestech.com'
|
||||
},
|
||||
@ -20,7 +20,7 @@
|
||||
'doc_type': u'Stock Entry Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': u"{'Stock Entry\x01Submitted':1,'Stock Entry\x01Purpose':'Production Order','Stock Entry\x01Process':''}",
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': u'Stock Entry',
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-03 12:49:51',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-03 12:49:51',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'jai@webnotestech.com'
|
||||
},
|
||||
@ -17,7 +17,7 @@
|
||||
'doc_type': u'Stock Entry Detail',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': u"{'Stock Entry\x01Saved':1,'Stock Entry\x01Submitted':1,'Stock Entry\x01Purpose':'Production Order','Stock Entry\x01Process':'Backflush','Stock Entry Detail\x01FG Item':1}",
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'parent_doc_type': u'Stock Entry',
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-03 12:49:52',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-03 12:49:52',
|
||||
'modified': '2012-12-10 18:30:00',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'jai@webnotestech.com'
|
||||
},
|
||||
@ -18,7 +18,7 @@
|
||||
'doc_type': u'Production Order',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': u"{'Production Order\x01Submitted':1,'Production Order\x01Origin':'','Production Order\x01Status':'','Production Order\x01Consider SA Items':'','Production Order\x01Fiscal Year':''}",
|
||||
'module': u'Production',
|
||||
'module': u'Manufacturing',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_by': u'`tabProduction Order`.`name`',
|
@ -1,31 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('accounts', 'doctype', 'pv_detail')
|
||||
reload_doc('buying', 'doctype', 'po_detail')
|
||||
reload_doc('stock', 'doctype', 'purchase_receipt_detail')
|
||||
if webnotes.conn.sql("select name from `tabDocField` where parent = 'Purchase Order Item' and fieldname = 'discount'"):
|
||||
webnotes.conn.sql("update `tabPurchase Order Item` set discount_rate=discount")
|
||||
|
||||
# Features setup
|
||||
reload_doc('setup', 'doctype', 'features_setup')
|
||||
from webnotes.model.code import get_obj
|
||||
get_obj('Features Setup').validate()
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('setup', 'doctype', 'company')
|
||||
reload_doc('setup', 'doctype', 'manage_account')
|
||||
|
@ -1,25 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('setup', 'doctype', 'manage_account')
|
||||
reload_doc('stock', 'doctype', 'item')
|
||||
webnotes.conn.sql("delete from `tabDocField` where fieldname='minimum_inventory_level' and parent='item'")
|
||||
webnotes.conn.sql("update `tabItem` set re_order_level = minimum_inventory_level where ifnull(re_order_level,0) = 0 ")
|
||||
|
@ -1,29 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('accounts', 'doctype', 'receivable_voucher')
|
||||
reload_doc('accounts', 'doctype', 'c_form')
|
||||
reload_doc('accounts', 'doctype', 'c_form_invoice_detail')
|
||||
reload_doc('accounts', 'Module Def', 'Accounts')
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
sql("update `tabSales Invoice` set c_form_applicable = 'Yes' where c_form_applicable = 'Y'")
|
||||
sql("update `tabSales Invoice` set c_form_applicable = 'No' where c_form_applicable = 'N'")
|
@ -1,72 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
test=1
|
||||
|
||||
# Update SO and DN Detail
|
||||
#--------------------------
|
||||
def update_delivered_billed_qty():
|
||||
# update billed amt in item table in so and dn
|
||||
sql(""" update `tabSales Order Item` so
|
||||
set billed_amt = (select sum(amount) from `tabSales Invoice Item` where `so_detail`= so.name and docstatus=1 and parent not like 'old%%'),
|
||||
delivered_qty = (select sum(qty) from `tabDelivery Note Item` where `prevdoc_detail_docname`= so.name and docstatus=1 and parent not like 'old%%'),
|
||||
modified = now()
|
||||
where docstatus = 1
|
||||
""")
|
||||
|
||||
sql(""" update `tabDelivery Note Item` dn
|
||||
set billed_amt = (select sum(amount) from `tabSales Invoice Item` where `dn_detail`= dn.name and docstatus=1 and parent not like 'old%%'),
|
||||
modified = now()
|
||||
where docstatus = 1
|
||||
""")
|
||||
|
||||
# update SO
|
||||
#---------------
|
||||
def update_percent():
|
||||
# calculate % billed based on item table
|
||||
sql(""" update `tabSales Order` so
|
||||
set per_delivered = (select sum(if(qty > ifnull(delivered_qty, 0), delivered_qty, qty))/sum(qty)*100 from `tabSales Order Item` where parent=so.name),
|
||||
per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabSales Order Item` where parent = so.name),
|
||||
modified = now()
|
||||
where docstatus = 1
|
||||
""")
|
||||
|
||||
# update DN
|
||||
# ---------
|
||||
sql(""" update `tabDelivery Note` dn
|
||||
set per_billed = (select sum(if(amount > ifnull(billed_amt, 0), billed_amt, amount))/sum(amount)*100 from `tabDelivery Note Item` where parent = dn.name),
|
||||
modified = now()
|
||||
where docstatus=1
|
||||
""")
|
||||
|
||||
# update delivery/billing status
|
||||
#-------------------------------
|
||||
def update_status():
|
||||
sql("""update `tabSales Order` set delivery_status = if(ifnull(per_delivered,0) < 0.001, 'Not Delivered',
|
||||
if(per_delivered >= 99.99, 'Fully Delivered', 'Partly Delivered'))""")
|
||||
sql("""update `tabSales Order` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed',
|
||||
if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""")
|
||||
sql("""update `tabDelivery Note` set billing_status = if(ifnull(per_billed,0) < 0.001, 'Not Billed',
|
||||
if(per_billed >= 99.99, 'Fully Billed', 'Partly Billed'))""")
|
||||
|
||||
def execute():
|
||||
update_delivered_billed_qty()
|
||||
update_percent()
|
||||
update_status()
|
@ -1,113 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
"""
|
||||
* Reload email_digest doctype
|
||||
* Create default email digest
|
||||
"""
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
# Minor fix in print_format doctype
|
||||
#reload_doc('core', 'doctype', 'print_format')
|
||||
|
||||
#reload_doc('setup', 'doctype', 'email_digest')
|
||||
|
||||
#global create_default_email_digest
|
||||
#create_default_email_digest()
|
||||
|
||||
global enabled_default_email_digest
|
||||
enabled_default_email_digest()
|
||||
|
||||
|
||||
def enabled_default_email_digest():
|
||||
"""
|
||||
Enables the created email digest
|
||||
"""
|
||||
from webnotes.model.doc import Document
|
||||
from webnotes.model.code import get_obj
|
||||
companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
|
||||
for company in companies_list:
|
||||
if company and company[0]:
|
||||
edigest = Document('Email Digest', 'Default Weekly Digest - ' + company[0])
|
||||
if edigest:
|
||||
edigest.enabled = 1
|
||||
edigest.save()
|
||||
ed_obj = get_obj(doc=edigest)
|
||||
ed_obj.on_update()
|
||||
|
||||
|
||||
|
||||
def create_default_email_digest():
|
||||
"""
|
||||
* Weekly Digest
|
||||
* For all companies
|
||||
* Recipients: System Managers
|
||||
* Full content
|
||||
* Disabled by default
|
||||
"""
|
||||
from webnotes.model.doc import Document
|
||||
companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
|
||||
global get_system_managers
|
||||
system_managers = get_system_managers()
|
||||
for company in companies_list:
|
||||
if company and company[0]:
|
||||
edigest = Document('Email Digest')
|
||||
edigest.name = "Default Weekly Digest - " + company[0]
|
||||
edigest.company = company[0]
|
||||
edigest.frequency = 'Weekly'
|
||||
edigest.recipient_list = system_managers
|
||||
edigest.new_leads = 1
|
||||
edigest.new_enquiries = 1
|
||||
edigest.new_quotations = 1
|
||||
edigest.new_sales_orders = 1
|
||||
edigest.new_purchase_orders = 1
|
||||
edigest.new_transactions = 1
|
||||
edigest.payables = 1
|
||||
edigest.payments = 1
|
||||
edigest.expenses_booked = 1
|
||||
edigest.invoiced_amount = 1
|
||||
edigest.collections = 1
|
||||
edigest.income = 1
|
||||
edigest.bank_balance = 1
|
||||
exists = webnotes.conn.sql("""\
|
||||
SELECT name FROM `tabEmail Digest`
|
||||
WHERE name = %s""", edigest.name)
|
||||
if (exists and exists[0]) and exists[0][0]:
|
||||
continue
|
||||
else:
|
||||
edigest.save(1)
|
||||
|
||||
|
||||
def get_system_managers():
|
||||
"""
|
||||
Returns a string of system managers' email addresses separated by \n
|
||||
"""
|
||||
system_managers_list = webnotes.conn.sql("""\
|
||||
SELECT DISTINCT p.name
|
||||
FROM tabUserRole ur, tabProfile p
|
||||
WHERE
|
||||
ur.parent = p.name AND
|
||||
ur.role='System Manager' AND
|
||||
p.docstatus<2 AND
|
||||
p.enabled=1 AND
|
||||
p.name not in ('Administrator', 'Guest')""", as_list=1)
|
||||
|
||||
return "\n".join([sysman[0] for sysman in system_managers_list])
|
||||
|
@ -1,28 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.model.doc import Document
|
||||
|
||||
def execute():
|
||||
companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
|
||||
for company in companies_list:
|
||||
if company and company[0]:
|
||||
edigest = Document('Email Digest', "Default Weekly Digest - " + company[0])
|
||||
if edigest:
|
||||
edigest.income_year_to_date = 1
|
||||
edigest.save()
|
@ -1,217 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#Cleanup all unwanted documents and restructure of moduloes
|
||||
#----------------------------------------------------------
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
from webnotes.model import delete_doc
|
||||
from webnotes.modules import reload_doc
|
||||
from webnotes.modules.export_file import export_to_files
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
|
||||
#----------------------------
|
||||
|
||||
def delete_unwanted_doctypes():
|
||||
"deletes doctypes which are not used anymore"
|
||||
|
||||
try:
|
||||
sql("delete from `tabMenu Item`")
|
||||
sql("delete from tabDocField where fieldname = 'site_map_details' and parent ='Control Panel'")
|
||||
except:
|
||||
pass
|
||||
|
||||
lst = ['Zone', 'WN Account Control', 'Wiki Page', 'Wiki History', 'Wiki Control', 'While You Were Out', 'Web Visitor', 'Tweet', 'Transfer Utility', 'Transfer Module', 'Transfer Control', 'Transfer Account', 'Tips Common', 'TestTabDT', 'TestDT', 'Test Type', 'Test Run', 'Test Record Detail', 'Test Record', 'Test Case', 'Supplier TDS Category Detail', 'Shopping Cart Control', 'Service Series', 'Series Detail', 'Rule Engine', 'RFQ', 'Report Filter Detail', 'Report Field Detail','Report Control', 'Rating Widget Record', 'Rating Widget Control', 'Rating Template Detail', 'Rating Template', 'PV Ded Tax Detail', 'PV Add Tax Detail', 'Product Variant', 'Product Variance', 'Product Group', 'Product Feature', 'Payroll Tips Common', 'Payroll Rule', 'Password Control', 'Page Visit', 'Patch', 'Multiple Transfer', 'Module Tip Control', 'Module Setter', 'Module Manager', 'Module Import', 'Module Detail', 'Message Control', 'Message', 'Mail Participant Details', 'Mail', 'Leave Type Detail', 'Leave Detail', 'Leave Applicable Detail', 'Lead Item Detail', 'Lead Attachment Detail', 'Item Attachments Detail', 'Instant Message', 'Impact Analysis', 'Forum Topic', 'Forum Control', 'Form Settings', 'Follower', 'ERP Setup', 'Enquiry Attachment Detail', 'Documentation', 'Condition Detail', 'Complaint Note', 'Code History', 'Code Editor', 'Code Backup Control', 'Code Backup', 'City', 'Change Log', 'Business Letter Type', 'Business Letter Template', 'Business Letter', 'Badge Settings Detail', 'Application Type', 'Application', 'Action Detail', 'Accounts Setup', 'Stock Common', 'Job Application', 'Service Schedule', 'Comment Control', 'Bank', 'Tag Widget Control', 'Feature Update', 'RFQ Detail', 'Supplier Quotation Detail', 'Supplier Quotation', 'Year Closing Voucher', 'Approval Structure', 'Site Map Detail', 'Menu Control', 'Menu Item', 'Menu Item Role'] # bank
|
||||
for d in lst:
|
||||
try:
|
||||
sql("delete from `tabProperty Setter` where select_doctype = '%s'" % d)
|
||||
sql("delete from `tabCustom Script` where dt = '%s'" % d)
|
||||
sql("delete from `tabCustom Field` where dt = '%s'" % d)
|
||||
delete_doc('DocType', d)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
sql("commit")
|
||||
delete_tables(lst)
|
||||
|
||||
def delete_tables(lst):
|
||||
for d in lst:
|
||||
for t in ['tab', 'arc']:
|
||||
try:
|
||||
sql("drop table `%s%s`" % (t, d))
|
||||
except:
|
||||
continue
|
||||
|
||||
def delete_unwanted_pages():
|
||||
"deletes pages which are not used anymore"
|
||||
lst = ['Transaction Authorization', 'Prduct Display', 'Data Import', 'Partner Home', 'Product Display', 'Module Settings', 'About Us', 'Custom Reports', 'MIS', 'MIS - Comparison Report', 'Monthly MIS', 'MyReports', 'Navigation Page', 'Point Race', 'Tag Widget', 'Widget Test', 'Yearly MIS']
|
||||
for d in lst:
|
||||
try:
|
||||
delete_doc('Page', d)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def delete_unwanted_search_criteria():
|
||||
"deletes search criteria which are not used anymore"
|
||||
|
||||
sql("update `tabSearch Criteria` set module = 'HR' where name = 'salary_structure_details'")
|
||||
|
||||
lst = ['_SRCH00002', '_SRCH00001', 'warranty-amc_summary1', 'test_so4', 'test_so3', 'test_so2', 'test_so1', 'test_so', 'test5', 'target_variance_report1', 'STDSRCH/00006', 'STDSRCH/00005', 'STDSRCH/00004', 'STDSRCH/00003', 'STDSRCH/00002', 'STDSRCH/00001', 'so_pending_items_6', 'so_pending_items_5', 'so_pending_items_3', 'so_pending_items_34', 'scrap', 'sales_report_test', 'salary_structure_details1', 'salary_structure_details2', 'salary_structure_details3', 'salary_slips1', 'projectwise_pending_qty_and_costs2', 'projectwise_pending_qty_and_costs1', 'projectwise_delivered_qty_and_costs1', 'projectwise_delivered_qty_and_costs2', 'New Search Criteria 1', 'monthly_salary_register2', 'monthly_salary_register1', 'installed_items','follow_up_history', 'follow_up_report', 'employee_in_company_experience2', 'employee_in_company_experience1', 'employee_in_company_experience', 'employee_details', 'employee_details1', 'employee_details2', 'employees_birthday1', 'draft_so_pending_items', 'draft_sales_orders', 'delivery_notewise_pending_qty_to_install', 'datewise_leave_report2', 'datewise_leave_report1', 'datewise_leave_report', 'customer_issues1', 'cancelled_so_pending_items1', 'cancelled_so_pending_items', 'budget_variance_report3', 'budget_variance_report1', 'account_-_inputs_rg_23_a_-_part_ii_wrong_one', 'territory_item_group_wise_gp', 'sales_orderwise_pending_packing_item_summary', 'itemwise_trend', 'monthly_attendance_details_old', 'projectwise_contribution_report', 'projectwise_delivery_and_material_cost', 'projectwise_delivery_and_mat_cost_report', 'territorywise_trend', 'test_dn', 'rfq', 'rfq1']
|
||||
|
||||
for d in lst:
|
||||
if sql("select name from `tabSearch Criteria` where ifnull(standard, 'Yes') = 'Yes' and name = '%s'" % d):
|
||||
try:
|
||||
delete_doc('Search Criteria', d)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def delete_unwanted_mappers():
|
||||
"deletes unwanted mappers"
|
||||
|
||||
lst = ['Customer Issue-Maintenance Report', 'Enquiry-Service Quotation', 'Sales Order-Maintenance Report', 'Service Quotation-Service Order', 'Supplier Quotation-Purchase Order', 'Visit Schedule-Maintenance Report', 'RFQ-Supplier Quotation', 'Purchase Request-RFQ']
|
||||
for d in lst:
|
||||
try:
|
||||
delete_doc('DocType Mapper', d)
|
||||
except:
|
||||
pass
|
||||
|
||||
def delete_unwanted_modules():
|
||||
"deletes unwanted modules"
|
||||
lst = ['Development', 'Recycle Bin', 'Testing', 'Testing System', 'Test', 'Partner Updates', 'My Company', 'Event Updates', 'E-Commerce']
|
||||
for d in lst:
|
||||
try:
|
||||
delete_doc('Module Def', d)
|
||||
except:
|
||||
pass
|
||||
|
||||
#---------------------------------------------
|
||||
|
||||
def rename_merge_modules():
|
||||
"Rename module as per users view and merge for removing confusion"
|
||||
|
||||
rename_lst = [['CRM', 'Selling'], ['SRM','Buying'], ['Material Management', 'Stock'], ['Payroll','HR'], ['Maintenance', 'Support']]
|
||||
for d in rename_lst:
|
||||
# create new module manually and export to file???????
|
||||
reload_doc(d[1].lower(), 'Module Def', d[1])
|
||||
|
||||
merge_lst = [['Tools', 'Utilities'], ['Application Internal', 'Utilities'], ['Settings', 'Setup']]
|
||||
# settings hardcoded in my_company
|
||||
# module hardcoded in home_control
|
||||
# material_management hardcoded in installation note
|
||||
# maintenance hardcoded in support_email_settings
|
||||
|
||||
lst = rename_lst + merge_lst
|
||||
for d in lst:
|
||||
update_module(d[0], d[1])
|
||||
try:
|
||||
delete_doc('Module Def', d[0])
|
||||
except:
|
||||
pass
|
||||
reload_doc('Utilities', 'Module Def', 'Utilities')
|
||||
|
||||
def update_module(from_mod, to_mod):
|
||||
for t in ['DocType', 'Page', 'Search Criteria', 'DocType Mapper', 'Print Format', 'Role']:
|
||||
sql("update `tab%s` set module='%s' where module = '%s'"% (t, to_mod, from_mod))
|
||||
|
||||
#------------------------------------
|
||||
def sync_roles():
|
||||
"Put Roles into corresponding module and delete Roles module"
|
||||
|
||||
# roles
|
||||
roles = {
|
||||
'Accounts' : "'Accounts Manager', 'Accounts User', 'Auditor'",
|
||||
'Selling' : "'Customer', 'Sales User', 'Sales Manager', 'Sales Master Manager', 'Partner'",
|
||||
'Buying' : "'Supplier', 'Purchase User', 'Purchase Manager', 'Purchase Master Manager'",
|
||||
'Stock' : "'Material User', 'Material Master Manager', 'Material Manager', 'Quality Manager'",
|
||||
'Support' : "'Support Team', 'Support Manager', 'Maintenance User', 'Maintenance Manager'",
|
||||
'Production': "'Production User', 'Production Manager', 'Production Master Manager'",
|
||||
'Setup' : "'System Manager'",
|
||||
'Projects' : "'Projects User'",
|
||||
'HR' : "'HR User', 'HR Manager', 'Employee'",
|
||||
'Core' : "'Administrator', 'All', 'Guest'"
|
||||
}
|
||||
for mod in roles.keys():
|
||||
sql("update `tabRole` set module = '%s' where name in (%s)" % (mod, roles[mod]))
|
||||
|
||||
sql("update `tabDocType` set module = 'Setup' where name = 'Role'")
|
||||
try:
|
||||
|
||||
delete_doc('Module Def', 'Roles')
|
||||
except:
|
||||
pass
|
||||
#------------------------------------
|
||||
def sync_mapper():
|
||||
"Put mappers into corresponding module"
|
||||
|
||||
mappers = {
|
||||
'Accounts': ('Delivery Note-Sales Invoice', 'Project-Sales Invoice', 'Purchase Order-Purchase Invoice', 'Purchase Receipt-Purchase Invoice', 'Sales Order-Sales Invoice'),
|
||||
'Selling': ('Delivery Note-Installation Note', 'Opportunity-Quotation', 'Lead-Opportunity', 'Lead-Customer', 'Project-Sales Order', 'Quotation-Sales Order', ),
|
||||
'Buying': ('Purchase Request-Purchase Order', 'Sales Order-Purchase Request'),
|
||||
'Stock': ('Purchase Order-Purchase Receipt', 'Project-Delivery Note', 'Sales Invoice-Delivery Note', 'Sales Order-Delivery Note'),
|
||||
'Support': ('Customer Issue-Maintenance Visit', 'Sales Order-Maintenance Schedule', 'Sales Order-Maintenance Visit'),
|
||||
'Production': ('Production Forecast-Production Plan', 'Production Forecast-Production Planning Tool', 'Sales Order-Production Plan'),
|
||||
'HR': ('Appraisal Template-Appraisal', 'Salary Structure-Salary Slip')
|
||||
}
|
||||
|
||||
for mod in mappers.keys():
|
||||
sql("update `tabDocType Mapper` set module = '%s' where name in %s" % (mod, mappers[mod]))
|
||||
try:
|
||||
delete_doc('Module Def', 'Mapper')
|
||||
except:
|
||||
pass
|
||||
# --------------------------------------
|
||||
# function below will be run only in localhost
|
||||
'''def export_docs():
|
||||
"""
|
||||
Export all documents where module has been changed
|
||||
"""
|
||||
for dtype in ['DocType', 'Page', 'Search Criteria', 'DocType Mapper', 'Print Format', 'Role']:
|
||||
lst = sql("select name, module from `tab%s`" % dtype)
|
||||
for rec in lst:
|
||||
webnotes.msgprint(rec)
|
||||
if rec and rec[0] and rec[1]:
|
||||
export_to_files(record_list = [[dtype, rec[0]]], record_module = rec[1])
|
||||
|
||||
#grep test company
|
||||
'''
|
||||
|
||||
#---------------------------------------
|
||||
def run_patches():
|
||||
# update module
|
||||
dt_module = {'Landed Cost Purchase Receipt':'Stock', 'Landed Cost Item':'Stock', 'Comment': 'Core', 'Tag':'Core', 'Tag Detail': 'Core', 'POS Settings': 'Accounts', 'Menu Item': 'Setup', 'Menu Item Role': 'Setup'}
|
||||
for d in dt_module.keys():
|
||||
sql("update `tabDocType` set module = '%s' where name = '%s'" % (dt_module[d], d))
|
||||
delete_unwanted_mappers()
|
||||
delete_unwanted_doctypes()
|
||||
sql("start transaction")
|
||||
delete_unwanted_pages()
|
||||
|
||||
delete_unwanted_search_criteria()
|
||||
|
||||
|
||||
rename_merge_modules()
|
||||
sync_roles()
|
||||
sync_mapper()
|
||||
delete_unwanted_modules()
|
||||
# landed cost wizard link in stock
|
||||
reload_doc('stock', 'Module Def', 'Stock')
|
||||
|
||||
sql("commit")
|
@ -1,311 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
"""
|
||||
This patch removes wrong indexs and add proper indexes in tables
|
||||
"""
|
||||
|
||||
import webnotes
|
||||
sql = webnotes.conn.sql
|
||||
from webnotes.utils import cstr
|
||||
|
||||
def create_proper_index():
|
||||
from webnotes.modules.export_file import export_to_files
|
||||
|
||||
dt_index_fields={
|
||||
'Purchase Receipt Item': ['prevdoc_docname', 'item_code', 'warehouse', 'prevdoc_detail_docname'],
|
||||
'Period Closing Voucher': ['closing_account_head', 'fiscal_year'],
|
||||
'Lead': ['lead_name', 'status', 'transaction_date'],
|
||||
'Time Sheet Detail': ['app_name'],
|
||||
'Item Quality Inspection Parameter': [],
|
||||
'Budget Detail': ['fiscal_year', 'account'],
|
||||
'Grade': [],
|
||||
'Sales Taxes and Charges': ['parenttype', 'account_head'],
|
||||
'TDS Category Account': ['account_head'],
|
||||
'Role': [],
|
||||
'Leave Allocation': ['leave_type', 'employee', 'fiscal_year'],
|
||||
'Branch': [],
|
||||
'Department': [],
|
||||
'Contact Detail': [],
|
||||
'Territory': ['lft', 'rgt', 'parent_territory'],
|
||||
'Item Tax': ['tax_type'],
|
||||
'Bin': ['warehouse', 'item_code'],
|
||||
'PPW Detail': ['warehouse'],
|
||||
'Sales Partner': ['partner_name'],
|
||||
'Default Home Page': ['home_page', 'role'],
|
||||
'Custom Field': ['dt'],
|
||||
'DocFormat': ['format'],
|
||||
'DocType Mapper': ['from_doctype', 'to_doctype'],
|
||||
'Brand': [],
|
||||
'Quotation Lost Reason': [],
|
||||
'Journal Voucher': ['posting_date', 'voucher_type'],
|
||||
'TDS Return Acknowledgement': ['date_of_receipt', 'acknowledgement'],
|
||||
'BOM Report Detail': ['item_code'],
|
||||
'Quotation Item': ['item_code'],
|
||||
'Update Delivery Date Detail': ['sales_order_no'],
|
||||
'Sales Invoice Advance': ['journal_voucher'],
|
||||
'Authorization Rule': ['approving_user', 'system_user', 'system_role', 'approving_role'],
|
||||
'DocPerm': ['permlevel', 'role'],
|
||||
'Stock Entry Detail': ['item_code', 't_warehouse', 's_warehouse'],
|
||||
'Stock Entry': ['posting_date', 'delivery_note_no', 'purchase_receipt_no', 'production_order'],
|
||||
'Price List': [],
|
||||
'Appraisal Template Goal': [],
|
||||
'Production Order': ['status', 'project_name', 'production_item'],
|
||||
'Account': ['lft', 'rgt', 'parent_account'],
|
||||
'Earn Deduction Detail': [],
|
||||
'Purchase Request': ['status', 'transaction_date'],
|
||||
'Tag Detail': [],
|
||||
'Salary Slip Deduction': ['d_type'],
|
||||
'Batch': ['item'],
|
||||
'Deduction Type': [],
|
||||
'Project': ['project_name', 'customer'],
|
||||
'UserRole': ['role'],
|
||||
'DocField': ['label', 'fieldtype', 'fieldname'],
|
||||
'Property Setter': ['doc_type', 'doc_name', 'property'],
|
||||
'Appraisal': ['status', 'employee'],
|
||||
'Letter Head': [],
|
||||
'Communication Log': ['follow_up_by'],
|
||||
'Project Cost Breakup': [],
|
||||
'Table Mapper Detail': [],
|
||||
'Campaign': [],
|
||||
'SMS Parameter': [],
|
||||
'Leave Type': [],
|
||||
'Absent Days Detail': [],
|
||||
'Tag': [],
|
||||
'Raw Materials Supplied': ['raw_material'],
|
||||
'Project Activity Update': [],
|
||||
'Purchase Receipt Item Supplied': [],
|
||||
'Bank Reconciliation Detail': ['voucher_id'],
|
||||
'Sales Order': ['quotation_no', 'project_name', 'customer', 'posting_date'],
|
||||
'Chapter VI A Detail': [],
|
||||
'Employee Internal Work History': [],
|
||||
'Order Reconciliation Detail': ['sales_order_no'],
|
||||
'Attendance': ['employee', 'att_date'],
|
||||
'Employee External Work History': [],
|
||||
'Salary Structure Earning': ['e_type'],
|
||||
'Sales Order Item': ['item_code', 'prevdoc_docname', 'reserved_warehouse'],
|
||||
'Appraisal Template': [],
|
||||
'Budget Distribution': ['fiscal_year'],
|
||||
'Workstation': ['warehouse'],
|
||||
'Training Session Details': [],
|
||||
'Sales Taxes and Charges Master': [],
|
||||
'State': [],
|
||||
'Bulk Rename Tool': [],
|
||||
'Landed Cost Master Detail': [],
|
||||
'Employee': ['employee_name', 'designation', 'department'],
|
||||
'Terms And Conditions': [],
|
||||
'TC Detail': [],
|
||||
'UOM': [],
|
||||
'Supplier Type': [],
|
||||
'Project Milestone': [],
|
||||
'Landed Cost Master': [],
|
||||
'Budget Distribution Detail': [],
|
||||
'Form 16A Ack Detail': [],
|
||||
'Campaign Expense': [],
|
||||
'Time Sheet': ['employee_name', 'time_sheet_date'],
|
||||
'File Group': ['parent_group'],
|
||||
'Maintenance Visit Purpose': ['item_code', 'service_person'],
|
||||
'Support Ticket Response': [],
|
||||
'Purchase Invoice Item': ['item_code', 'purchase_order', 'po_detail', 'purchase_receipt', 'pr_detail', 'expense_head', 'cost_center'],
|
||||
'Timesheet Detail': ['project_name', 'task_id', 'customer_name'],
|
||||
'Holiday': [],
|
||||
'Workflow Rule Detail': [],
|
||||
'Module Def': ['module_seq', 'module_page'],
|
||||
'Terms and Conditions': [],
|
||||
'PF Detail': ['item_code'],
|
||||
'POS Setting': ['user', 'territory'],
|
||||
'Quality Inspection Reading': [],
|
||||
'Support Ticket': ['customer', 'allocated_to', 'status'],
|
||||
'Project Activity': ['project'],
|
||||
'Customer Group': ['lft', 'rgt', 'parent_customer_group'],
|
||||
'Sales and Purchase Return Item': ['item_code'],
|
||||
'Series Detail': [],
|
||||
'Event Role': ['role'],
|
||||
'Contact': ['employee_id'],
|
||||
'BOM Item': ['item_code', 'bom_no'],
|
||||
'Invest 80 Declaration Detail': [],
|
||||
'Purchase Order Item Supplied': [],
|
||||
'Industry Type': [],
|
||||
'Declaration Detail': [],
|
||||
'Holiday List': ['fiscal_year'],
|
||||
'Sales Person': ['lft', 'rgt', 'parent_sales_person'],
|
||||
'Sales Invoice Item': ['item_code', 'sales_order', 'so_detail', 'delivery_note', 'dn_detail', 'cost_center', 'income_account'],
|
||||
'Module Def Item': [],
|
||||
'TDS Category': [],
|
||||
'DocTrigger': [],
|
||||
'Print Format': ['standard'],
|
||||
'Installation Note Item': ['prevdoc_docname', 'item_code'],
|
||||
'Form 16A Tax Detail': [],
|
||||
'Event': ['event_date', 'event_type'],
|
||||
'Currency': [],
|
||||
'Warehouse Type': ['warehouse_type'],
|
||||
'Sales BOM': ['item_group'],
|
||||
'IT Checklist': ['employee'],
|
||||
'Purchase Taxes and Charges Master': [],
|
||||
'Company': [],
|
||||
'Call Log': [],
|
||||
'Employee Training': [],
|
||||
'Warehouse': ['warehouse_type'],
|
||||
'Competitor': [],
|
||||
'Mode of Payment': [],
|
||||
'Training Session': ['customer'],
|
||||
'Cost Center': ['lft', 'rgt', 'parent_cost_center'],
|
||||
'Timesheet': ['status', 'timesheet_date'],
|
||||
'Form 16A': ['party_no'],
|
||||
'Sales BOM Item': ['item_code'],
|
||||
'Answer': ['question'],
|
||||
'Supplier': [],
|
||||
'Installation Note': ['delivery_note_no', 'customer', 'inst_date'],
|
||||
'Expense Claim': ['approval_status', 'employee'],
|
||||
'Target Detail': ['from_date', 'to_date', 'fiscal_year'],
|
||||
'Page Role': ['role'],
|
||||
'Partner Target Detail': ['fiscal_year', 'item_group'],
|
||||
'Shipping Address': ['customer'],
|
||||
'Purchase Request Item': ['item_code', 'warehouse'],
|
||||
'TDS Payment Detail': [],
|
||||
'Market Segment': [],
|
||||
'Comment': [],
|
||||
'Service Order Detail': ['item_code', 'prevdoc_docname'],
|
||||
'TDS Payment': ['from_date', 'to_date', 'tds_category'],
|
||||
'Lead Email CC Detail': [],
|
||||
'User Setting-Role User': [],
|
||||
'Salary Slip': ['month', 'year', 'employee'],
|
||||
'Maintenance Schedule Detail': ['item_code', 'scheduled_date'],
|
||||
'Employment Type': [],
|
||||
'Purchase Invoice Advance': ['journal_voucher'],
|
||||
'Quotation': ['customer', 'transaction_date'],
|
||||
'Salary Structure Deduction': ['d_type'],
|
||||
'BOM': ['item', 'project_name'],
|
||||
'Earning Type': [],
|
||||
'Designation': [],
|
||||
'BOM Replace Utility Detail': ['parent_bom'],
|
||||
'Question': [],
|
||||
'Stock Ledger Entry': ['item_code', 'warehouse', 'posting_date', 'posting_time'],
|
||||
'Employee Education': [],
|
||||
'BOM Operation': [],
|
||||
'Item Group': ['lft', 'rgt', 'parent_item_group'],
|
||||
'Workflow Action Detail': [],
|
||||
'User Setting-Profile': [],
|
||||
'Customer Issue': ['item_code', 'customer', 'complaint_date'],
|
||||
'Feed': [],
|
||||
'Purchase Taxes and Charges': ['account_head'],
|
||||
'GL Mapper Detail': [],
|
||||
'TDS Detail': [],
|
||||
'PRO Detail': ['item_code', 'source_warehouse'],
|
||||
'DocType Label': [],
|
||||
'Sales Invoice': ['posting_date', 'debit_to', 'project_name'],
|
||||
'GL Entry': ['posting_date', 'account', 'voucher_no'],
|
||||
'Serial No': ['status', 'warehouse'],
|
||||
'Delivery Note': ['posting_date', 'project_name', 'customer'],
|
||||
'UOM Conversion Detail': ['uom'],
|
||||
'Search Criteria': ['criteria_name'],
|
||||
'Salary Structure': [],
|
||||
'Educational Qualifications': ['qualification'],
|
||||
'TDS Rate Chart': ['applicable_from', 'applicable_to'],
|
||||
'GL Mapper': [],
|
||||
'Announcement': [],
|
||||
'Call Log Details': [],
|
||||
'Opportunity': ['lead', 'customer', 'transaction_date'],
|
||||
'BOM Explosion Item': ['item_code'],
|
||||
'Landed Cost Item': ['account_head'],
|
||||
'Field Mapper Detail': ['from_field', 'to_field'],
|
||||
'File Data': [],
|
||||
'Question Tag': [],
|
||||
'Quality Inspection': ['item_code', 'purchase_receipt_no', 'report_date'],
|
||||
'Appraisal Goal': [],
|
||||
'POS Settings': ['territory'],
|
||||
'Delivery Note Item': ['item_code', 'prevdoc_docname', 'warehouse', 'prevdoc_detail_docname'],
|
||||
'Profile': [],
|
||||
'Other Income Detail': [],
|
||||
'Product': ['item_code', 'stock_warehouse'],
|
||||
'Purchase Order Item': ['prevdoc_docname', 'item_code', 'prevdoc_detail_docname', 'warehouse'],
|
||||
'Module Def Role': ['role'],
|
||||
'Sales Team': ['sales_person'],
|
||||
'Opportunity Item': ['item_code'],
|
||||
'DocType': [],
|
||||
'Compaint Note': ['nature_of_complaint', 'compliance_date'],
|
||||
'Maintenance Schedule': ['customer', 'sales_order_no'],
|
||||
'Event User': ['person'],
|
||||
'Stock Reconciliation': ['reconciliation_date'],
|
||||
'Purchase Receipt': ['posting_date', 'supplier', 'project_name'],
|
||||
'Complaint Detail': ['item_name'],
|
||||
'Address': ['customer', 'supplier'],
|
||||
'Task': ['request_date', 'allocated_to', 'category', 'customer', 'project'],
|
||||
'Territory Target Detail': ['month', 'fiscal_year'],
|
||||
'Landed Cost Purchase Receipt': ['purchase_receipt_no'],
|
||||
'Customer': ['customer_name', 'customer_group'],
|
||||
'Production Plan Sales Order': [],
|
||||
'Production Plan Item': ['document_date', 'item_code', 'parent_item'],
|
||||
'User Setting-Role Permission': [],
|
||||
'Custom Script': ['dt'],
|
||||
'Country': [],
|
||||
'DefaultValue': [],
|
||||
'Multi Ledger Report Detail': [],
|
||||
'Salary Slip Earning': ['e_type'],
|
||||
'SMS Log': [],
|
||||
'Expense Claim Type': [],
|
||||
'Item': ['item_group'],
|
||||
'Fiscal Year': [],
|
||||
'ToDo': ['role'],
|
||||
'Purchase Invoice': ['posting_date', 'credit_to', 'project_name', 'supplier'],
|
||||
'Journal Voucher Detail': ['account', 'against_voucher', 'against_invoice', 'against_jv'],
|
||||
'Online Contact': [],
|
||||
'Page': ['module'],
|
||||
'Leave Application': ['employee', 'leave_type', 'from_date', 'to_date'],
|
||||
'Expense Claim Detail': ['expense_type'],
|
||||
'Maintenance Visit': ['customer', 'sales_order_no', 'customer_issue_no'],
|
||||
'Item Price': ['price_list_name', 'ref_currency'],
|
||||
'SMS Receiver': [],
|
||||
'Naming Series Options': ['doc_type'],
|
||||
'Activity Type': [],
|
||||
'Delivery Note Packing Item': ['item_code', 'parent_item', 'warehouse'],
|
||||
'Workflow Rule': ['select_form'],
|
||||
'File': ['file_group'],
|
||||
'Maintenance Schedule Item': ['item_code', 'start_date', 'end_date', 'prevdoc_docname'],
|
||||
'Purchase Order': ['supplier', 'project_name', 'posting_date'],
|
||||
'Print Heading': [],
|
||||
'TDS Rate Detail': ['category']
|
||||
}
|
||||
#sql("commit") # only required if run from login
|
||||
exist_dt = [cstr(d[0]) for d in sql("select name from `tabDocType`")]
|
||||
|
||||
for dt in [d for d in dt_index_fields.keys() if d in exist_dt]:
|
||||
try:
|
||||
current_index = sql("show indexes from `tab%s`" % dt)
|
||||
|
||||
proper_index = dt_index_fields[dt]
|
||||
|
||||
for d in current_index:
|
||||
if d[4] not in ['name', 'parent', 'parenttype']:
|
||||
if d[4] not in proper_index:
|
||||
sql("ALTER TABLE `tab%s` DROP INDEX %s" % (dt, d[4]))
|
||||
sql("start transaction")
|
||||
sql("UPDATE `tabDocField` SET search_index = 0 WHERE fieldname = '%s' AND parent = '%s'" % (d[4], dt))
|
||||
sql("commit")
|
||||
else:
|
||||
proper_index.remove(d[4])
|
||||
|
||||
for d in proper_index:
|
||||
sql("ALTER TABLE `tab%s` ADD INDEX ( `%s` ) " % (dt, d))
|
||||
sql("start transaction")
|
||||
sql("UPDATE `tabDocField` SET search_index = 1 WHERE fieldname = '%s' AND parent = '%s'" % (d, dt))
|
||||
sql("commit")
|
||||
except:
|
||||
continue
|
||||
|
||||
def execute():
|
||||
create_proper_index()
|
@ -1,125 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import os, sys
|
||||
import webnotes
|
||||
|
||||
path_to_file = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ['print_formats'])
|
||||
|
||||
def prepare_pf_dict(args_list):
|
||||
"""
|
||||
|
||||
"""
|
||||
pf_list = []
|
||||
for a in args_list:
|
||||
for pf_type in ['Classic', 'Modern', 'Spartan']:
|
||||
pf = {}
|
||||
pf['name'] = " ".join([a['name'], pf_type])
|
||||
pf['file'] = os.sep.join([path_to_file, "".join(pf['name'].split(" ")) + ".html"])
|
||||
pf['module'] = a['module']
|
||||
pf['doc_type'] = a['doc_type']
|
||||
pf['standard'] = 'Yes'
|
||||
pf_list += [pf]
|
||||
return pf_list
|
||||
|
||||
|
||||
pf_to_install = prepare_pf_dict([
|
||||
{
|
||||
'name' : 'Sales Invoice',
|
||||
'doc_type' : 'Sales Invoice',
|
||||
'module' : 'Accounts'
|
||||
},
|
||||
{
|
||||
'name' : 'Sales Order',
|
||||
'doc_type' : 'Sales Order',
|
||||
'module' : 'Selling'
|
||||
},
|
||||
{
|
||||
'name' : 'Quotation',
|
||||
'doc_type' : 'Quotation',
|
||||
'module' : 'Selling'
|
||||
},
|
||||
{
|
||||
'name' : 'Delivery Note',
|
||||
'doc_type' : 'Delivery Note',
|
||||
'module' : 'Stock'
|
||||
},
|
||||
{
|
||||
'name' : 'Purchase Order',
|
||||
'doc_type' : 'Purchase Order',
|
||||
'module' : 'Buying'
|
||||
}
|
||||
])
|
||||
|
||||
def execute():
|
||||
"""
|
||||
Install print formats
|
||||
"""
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('core', 'doctype', 'print_format')
|
||||
|
||||
#copy_doctype_to_pfs()
|
||||
global pf_to_install
|
||||
for pf in pf_to_install:
|
||||
# install_print_format(pf)
|
||||
# print "Installed PF: " + pf['name']
|
||||
reload_doc(pf['module'], 'Print Format', pf['name'])
|
||||
|
||||
|
||||
def copy_doctype_to_pfs():
|
||||
"""
|
||||
Copy doctype to existing print formats
|
||||
"""
|
||||
pf_dt_list = webnotes.conn.sql("""
|
||||
SELECT format, parent
|
||||
FROM `tabDocFormat`""", as_list=1)
|
||||
|
||||
from webnotes.model.doc import Document
|
||||
|
||||
for pf, dt in pf_dt_list:
|
||||
try:
|
||||
d = Document('Print Format', pf)
|
||||
d.doc_type = dt
|
||||
d.save()
|
||||
except Exception, e:
|
||||
print e.args
|
||||
pass
|
||||
|
||||
|
||||
def install_print_format(args):
|
||||
"""
|
||||
Installs print format
|
||||
args is a dict consisting of following keys:
|
||||
* name
|
||||
* module
|
||||
* doctype
|
||||
* standard = "Yes"/"No"
|
||||
* file
|
||||
"""
|
||||
from webnotes.model.doc import Document
|
||||
d = Document('Print Format')
|
||||
d.name = args['name']
|
||||
f = open(args['file'])
|
||||
d.html = f.read()
|
||||
f.close()
|
||||
d.module = args['module']
|
||||
d.doc_type = args['doc_type']
|
||||
d.standard = args['standard']
|
||||
d.save(1)
|
||||
from webnotes.model.code import get_obj
|
||||
obj = get_obj('Print Format', args['name'])
|
||||
obj.on_update()
|
@ -1,26 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
|
||||
reload_doc('stock', 'doctype', 'landed_cost_wizard')
|
||||
reload_doc('stock', 'doctype', 'lc_pr_detail')
|
||||
|
||||
webnotes.conn.sql("delete from `tabDocField` where parent ='Landed Cost Purchase Receipt' and fieldname in ('purchase_receipt_no', 'include_in_landed_cost')")
|
@ -1,21 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
if not webnotes.conn.sql("select name from tabDocFormat where parent = 'Sales Invoice' and format != 'POS Invoice'"):
|
||||
webnotes.conn.sql("update tabDocType set default_print_format = 'Standard' where name = 'Sales Invoice'")
|
@ -1,25 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('stock', 'doctype', 'delivery_note_detail')
|
||||
reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
|
||||
|
||||
webnotes.conn.sql("delete from `tabDocField` where fieldname in ('packed_by', 'packing_checked_by', 'pack_size') and parent = 'Delivery Note'")
|
||||
|
@ -1,30 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('accounts', 'doctype', 'receivable_voucher')
|
||||
reload_doc('stock', 'doctype', 'delivery_note')
|
||||
reload_doc('selling', 'doctype', 'sales_order')
|
||||
reload_doc('selling', 'doctype', 'quotation')
|
||||
reload_doc('setup', 'doctype', 'manage_account')
|
||||
|
||||
|
||||
for d in ['Sales Invoice', 'Delivery Note', 'Sales Order', 'Quotation']:
|
||||
webnotes.conn.sql("update `tab%s` set price_list_currency = currency, plc_conversion_rate = conversion_rate" % d)
|
@ -1,20 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("update `tabDocField` set print_hide = 1 where fieldname in ('price_list_currency', 'plc_conversion_rate')")
|
@ -1,27 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
def execute():
|
||||
"""
|
||||
Mark DocType Profile as 'not_in_create'
|
||||
"""
|
||||
webnotes.conn.sql("""
|
||||
UPDATE `tabDocType`
|
||||
SET in_create=1
|
||||
WHERE name='Profile'
|
||||
""")
|
@ -1,35 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
# Reload item table
|
||||
reload_doc('accounts', 'doctype', 'pv_detail')
|
||||
reload_doc('buying', 'doctype', 'po_detail')
|
||||
reload_doc('stock', 'doctype', 'purchase_receipt_detail')
|
||||
|
||||
# copy project value from parent to child
|
||||
sql("update `tabPurchase Order Item` t1, `tabPurchase Order` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
|
||||
sql("update `tabPurchase Invoice Item` t1, `tabPurchase Invoice` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
|
||||
sql("update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.project_name = t2.project_name where t1.parent = t2.name and ifnull(t1.project_name, '') = ''")
|
||||
|
||||
# delete project from parent
|
||||
sql("delete from `tabDocField` where fieldname = 'project_name' and parent in ('Purchase Order', 'Purchase Receipt', 'Purchase Invoice')")
|
||||
|
@ -1,22 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('utilities', 'doctype', 'address')
|
@ -1,22 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('production', 'doctype', 'bill_of_materials')
|
@ -1,33 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
"""
|
||||
Reload Customize Form, Customize Form Field and Print Format doctypes
|
||||
"""
|
||||
def execute():
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('core', 'doctype', 'print_format')
|
||||
reload_doc('core', 'doctype', 'doclayer')
|
||||
reload_doc('core', 'doctype', 'doclayerfield')
|
||||
reload_doc('accounts', 'doctype', 'gl_entry')
|
||||
from webnotes.model.doc import Document
|
||||
d = Document('DocType Label')
|
||||
d.dt = "Customize Form"
|
||||
d.dt_label = "Customize Form View"
|
||||
d.save(1)
|
||||
from webnotes.sessions import clear
|
||||
clear()
|
@ -1,20 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('Setup', 'DocType', 'Email Digest')
|
@ -1,21 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report')
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
from webnotes.modules import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('production', 'doctype', 'flat_bom_detail')
|
||||
reload_doc('production', 'doctype', 'bom_material')
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
# reload jv gl mapper
|
||||
reload_doc('accounts', 'GL Mapper', 'Journal Voucher')
|
@ -1,26 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
from webnotes.model import delete_doc
|
||||
|
||||
delete_doc('DocType', 'Landed Cost Wizard')
|
||||
delete_doc('DocType', 'Landed Cost Purchase Receipt')
|
||||
reload_doc('stock', 'doctype', 'landed_cost_wizard')
|
||||
reload_doc('stock', 'doctype', 'lc_pr_detail')
|
@ -1,34 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
from webnotes.model.doc import addchild
|
||||
from webnotes.model.code import get_obj
|
||||
reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
|
||||
reload_doc('stock', 'Print Format', 'Purchase Receipt Format')
|
||||
reload_doc('accounts', 'Print Format', 'Payment Receipt Voucher')
|
||||
reload_doc('accounts', 'Print Format', 'POS Invoice')
|
||||
reload_doc('accounts', 'Print Format', 'Form 16A Print Format')
|
||||
reload_doc('accounts', 'Print Format', 'Cheque Printing Format')
|
||||
|
||||
if not webnotes.conn.sql("select format from `tabDocFormat` where name = 'POS Invoice' and parent = 'Sales Invoice'"):
|
||||
dt_obj = get_obj('DocType', 'Sales Invoice', with_children = 1)
|
||||
ch = addchild(dt_obj.doc, 'formats', 'DocFormat', 1)
|
||||
ch.format = 'POS Invoice'
|
||||
ch.save(1)
|
@ -1,24 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
"""
|
||||
Reload Task Doctype of Project Module
|
||||
"""
|
||||
def execute():
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('Projects', 'DocType', 'Task')
|
||||
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
|
||||
reload_doc('stock', 'doctype', 'stock_reconciliation')
|
||||
webnotes.conn.sql("delete from `tabDocField` where (label in ('Validate Data', 'Attachment HTML', 'Attachment') or fieldname in ('next_step', 'company', 'fiscal_year', 'amendment_date')) and parent = 'Stock Reconciliation'")
|
@ -1,26 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
from webnotes.model.code import get_obj
|
||||
|
||||
reload_doc('accounts', 'doctype', 'receivable_voucher')
|
||||
|
||||
reload_doc('setup', 'doctype', 'features_setup')
|
||||
get_obj('Features setup').validate()
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('Support', 'DocType', 'Support Ticket')
|
||||
from webnotes.model.code import get_obj
|
||||
get_obj('DocType', 'Support Ticket').validate()
|
@ -1,39 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
"""
|
||||
Removes duplicate entries created in
|
||||
"""
|
||||
import webnotes
|
||||
def execute():
|
||||
res = webnotes.conn.sql("""\
|
||||
SELECT a.name
|
||||
FROM
|
||||
`tabTable Mapper Detail` a,
|
||||
`tabTable Mapper Detail` b
|
||||
WHERE
|
||||
a.parent = b.parent AND
|
||||
a.from_table = b.from_table AND
|
||||
a.to_table = b.to_table AND
|
||||
a.from_field = b.from_field AND
|
||||
a.to_field = b.to_field AND
|
||||
a.name < b.name""")
|
||||
if res and len(res)>0:
|
||||
name_string = ", ".join(["'" + str(r[0]) + "'" for r in res])
|
||||
res = webnotes.conn.sql("""\
|
||||
DELETE FROM `tabTable Mapper Detail`
|
||||
WHERE name IN (%s)""" % name_string)
|
@ -1,25 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""
|
||||
DELETE FROM tabDocField
|
||||
WHERE parent = 'Email Digest'
|
||||
AND label = 'Add Recipients'
|
||||
AND fieldtype = 'Button'""")
|
||||
|
@ -1,32 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
"""
|
||||
remove control panel email settings if automail.webnotestech.com
|
||||
"""
|
||||
from webnotes.model.doc import Document
|
||||
cp = Document('Control Panel', 'Control Panel')
|
||||
if cp:
|
||||
if cp.outgoing_mail_server == 'mail.webnotestech.com':
|
||||
cp.outgoing_mail_server = None;
|
||||
cp.mail_login = None;
|
||||
cp.mail_password = None;
|
||||
cp.mail_port = None;
|
||||
cp.auto_email_id = 'automail@erpnext.com'
|
||||
cp.save()
|
||||
|
@ -1,20 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""delete from `tabDefaultValue` where defkey in ('page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos', 'purchase_discounts', 'recurring_invoice') and parent = 'Control Panel'""")
|
@ -1,23 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
def execute():
|
||||
webnotes.conn.sql("""\
|
||||
DELETE FROM `tabProperty Setter`
|
||||
WHERE property='previous_field'
|
||||
""")
|
@ -1,36 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
sql = webnotes.conn.sql
|
||||
from webnotes.model.code import get_obj
|
||||
|
||||
# repost
|
||||
comp = sql("select name from tabCompany where docstatus!=2")
|
||||
fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
|
||||
for c in comp:
|
||||
prev_fy = ''
|
||||
for f in fy:
|
||||
fy_obj = get_obj('Fiscal Year', f[0])
|
||||
fy_obj.doc.past_year = prev_fy
|
||||
fy_obj.doc.company = c[0]
|
||||
fy_obj.repost()
|
||||
prev_fy = f[0]
|
||||
webnotes.conn.commit()
|
||||
webnotes.conn.begin()
|
@ -1,40 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
sql = webnotes.conn.sql
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes.utils import flt
|
||||
|
||||
# update incoming rate in serial nos
|
||||
sr = sql("""select name, item_code, purchase_document_no from `tabSerial No`
|
||||
where docstatus = 1 and purchase_document_type = 'Purchase Receipt'""")
|
||||
for d in sr:
|
||||
val_rate = sql("""select valuation_rate from `tabPurchase Receipt Item`
|
||||
where item_code = %s and parent = %s""", (d[1], d[2]))
|
||||
sql("""update `tabSerial No` set purchase_rate = %s where name = %s""",
|
||||
(val_rate and flt(val_rate[0][0]) or 0, d[0]))
|
||||
|
||||
|
||||
# repost for all serialized item
|
||||
bin = sql("""select t1.name from `tabBin` t1, tabItem t2 where t1.item_code = t2.name and ifnull(has_serial_no, 'No') = 'Yes'""")
|
||||
for d in bin:
|
||||
get_obj('Bin', d[0]).update_entries_after(posting_date = '2000-01-01', posting_time = '12:00')
|
||||
sql("commit")
|
||||
sql("start transaction")
|
||||
|
@ -1,25 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
reload_doc('hr', 'doctype', 'salary_manager')
|
||||
sql("delete from `tabDocField` where parent = 'Salary Manager' and fieldname = 'employment_type'")
|
@ -1,21 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.modules import reload_doc
|
||||
reload_doc('projects', 'doctype', 'ticket')
|
@ -1,26 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
def execute():
|
||||
doc_type_list = webnotes.conn.sql("""SELECT DISTINCT parent FROM `tabDocField` where idx=0""")
|
||||
for doc_type in doc_type_list:
|
||||
if doc_type and doc_type[0]:
|
||||
webnotes.conn.sql("""\
|
||||
UPDATE `tabDocField` SET idx=idx+1
|
||||
WHERE parent=%s
|
||||
""", doc_type[0])
|
@ -1,32 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
from webnotes.model.code import get_obj
|
||||
|
||||
# select jv where against_jv exists
|
||||
jv = webnotes.conn.sql("select distinct parent from `tabJournal Voucher Detail` where docstatus = 1 and ifnull(against_jv, '') != ''")
|
||||
|
||||
for d in jv:
|
||||
jv_obj = get_obj('Journal Voucher', d[0], with_children=1)
|
||||
|
||||
# cancel
|
||||
get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =1, adv_adj = 1)
|
||||
|
||||
#re-submit
|
||||
get_obj(dt='GL Control').make_gl_entries(jv_obj.doc, jv_obj.doclist, cancel =0, adv_adj = 1)
|
@ -1,5 +1,6 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
import webnotes
|
||||
delete_doctypes()
|
||||
rename_module()
|
||||
|
||||
@ -9,12 +10,14 @@ def delete_doctypes():
|
||||
delete_doc("DocType", "BOM Control")
|
||||
|
||||
def rename_module():
|
||||
webnotes.rename_doc("Module Def", "Production", "Manufacturing")
|
||||
|
||||
webnotes.rename_doc("Role", "Production User", "Manufacturing User")
|
||||
webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager")
|
||||
|
||||
webnotes.rename_doc("Page", "production-home", "manufacturing-home")
|
||||
|
||||
webnotes.rename_doc("Module Def", "Production", "Manufacturing")
|
||||
|
||||
webnotes.conn.set_global("modules_list",
|
||||
webnotes.conn.get_global('modules_list').replace("Production", "Manufacturing"))
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
# ERPNext - web based ERP (http://erpnext.com)
|
||||
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""update `tabAccount`
|
||||
set account_type = 'Chargeable'
|
||||
where account_name in ('CENVAT Capital Goods', 'CENVAT Service Tax', 'CENVAT Service Tax Cess 1', 'CENVAT Service Tax Cess 2',
|
||||
'P L A', 'P L A - Cess Portion', 'VAT', 'TDS (Advertisement)', 'TDS (Commission)', 'TDS (Contractor)', 'TDS (Interest)',
|
||||
'TDS (Rent)', 'TDS (Salary)')
|
||||
""")
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user