From 51d07dfca2d6375d3554d36a5ff17a24f836608e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 7 Dec 2015 16:22:00 +0530 Subject: [PATCH 1/9] [docs] rename perm level error article --- .../print_format/drop_shipping/index.txt | 1 - ...ng.print_format.drop_shipping_format.html} | 4 ++-- .../index.html | 4 ++-- .../drop_shipping_format/index.txt | 1 + .../api/stock/erpnext.stock.utils.html | 4 +++- .../models/accounts/sales_invoice.html | 14 ++++++++++++++ erpnext/docs/current/models/home/index.html | 19 ------------------- erpnext/docs/current/models/home/index.txt | 0 .../current/models/hr/leave_application.html | 2 +- .../en/customize-erpnext/articles/index.txt | 4 ++-- ...perm-level-error-in-permission-manager.md} | 0 11 files changed, 25 insertions(+), 28 deletions(-) delete mode 100644 erpnext/docs/current/api/buying/print_format/drop_shipping/index.txt rename erpnext/docs/current/api/buying/print_format/{drop_shipping/erpnext.buying.print_format.drop_shipping.html => drop_shipping_format/erpnext.buying.print_format.drop_shipping_format.html} (78%) rename erpnext/docs/current/api/buying/print_format/{drop_shipping => drop_shipping_format}/index.html (81%) create mode 100644 erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.txt delete mode 100644 erpnext/docs/current/models/home/index.html delete mode 100644 erpnext/docs/current/models/home/index.txt rename erpnext/docs/user/manual/en/customize-erpnext/articles/{perm-level-error-in-permission-manager-1.md => perm-level-error-in-permission-manager.md} (100%) diff --git a/erpnext/docs/current/api/buying/print_format/drop_shipping/index.txt b/erpnext/docs/current/api/buying/print_format/drop_shipping/index.txt deleted file mode 100644 index 5c383bd71a..0000000000 --- a/erpnext/docs/current/api/buying/print_format/drop_shipping/index.txt +++ /dev/null @@ -1 +0,0 @@ -erpnext.buying.print_format.drop_shipping \ No newline at end of file diff --git a/erpnext/docs/current/api/buying/print_format/drop_shipping/erpnext.buying.print_format.drop_shipping.html b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/erpnext.buying.print_format.drop_shipping_format.html similarity index 78% rename from erpnext/docs/current/api/buying/print_format/drop_shipping/erpnext.buying.print_format.drop_shipping.html rename to erpnext/docs/current/api/buying/print_format/drop_shipping_format/erpnext.buying.print_format.drop_shipping_format.html index d84423e568..9c2648b78a 100644 --- a/erpnext/docs/current/api/buying/print_format/drop_shipping/erpnext.buying.print_format.drop_shipping.html +++ b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/erpnext.buying.print_format.drop_shipping_format.html @@ -1,10 +1,10 @@ -
+ diff --git a/erpnext/docs/current/api/buying/print_format/drop_shipping/index.html b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.html similarity index 81% rename from erpnext/docs/current/api/buying/print_format/drop_shipping/index.html rename to erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.html index 47647f0475..ef09e77f40 100644 --- a/erpnext/docs/current/api/buying/print_format/drop_shipping/index.html +++ b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.html @@ -1,4 +1,4 @@ - +
@@ -7,7 +7,7 @@ Version 6.x.x - Source
diff --git a/erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.txt b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.txt new file mode 100644 index 0000000000..590a2c9618 --- /dev/null +++ b/erpnext/docs/current/api/buying/print_format/drop_shipping_format/index.txt @@ -0,0 +1 @@ +erpnext.buying.print_format.drop_shipping_format \ No newline at end of file diff --git a/erpnext/docs/current/api/stock/erpnext.stock.utils.html b/erpnext/docs/current/api/stock/erpnext.stock.utils.html index 7f2d4e2557..1fb0155d7d 100644 --- a/erpnext/docs/current/api/stock/erpnext.stock.utils.html +++ b/erpnext/docs/current/api/stock/erpnext.stock.utils.html @@ -79,7 +79,9 @@ - +

