synced timestamps

This commit is contained in:
Rushabh Mehta
2011-09-05 13:17:22 +05:30
105 changed files with 4302 additions and 8178 deletions

View File

View File

@@ -0,0 +1,13 @@
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def validate(self):
"""
update settings in defaults
"""
from webnotes.model import default_fields
from webnotes.utils import set_default
for key in self.doc.fields:
if key not in default_fields:
set_default(key, self.doc.fields[key])

View File

@@ -0,0 +1,288 @@
# DocType, Features Setup
[
# These values are common in all dictionaries
{
'creation': '2011-08-25 16:53:56',
'docstatus': 0,
'modified': '2011-08-31 15:05:53',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1314783102',
'colour': 'White:FFF',
'doctype': 'DocType',
'issingle': 1,
'module': 'Setup',
'name': '__common__',
'name_case': 'Title Case',
'section_style': 'Simple',
'show_in_menu': 1,
'version': 16
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Features Setup',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Features Setup',
'parentfield': 'permissions',
'parenttype': 'DocType',
'permlevel': 0,
'read': 1,
'write': 1
},
# DocType, Features Setup
{
'doctype': 'DocType',
'name': 'Features Setup'
},
# DocPerm
{
'doctype': 'DocPerm',
'role': 'System Manager'
},
# DocPerm
{
'doctype': 'DocPerm',
'role': 'Administrator'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Materials'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.',
'doctype': 'DocField',
'fieldname': 'item_searial_nos',
'fieldtype': 'Check',
'label': 'Item Serial Nos'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>',
'doctype': 'DocField',
'fieldname': 'item_batch_nos',
'fieldtype': 'Check',
'label': 'Item Batch Nos'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To track brand name in the following documents<br>\nDelivery Note, Enuiry, Indent, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Receivable Voucher, Sales BOM, Sales Order, Serial No',
'doctype': 'DocField',
'fieldname': 'brands',
'fieldtype': 'Check',
'label': 'Brands'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break'
},
# DocField
{
'colour': 'White:FFF',
'description': '1. To maintain the customer wise item code and to make them searchable based on their code use this option',
'doctype': 'DocField',
'fieldname': 'item_advanced',
'fieldtype': 'Check',
'label': 'Item Advanced'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order',
'doctype': 'DocField',
'fieldname': 'packing_details',
'fieldtype': 'Check',
'label': 'Packing Detials'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To get Item Group in details table',
'doctype': 'DocField',
'fieldname': 'item_group_in_details',
'fieldtype': 'Check',
'label': 'Item Groups in Details'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Sales and Purchase'
},
# DocField
{
'colour': 'White:FFF',
'description': 'All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.',
'doctype': 'DocField',
'fieldname': 'exports',
'fieldtype': 'Check',
'label': 'Exports'
},
# DocField
{
'colour': 'White:FFF',
'description': 'All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.',
'doctype': 'DocField',
'fieldname': 'imports',
'fieldtype': 'Check',
'label': 'Imports'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Field available in Delivery Note, Quotation, Receivable Voucher, Sales Order',
'doctype': 'DocField',
'fieldname': 'discounts',
'fieldtype': 'Check',
'label': 'Discounts'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To track any installation or commissioning related work after sales',
'doctype': 'DocField',
'fieldname': 'after_sales_installations',
'fieldtype': 'Check',
'label': 'After Sale Installations'
},
# DocField
{
'description': 'Available in \nBill Of Materials, Delivery Note, Payable Voucher, Production Order, Purchase Order, Purchase Receipt, Receivable Voucher, Sales Order, Stock Entry, Timesheet',
'doctype': 'DocField',
'fieldname': 'projects',
'fieldtype': 'Check',
'label': 'Projects'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity',
'doctype': 'DocField',
'fieldname': 'sales_extras',
'fieldtype': 'Check',
'label': 'Sales Extras'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Production'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>',
'doctype': 'DocField',
'fieldname': 'manufacturing',
'fieldtype': 'Check',
'label': 'Manufacturing'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt',
'doctype': 'DocField',
'fieldname': 'quality',
'fieldtype': 'Check',
'label': 'Quality'
},
# DocField
{
'colour': 'White:FFF',
'description': 'To enable <b>Point of Sale</b> features',
'doctype': 'DocField',
'fieldname': 'pos',
'fieldtype': 'Check',
'label': 'Point of Sale'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Miscelleneous'
},
# DocField
{
'colour': 'White:FFF',
'description': 'If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page',
'doctype': 'DocField',
'fieldname': 'page_break',
'fieldtype': 'Check',
'label': 'Page Break'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Enables <b>More Info.</b> in all documents',
'doctype': 'DocField',
'fieldname': 'more_info',
'fieldtype': 'Check',
'label': 'More Info'
}
]

View File

@@ -0,0 +1,41 @@
# Please edit this list and import only required elements
import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
from webnotes.model.doclist import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, is_testing, msgprint, errprint
set = webnotes.conn.set
sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# -----------------------------------------------------------------------------------------
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def update_series(self):
series = sql("select name,current from `tabSeries` where name = %s", self.doc.prefix,as_dict = 1)
if series:
msgprint("This is going to update Series with Prefix : " + series[0]['name'] + " from Current : " + cstr(series[0]['current']) + " to Current : "+ cstr(self.doc.current))
sql("update `tabSeries` set current = '%s' where name = '%s'" % (self.doc.current,series[0]['name']))
msgprint("Series Updated Successfully")
else:
msgprint("Please Check Prefix as there is no such Prefix : "+ self.doc.prefix +" Or Try Insert Button")
def insert_series(self):
#sql("start transaction")
series = sql("select name,current from `tabSeries` where name = %s", self.doc.prefix, as_dict = 1)
if series:
msgprint("Series with Prefix : " + series[0]['name'] + "already in the system . Try Update Button")
else:
msgprint("This is going to Insert Series with Prefix : " + cstr(self.doc.prefix) + " Current: " + cstr(self.doc.current))
sql("insert into `tabSeries` (name,current) values ('%s','%s')" % (self.doc.prefix, self.doc.current))
msgprint("Series Inserted Successfully")