Merge pull request #4726 from nabinhait/develop

Multiple fixes
This commit is contained in:
Nabin Hait 2016-02-02 16:08:40 +05:30
commit 7957f0ecea
7 changed files with 111 additions and 58 deletions

View File

@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@ -972,13 +973,13 @@
"collapsible": 0,
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"hidden": 1,
"ignore_user_permissions": 1,
"in_filter": 0,
"in_list_view": 0,
"label": "Target Warehouse",
"label": "Customer Warehouse (Optional)",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
@ -1444,7 +1445,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-01-06 02:23:06.432442",
"modified": "2016-02-01 11:16:58.288462",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@ -874,13 +875,13 @@
"depends_on": "eval:doc.delivered_by_supplier!=1",
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
"hidden": 1,
"ignore_user_permissions": 1,
"in_filter": 0,
"in_list_view": 0,
"label": "Target Warehouse",
"label": "Customer Warehouse (Optional)",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
@ -1289,7 +1290,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-12-11 14:53:24.444343",
"modified": "2016-02-01 11:16:40.514399",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",

View File

@ -27,15 +27,21 @@ class Company(Document):
return exists
def validate(self):
self.validate_abbr()
self.validate_default_accounts()
self.validate_currency()
def validate_abbr(self):
self.abbr = self.abbr.strip()
if self.get('__islocal') and len(self.abbr) > 5:
frappe.throw(_("Abbreviation cannot have more than 5 characters"))
if not self.abbr.strip():
frappe.throw(_("Abbreviation is mandatory"))
self.validate_default_accounts()
self.validate_currency()
if frappe.db.sql("select abbr from tabCompany where name!=%s and abbr=%s", (self.name, self.abbr)):
frappe.throw(_("Abbreviation already used for another company"))
def validate_default_accounts(self):
for field in ["default_bank_account", "default_cash_account", "default_receivable_account", "default_payable_account",
@ -167,7 +173,7 @@ class Company(Document):
frappe.defaults.clear_cache()
def abbreviate(self):
self.abbr = ''.join([c[0].upper() for c in self.name.split()])
self.abbr = ''.join([c[0].upper() for c in self.company_name.split()])
def on_trash(self):
"""

View File

@ -2696,18 +2696,58 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2015-12-25 16:20:39.014291",
"modified": "2016-01-31 14:06:52.136821",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "All",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
},
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Office Coordinator",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
},
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
@ -2722,6 +2762,27 @@
"submit": 1,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Store Keeper",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"user_permission_doctypes": "[\"Warehouse\"]",
"write": 1
},
{
"amend": 1,
"apply_user_permissions": 0,
@ -2744,10 +2805,10 @@
},
{
"amend": 1,
"apply_user_permissions": 0,
"apply_user_permissions": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
@ -2760,6 +2821,7 @@
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"user_permission_doctypes": "[\"Warehouse\"]",
"write": 1
},
{
@ -2801,26 +2863,6 @@
"share": 0,
"submit": 0,
"write": 0
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 1,
"print": 0,
"read": 1,
"report": 0,
"role": "Stock Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 1
}
],
"read_only": 0,

View File

@ -124,8 +124,8 @@ class DeliveryNote(SellingController):
})
if cint(frappe.db.get_single_value('Selling Settings', 'maintain_same_sales_rate')) and not self.is_return:
self.validate_rate_with_reference_doc([["Sales Order", "sales_order", "so_detail"],
["Sales Invoice", "sales_invoice", "si_detail"]])
self.validate_rate_with_reference_doc([["Sales Order", "against_sales_order", "so_detail"],
["Sales Invoice", "against_sales_invoice", "si_detail"]])
def validate_proj_cust(self):
"""check for does customer belong to same project as entered.."""

View File

@ -7,6 +7,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
@ -823,13 +824,13 @@
"description": "",
"fieldname": "target_warehouse",
"fieldtype": "Link",
"hidden": 0,
"hidden": 1,
"ignore_user_permissions": 1,
"in_filter": 0,
"in_list_view": 0,
"label": "To Warehouse (Optional)",
"label": "Customer Warehouse (Optional)",
"length": 0,
"no_copy": 0,
"no_copy": 1,
"options": "Warehouse",
"permlevel": 0,
"precision": "",
@ -1286,7 +1287,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-01-07 05:59:56.448357",
"modified": "2016-02-01 11:16:23.749244",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",

View File

@ -1,17 +1,19 @@
{
"apply_user_permissions": 1,
"creation": "2013-09-25 10:21:15",
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"price_list_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
"modified": "2014-06-09 10:21:15.097955",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item-wise Price List Rate",
"owner": "Administrator",
"ref_doctype": "Price List",
"report_name": "Item-wise Price List Rate",
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2013-09-25 10:21:15",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
"json": "{\"filters\":[],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"price_list_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":null,\"sort_order_next\":\"desc\"}",
"modified": "2016-02-01 14:31:04.075909",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item-wise Price List Rate",
"owner": "Administrator",
"ref_doctype": "Item Price",
"report_name": "Item-wise Price List Rate",
"report_type": "Report Builder"
}
}