Public API +
/api/method/erpnext.stock.utils.get_incoming_rate +

diff --git a/erpnext/docs/current/models/accounts/sales_invoice.html b/erpnext/docs/current/models/accounts/sales_invoice.html index 8f0f364ac2..76924c3ee2 100644 --- a/erpnext/docs/current/models/accounts/sales_invoice.html +++ b/erpnext/docs/current/models/accounts/sales_invoice.html @@ -2475,6 +2475,20 @@ Yearly +

+ + + validate_dropship_item + (self) +

+

No docs

+
+
+ + + + +

diff --git a/erpnext/docs/current/models/home/index.html b/erpnext/docs/current/models/home/index.html deleted file mode 100644 index e21468e274..0000000000 --- a/erpnext/docs/current/models/home/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -

- -

DocTypes for home

- -{index} - - \ No newline at end of file diff --git a/erpnext/docs/current/models/home/index.txt b/erpnext/docs/current/models/home/index.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/erpnext/docs/current/models/hr/leave_application.html b/erpnext/docs/current/models/hr/leave_application.html index bc91ea5060..e40ce3a4d3 100644 --- a/erpnext/docs/current/models/hr/leave_application.html +++ b/erpnext/docs/current/models/hr/leave_application.html @@ -867,7 +867,7 @@ Rejected erpnext.hr.doctype.leave_application.leave_application.get_leave_balance_on - (employee, leave_type, date, allocation_records=None) + (employee, leave_type, date, allocation_records=None, consider_all_leaves_in_the_allocation_period=False)

No docs

diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt b/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt index 3ac0897283..a810705e38 100644 --- a/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt +++ b/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt @@ -9,8 +9,8 @@ make-field-visible-in-print-format making-custom-reports-in-erpnext managing-dynamic-link-fields module-visibility -perm-level-error-in-permission-manager-1 +perm-level-error-in-permission-manager search-record-by-specific-field set-language set-precision-for-float-currency-and-percent-fields -user-restriction \ No newline at end of file +user-restriction diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/perm-level-error-in-permission-manager-1.md b/erpnext/docs/user/manual/en/customize-erpnext/articles/perm-level-error-in-permission-manager.md similarity index 100% rename from erpnext/docs/user/manual/en/customize-erpnext/articles/perm-level-error-in-permission-manager-1.md rename to erpnext/docs/user/manual/en/customize-erpnext/articles/perm-level-error-in-permission-manager.md From 441b2c765743987037b9a2b99e6e0520d451861b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 8 Dec 2015 12:16:22 +0530 Subject: [PATCH 2/9] [minor] limit pos search to 24 items at a time --- erpnext/accounts/doctype/sales_invoice/pos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index 145766f151..18faae7b2f 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -52,4 +52,5 @@ def get_items(price_list, sales_or_purchase, item=None): {condition} order by {order_by} - i.name""".format(condition=condition, order_by=order_by), args, as_dict=1) + i.name + limit 24""".format(condition=condition, order_by=order_by), args, as_dict=1) From cc24d28ddc44251a5ddf1b75d0c988578cb82a3a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 8 Dec 2015 12:34:01 +0530 Subject: [PATCH 3/9] [fix] address creation for new user --- erpnext/hooks.py | 3 +++ erpnext/shopping_cart/cart.py | 12 ++++++++++++ erpnext/templates/includes/address_row.html | 3 +-- erpnext/utilities/doctype/address/address.py | 17 +++++++++++------ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 734aa597e2..22a093dc77 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -111,6 +111,9 @@ doc_events = { "Price List": { "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings" }, + "Address": { + "validate": "erpnext.shopping_cart.cart.set_customer_in_address" + } } scheduler_events = { diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index c116bdc993..561a50cd72 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -280,6 +280,7 @@ def get_customer(user=None): user = frappe.session.user customer = frappe.db.get_value("Contact", {"email_id": user}, "customer") + if customer: return frappe.get_doc("Customer", customer) @@ -320,6 +321,17 @@ def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_ return address_docs +def set_customer_in_address(doc, method=None): + if doc.flags.linked: + return + + doc.check_if_linked() + + if not doc.flags.linked and (frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User"): + # creates a customer if one does not exist + get_customer() + doc.link_address() + @frappe.whitelist() def apply_shipping_rule(shipping_rule): quotation = _get_cart_quotation() diff --git a/erpnext/templates/includes/address_row.html b/erpnext/templates/includes/address_row.html index 717ca7500e..f6ec819bd5 100644 --- a/erpnext/templates/includes/address_row.html +++ b/erpnext/templates/includes/address_row.html @@ -3,7 +3,6 @@

{{ doc.address_title }}

{{ frappe.get_doc(doc).get_display() }} -

- +

diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index a4828914c3..da529fb5b3 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -10,6 +10,9 @@ from frappe.utils import cstr from frappe.model.document import Document class Address(Document): + def __setup__(self): + self.flags.linked = False + def autoname(self): if not self.address_title: self.address_title = self.customer \ @@ -42,13 +45,10 @@ class Address(Document): def link_address(self): """Link address based on owner""" - linked = False - for fieldname in self.link_fields: - if self.get(fieldname): - linked = True - break + if not self.flags.linked: + self.check_if_linked() - if not linked: + if not self.flags.linked: contact = frappe.db.get_value("Contact", {"email_id": self.owner}, ("name", "customer", "supplier"), as_dict = True) if contact: @@ -57,6 +57,11 @@ class Address(Document): self.lead = frappe.db.get_value("Lead", {"email_id": self.owner}) + def check_if_linked(self): + for fieldname in self.link_fields: + if self.get(fieldname): + self.flags.linked = True + break def validate_shipping_address(self): """Validate that there can only be one shipping address for particular customer, supplier""" From a974ab3dc54f12c914dcc3e60ff4b1824be56880 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 Dec 2015 12:56:14 +0530 Subject: [PATCH 4/9] [fix][patch] Create Tax Rule based on default taxes and charges template in Customer and Supplier --- erpnext/buying/doctype/supplier/supplier.json | 67 +++++----------- erpnext/patches.txt | 4 +- erpnext/patches/v5_8/tax_rule.py | 22 +++--- .../selling/doctype/customer/customer.json | 79 ++++++++----------- 4 files changed, 68 insertions(+), 104 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 23ae746242..498154b69a 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -27,6 +27,7 @@ "options": "icon-user", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -52,6 +53,7 @@ "options": "SUPP-", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -76,6 +78,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -97,6 +100,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -123,6 +127,7 @@ "options": "Supplier Type", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -146,6 +151,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -168,6 +174,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -191,6 +198,7 @@ "options": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -214,51 +222,7 @@ "options": "Price List", "permlevel": 0, "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_10", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "default_taxes_and_charges", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "in_filter": 0, - "in_list_view": 0, - "label": "Taxes and Charges", - "length": 0, - "no_copy": 0, - "options": "Purchase Taxes and Charges Template", - "permlevel": 0, - "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -281,6 +245,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -306,6 +271,7 @@ "options": "icon-map-marker", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -328,6 +294,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -349,6 +316,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -372,6 +340,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -395,6 +364,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -420,6 +390,7 @@ "options": "Party Account", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -443,6 +414,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -468,6 +440,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -493,6 +466,7 @@ "oldfieldtype": "Code", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -516,6 +490,7 @@ "options": "Communication", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -534,7 +509,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-11-16 06:29:58.500467", + "modified": "2015-12-08 12:52:56.827461", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index cd38e67e2c..b483929f99 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -209,7 +209,6 @@ erpnext.patches.v6_0.fix_planned_qty erpnext.patches.v6_0.multi_currency erpnext.patches.v6_2.remove_newsletter_duplicates erpnext.patches.v6_2.fix_missing_default_taxes_and_lead -erpnext.patches.v5_8.tax_rule erpnext.patches.v6_3.convert_applicable_territory erpnext.patches.v6_4.round_status_updater_percentages erpnext.patches.v6_4.repost_gle_for_journal_entries_where_reference_name_missing @@ -237,4 +236,5 @@ erpnext.patches.v6_8.move_drop_ship_to_po_items erpnext.patches.v6_10.fix_ordered_received_billed erpnext.patches.v6_10.fix_jv_total_amount #2015-11-30 erpnext.patches.v6_10.email_digest_default_quote -erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po \ No newline at end of file +erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po +erpnext.patches.v5_8.tax_rule #2015-12-08 diff --git a/erpnext/patches/v5_8/tax_rule.py b/erpnext/patches/v5_8/tax_rule.py index 80a2364293..4a62501d09 100644 --- a/erpnext/patches/v5_8/tax_rule.py +++ b/erpnext/patches/v5_8/tax_rule.py @@ -11,19 +11,21 @@ def execute(): ifnull(default_taxes_and_charges, '') != '' """, as_dict=1) for d in customers: - tr = frappe.new_doc("Tax Rule") - tr.tax_type = "Sales" - tr.customer = d.name - tr.sales_tax_template = d.default_taxes_and_charges - tr.save() + if not frappe.db.exists({"doctype": "Tax Rule", "customer": d.name}): + tr = frappe.new_doc("Tax Rule") + tr.tax_type = "Sales" + tr.customer = d.name + tr.sales_tax_template = d.default_taxes_and_charges + tr.save() suppliers = frappe.db.sql("""select name, default_taxes_and_charges from tabSupplier where ifnull(default_taxes_and_charges, '') != '' """, as_dict=1) for d in suppliers: - tr = frappe.new_doc("Tax Rule") - tr.tax_type = "Purchase" - tr.supplier = d.name - tr.purchase_tax_template = d.default_taxes_and_charges - tr.save() + if not frappe.db.exists({"doctype": "Tax Rule", "supplier": d.name}): + tr = frappe.new_doc("Tax Rule") + tr.tax_type = "Purchase" + tr.supplier = d.name + tr.purchase_tax_template = d.default_taxes_and_charges + tr.save() \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index e8efd5cea8..f27fdbf280 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -27,6 +27,7 @@ "options": "icon-user", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -50,6 +51,7 @@ "options": "CUST-", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -74,6 +76,7 @@ "oldfieldtype": "Data", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -99,6 +102,7 @@ "options": "\nCompany\nIndividual", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -124,6 +128,7 @@ "options": "Lead", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 1, "reqd": 0, @@ -145,6 +150,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -172,6 +178,7 @@ "options": "Customer Group", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -198,6 +205,7 @@ "options": "Territory", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -221,6 +229,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -244,6 +253,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -267,6 +277,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -290,6 +301,7 @@ "options": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -313,51 +325,7 @@ "options": "Price List", "permlevel": 0, "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break_14", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "default_taxes_and_charges", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "in_filter": 0, - "in_list_view": 0, - "label": "Default Taxes and Charges", - "length": 0, - "no_copy": 0, - "options": "Sales Taxes and Charges Template", - "permlevel": 0, - "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -382,6 +350,7 @@ "options": "icon-map-marker", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -404,6 +373,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -425,6 +395,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -449,6 +420,7 @@ "oldfieldtype": "HTML", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -472,6 +444,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -497,6 +470,7 @@ "options": "Party Account", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -520,6 +494,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -545,6 +520,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -570,6 +546,7 @@ "oldfieldtype": "Int", "permlevel": 1, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -595,6 +572,7 @@ "options": "", "permlevel": 1, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -620,6 +598,7 @@ "options": "icon-file-text", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -645,6 +624,7 @@ "oldfieldtype": "Code", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -667,6 +647,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -692,6 +673,7 @@ "options": "icon-group", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -717,6 +699,7 @@ "options": "Sales Partner", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -741,6 +724,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -765,6 +749,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -790,6 +775,7 @@ "options": "Sales Team", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -813,6 +799,7 @@ "options": "Communication", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -831,7 +818,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-11-16 06:29:44.236132", + "modified": "2015-12-08 12:50:05.106006", "modified_by": "Administrator", "module": "Selling", "name": "Customer", From 01ca354d52bacc659ae4aa82301f100cc4c241f5 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 8 Dec 2015 10:09:51 +0530 Subject: [PATCH 5/9] [fixes] Drop Shipping - Purchase Order Cancellation - Sales Order Status --- erpnext/buying/doctype/purchase_order/purchase_order.py | 9 ++++++++- erpnext/selling/doctype/sales_order/sales_order.py | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index feb144d0dd..fcf463b991 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -159,6 +159,8 @@ class PurchaseOrder(BuyingController): def on_cancel(self): if self.has_drop_ship_item(): self.update_status_updater() + self.reset_received_qty_for_drop_ship_items() + self.update_delivered_qty_in_sales_order() pc_obj = frappe.get_doc('Purchase Common') self.check_for_stopped_or_closed_status(pc_obj) @@ -233,7 +235,12 @@ class PurchaseOrder(BuyingController): for item in self.items: if item.delivered_by_supplier == 1: item.received_qty = item.qty - + + def reset_received_qty_for_drop_ship_items(self): + for item in self.items: + if item.delivered_by_supplier == 1: + frappe.db.set_value("Purchase Order Item", item.name, "received_qty", 0.0) + @frappe.whitelist() def stop_or_unstop_purchase_orders(names, status): if not frappe.has_permission("Purchase Order", "write"): diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 05cb50c521..6d396bd438 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -271,13 +271,13 @@ class SalesOrder(SellingController): for item in self.items: if item.delivered_by_supplier: - item_delivered_qty = frappe.db.sql("""select qty + item_delivered_qty = frappe.db.sql("""select received_qty from `tabPurchase Order Item` poi, `tabPurchase Order` po - where poi.prevdoc_docname = %s + where poi.prevdoc_detail_docname = %s and poi.prevdoc_doctype = 'Sales Order' and poi.item_code = %s and poi.parent = po.name - and po.status = 'Delivered'""", (self.name, item.item_code)) + and po.status = 'Delivered'""", (item.name, item.item_code)) item_delivered_qty = item_delivered_qty[0][0] if item_delivered_qty else 0 item.db_set("delivered_qty", item_delivered_qty) From 7af5c4aefcab3873706a88c28edad05602086300 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 Dec 2015 14:25:10 +0530 Subject: [PATCH 6/9] [fix] Print format for bank reco statement --- .../bank_reconciliation_statement.html | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html index d74938327e..ee77085ca5 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html @@ -2,7 +2,7 @@ {%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}

{%= __("Bank Reconciliation Statement") %}

-

{%= filters.account && (filters.account + ", ") || "" %} {%= filters.company %}

+

{%= filters.account %}


@@ -16,31 +16,31 @@ {% for(var i=0, l=data.length; i - - - + + - - + + {% } else { %} - - - + + + {% } %} {% } %} From 70ed6ede5c83704f041fcc617d293578b8e05fb0 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 8 Dec 2015 14:02:53 +0530 Subject: [PATCH 7/9] [fixes] patch to update delivery status for drop ship item --- .../doctype/purchase_order/purchase_order.py | 10 ++-------- erpnext/controllers/status_updater.py | 9 +++++---- erpnext/patches.txt | 3 ++- .../fix_delivery_status_of_drop_ship_item.py | 17 +++++++++++++++++ .../selling/doctype/sales_order/sales_order.py | 12 +++++++----- 5 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index fcf463b991..b10b72f3fb 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -159,7 +159,6 @@ class PurchaseOrder(BuyingController): def on_cancel(self): if self.has_drop_ship_item(): self.update_status_updater() - self.reset_received_qty_for_drop_ship_items() self.update_delivered_qty_in_sales_order() pc_obj = frappe.get_doc('Purchase Common') @@ -218,7 +217,7 @@ class PurchaseOrder(BuyingController): for so_name in sales_orders_to_update: so = frappe.get_doc("Sales Order", so_name) - so.update_delivery_status(self.name) + so.update_delivery_status() so.set_status(update=True) so.notify_update() @@ -235,12 +234,7 @@ class PurchaseOrder(BuyingController): for item in self.items: if item.delivered_by_supplier == 1: item.received_qty = item.qty - - def reset_received_qty_for_drop_ship_items(self): - for item in self.items: - if item.delivered_by_supplier == 1: - frappe.db.set_value("Purchase Order Item", item.name, "received_qty", 0.0) - + @frappe.whitelist() def stop_or_unstop_purchase_orders(names, status): if not frappe.has_permission("Purchase Order", "write"): diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index eb8d5e9574..73e9d7f0ee 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -76,10 +76,10 @@ class StatusUpdater(Document): self.update_qty() self.validate_qty() - def set_status(self, update=False, status=None): + def set_status(self, update=False, status=None, update_modified=True): if self.is_new(): return - + if self.doctype in status_map: _status = self.status @@ -102,9 +102,10 @@ class StatusUpdater(Document): if self.status != _status and self.status not in ("Submitted", "Cancelled"): self.add_comment("Label", _(self.status)) - + if update: - frappe.db.set_value(self.doctype, self.name, "status", self.status) + frappe.db.set_value(self.doctype, self.name, "status", self.status, + update_modified=update_modified) def validate_qty(self): """Validates qty at row level""" diff --git a/erpnext/patches.txt b/erpnext/patches.txt index cd38e67e2c..302a33866c 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -237,4 +237,5 @@ erpnext.patches.v6_8.move_drop_ship_to_po_items erpnext.patches.v6_10.fix_ordered_received_billed erpnext.patches.v6_10.fix_jv_total_amount #2015-11-30 erpnext.patches.v6_10.email_digest_default_quote -erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po \ No newline at end of file +erpnext.patches.v6_10.fix_billed_amount_in_drop_ship_po +erpnext.patches.v6_10.fix_delivery_status_of_drop_ship_item \ No newline at end of file diff --git a/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py b/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py new file mode 100644 index 0000000000..a54d0ab389 --- /dev/null +++ b/erpnext/patches/v6_10/fix_delivery_status_of_drop_ship_item.py @@ -0,0 +1,17 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + sales_orders_to_update = [] + + for item in frappe.get_all("Purchase Order Item", filters={"delivered_by_supplier": 1}, + fields=["prevdoc_doctype", "prevdoc_docname"]): + + if item.prevdoc_doctype == "Sales Order": + if item.prevdoc_docname not in sales_orders_to_update: + sales_orders_to_update.append(item.prevdoc_docname) + + for so_name in sales_orders_to_update: + so = frappe.get_doc("Sales Order", so_name) + so.update_delivery_status() + so.set_status(update=True, update_modified=False) \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 6d396bd438..7712f5ebe6 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -265,27 +265,29 @@ class SalesOrder(SellingController): if exc_list: frappe.throw('\n'.join(exc_list)) - def update_delivery_status(self, po_name): + def update_delivery_status(self): """Update delivery status from Purchase Order for drop shipping""" tot_qty, delivered_qty = 0.0, 0.0 for item in self.items: if item.delivered_by_supplier: - item_delivered_qty = frappe.db.sql("""select received_qty + item_delivered_qty = frappe.db.sql("""select sum(qty) from `tabPurchase Order Item` poi, `tabPurchase Order` po where poi.prevdoc_detail_docname = %s and poi.prevdoc_doctype = 'Sales Order' and poi.item_code = %s and poi.parent = po.name + and po.docstatus = 1 and po.status = 'Delivered'""", (item.name, item.item_code)) item_delivered_qty = item_delivered_qty[0][0] if item_delivered_qty else 0 - item.db_set("delivered_qty", item_delivered_qty) + item.db_set("delivered_qty", flt(item_delivered_qty), update_modified=False) delivered_qty += item.delivered_qty tot_qty += item.qty - - frappe.db.set_value("Sales Order", self.name, "per_delivered", flt(delivered_qty/tot_qty) * 100) + + frappe.db.set_value("Sales Order", self.name, "per_delivered", flt(delivered_qty/tot_qty) * 100, + update_modified=False) def get_list_context(context=None): from erpnext.controllers.website_list_for_contact import get_list_context From 41c8cf645ae38e201646523a43aab5f38af426f9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 Dec 2015 14:50:24 +0530 Subject: [PATCH 8/9] [fix] Get incoming rate if args as json --- erpnext/stock/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 0d95c58337..3f9de86493 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -92,6 +92,9 @@ def update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False): def get_incoming_rate(args): """Get Incoming Rate based on valuation method""" from erpnext.stock.stock_ledger import get_previous_sle + + if isinstance(args, basestring): + args = json.loads(args) in_rate = 0 if (args.get("serial_no") or "").strip(): From d56ec926825d6708e36d034892d3b028e756cd99 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 Dec 2015 16:10:17 +0600 Subject: [PATCH 9/9] bumped to version 6.12.5 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index e0496c667e..b9ede7a74b 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.12.4' +__version__ = '6.12.5' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 22a093dc77..1d3e659a92 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.12.4" +app_version = "6.12.5" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index 56c5b7ddf1..7bf702727d 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "6.12.4" +version = "6.12.5" with open("requirements.txt", "r") as f: install_requires = f.readlines()
{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}{%= data[i][__("Journal Entry")] %}{%= __("Against") %}: {%= data[i][__("Against Account")] %} - {% if (data[i][__("Reference")]) { %} -
{%= __("Reference") %}: {%= data[i][__("Reference")] %} - {% if (data[i][__("Ref Date")]) { %} -
{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i][__("Ref Date")]) %} +
{%= dateutil.str_to_user(data[i]["posting_date"]) %}{%= data[i]["journal_entry"] %}{%= __("Against") %}: {%= data[i]["against_account"] %} + {% if (data[i]["reference"]) { %} +
{%= __("Reference") %}: {%= data[i]["reference"] %} + {% if (data[i]["ref_date"]) { %} +
{%= __("Reference Date") %}: {%= dateutil.str_to_user(data[i]["ref_date"]) %} {% } %} {% } %} - {% if (data[i][__("Clearance Date")]) { %} -
{%= __("Clearance Date") %}: {%= dateutil.str_to_user(data[i][__("Clearance Date")]) %} + {% if (data[i]["clearance_date"]) { %} +
{%= __("Clearance Date") %}: {%= dateutil.str_to_user(data[i]["clearance_date"]) %} {% } %}
{%= format_currency(data[i][__("Debit")]) %}{%= format_currency(data[i][__("Credit")]) %}{%= format_currency(data[i]["debit"]) %}{%= format_currency(data[i]["credit"]) %}
{%= data[i][__("Journal Entry")] %}{%= format_currency(data[i][__("Debit")]) %}{%= format_currency(data[i][__("Credit")]) %}{%= data[i]["journal_entry"] %}{%= format_currency(data[i]["debit"]) %}{%= format_currency(data[i]["credit"]) %}