diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py index 6b514b23d0..30f91721d5 100644 --- a/erpnext/controllers/website_list_for_contact.py +++ b/erpnext/controllers/website_list_for_contact.py @@ -19,7 +19,7 @@ def get_list_context(context=None): } def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20): - from frappe.templates.pages.list import get_list + from frappe.www.list import get_list user = frappe.session.user key = None diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index b977e26839..ad8eea615b 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -48,13 +48,16 @@ class Opportunity(TransactionBase): if not lead_name: sender_name = get_fullname(self.contact_email) if sender_name == self.contact_email: - sender_name = None - - account = '' - email_name = self.contact_email[0:self.contact_email.index('@')] - email_split = email_name.split('.') - for s in email_split: - account = account + s.capitalize() + ' ' + sender_name = None + + account = _('Unknown') + + if self.contact_email.index('@'): + email_name = self.contact_email[0:self.contact_email.index('@')] + + email_split = email_name.split('.') + for s in email_split: + account = account + s.capitalize() + ' ' lead = frappe.get_doc({ "doctype": "Lead", diff --git a/erpnext/docs/__init__.py b/erpnext/docs/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/__init__.py b/erpnext/docs/assets/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/__init__.py b/erpnext/docs/assets/img/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/accounts/__init__.py b/erpnext/docs/assets/img/accounts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/accounts/multi-currency/__init__.py b/erpnext/docs/assets/img/accounts/multi-currency/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/articles/__init__.py b/erpnext/docs/assets/img/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/buying/__init__.py b/erpnext/docs/assets/img/buying/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/crm/__init__.py b/erpnext/docs/assets/img/crm/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/customize/__init__.py b/erpnext/docs/assets/img/customize/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/human-resources/__init__.py b/erpnext/docs/assets/img/human-resources/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/manufacturing/__init__.py b/erpnext/docs/assets/img/manufacturing/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/multilingual_print_format/__init__.py b/erpnext/docs/assets/img/multilingual_print_format/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/pos-setting/__init__.py b/erpnext/docs/assets/img/pos-setting/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/price-list/__init__.py b/erpnext/docs/assets/img/price-list/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/project/__init__.py b/erpnext/docs/assets/img/project/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/selling/__init__.py b/erpnext/docs/assets/img/selling/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup-wizard/__init__.py b/erpnext/docs/assets/img/setup-wizard/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/__init__.py b/erpnext/docs/assets/img/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/customize/__init__.py b/erpnext/docs/assets/img/setup/customize/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/data-import/__init__.py b/erpnext/docs/assets/img/setup/data-import/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/data/__init__.py b/erpnext/docs/assets/img/setup/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/email/__init__.py b/erpnext/docs/assets/img/setup/email/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/print/__init__.py b/erpnext/docs/assets/img/setup/print/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/settings/__init__.py b/erpnext/docs/assets/img/setup/settings/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/setup/users/__init__.py b/erpnext/docs/assets/img/setup/users/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/stock/__init__.py b/erpnext/docs/assets/img/stock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/support/__init__.py b/erpnext/docs/assets/img/support/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/taxes/__init__.py b/erpnext/docs/assets/img/taxes/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/users-and-permissions/__init__.py b/erpnext/docs/assets/img/users-and-permissions/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/videos/__init__.py b/erpnext/docs/assets/img/videos/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/website/__init__.py b/erpnext/docs/assets/img/website/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/old_images/__init__.py b/erpnext/docs/assets/old_images/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/old_images/erpnext/__init__.py b/erpnext/docs/assets/old_images/erpnext/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/__init__.py b/erpnext/docs/user/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/__init__.py b/erpnext/docs/user/manual/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/Beispiel/__init__.py b/erpnext/docs/user/manual/de/Beispiel/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/CRM/__init__.py b/erpnext/docs/user/manual/de/CRM/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/CRM/setup/__init__.py b/erpnext/docs/user/manual/de/CRM/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/__init__.py b/erpnext/docs/user/manual/de/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/accounts/__init__.py b/erpnext/docs/user/manual/de/accounts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/accounts/setup/__init__.py b/erpnext/docs/user/manual/de/accounts/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/accounts/tools/__init__.py b/erpnext/docs/user/manual/de/accounts/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/buying/__init__.py b/erpnext/docs/user/manual/de/buying/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/buying/setup/__init__.py b/erpnext/docs/user/manual/de/buying/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/customer-portal/__init__.py b/erpnext/docs/user/manual/de/customer-portal/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/customize-erpnext/__init__.py b/erpnext/docs/user/manual/de/customize-erpnext/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/__init__.py b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/__init__.py b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/human-resources/__init__.py b/erpnext/docs/user/manual/de/human-resources/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/human-resources/setup/__init__.py b/erpnext/docs/user/manual/de/human-resources/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/human-resources/tools/__init__.py b/erpnext/docs/user/manual/de/human-resources/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/introduction/__init__.py b/erpnext/docs/user/manual/de/introduction/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/manufacturing/__init__.py b/erpnext/docs/user/manual/de/manufacturing/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/manufacturing/setup/__init__.py b/erpnext/docs/user/manual/de/manufacturing/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/manufacturing/tools/__init__.py b/erpnext/docs/user/manual/de/manufacturing/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/projects/__init__.py b/erpnext/docs/user/manual/de/projects/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/selling/__init__.py b/erpnext/docs/user/manual/de/selling/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/selling/setup/__init__.py b/erpnext/docs/user/manual/de/selling/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/__init__.py b/erpnext/docs/user/manual/de/setting-up/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/data/__init__.py b/erpnext/docs/user/manual/de/setting-up/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/email/__init__.py b/erpnext/docs/user/manual/de/setting-up/email/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/print/__init__.py b/erpnext/docs/user/manual/de/setting-up/print/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/settings/__init__.py b/erpnext/docs/user/manual/de/setting-up/settings/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/setup-wizard/__init__.py b/erpnext/docs/user/manual/de/setting-up/setup-wizard/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/setting-up/users-and-permissions/__init__.py b/erpnext/docs/user/manual/de/setting-up/users-and-permissions/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/stock/__init__.py b/erpnext/docs/user/manual/de/stock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/stock/accounting-of-inventory-stock/__init__.py b/erpnext/docs/user/manual/de/stock/accounting-of-inventory-stock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/stock/articles/__init__.py b/erpnext/docs/user/manual/de/stock/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/stock/setup/__init__.py b/erpnext/docs/user/manual/de/stock/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/stock/tools/__init__.py b/erpnext/docs/user/manual/de/stock/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/support/__init__.py b/erpnext/docs/user/manual/de/support/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/using-erpnext/__init__.py b/erpnext/docs/user/manual/de/using-erpnext/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/website/__init__.py b/erpnext/docs/user/manual/de/website/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/de/website/setup/__init__.py b/erpnext/docs/user/manual/de/website/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/CRM/__init__.py b/erpnext/docs/user/manual/en/CRM/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/CRM/setup/__init__.py b/erpnext/docs/user/manual/en/CRM/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/__init__.py b/erpnext/docs/user/manual/en/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/accounts/__init__.py b/erpnext/docs/user/manual/en/accounts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/accounts/articles/__init__.py b/erpnext/docs/user/manual/en/accounts/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/accounts/setup/__init__.py b/erpnext/docs/user/manual/en/accounts/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/accounts/tools/__init__.py b/erpnext/docs/user/manual/en/accounts/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/buying/__init__.py b/erpnext/docs/user/manual/en/buying/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/buying/articles/__init__.py b/erpnext/docs/user/manual/en/buying/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/buying/setup/__init__.py b/erpnext/docs/user/manual/en/buying/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/customer-portal/__init__.py b/erpnext/docs/user/manual/en/customer-portal/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/customize-erpnext/__init__.py b/erpnext/docs/user/manual/en/customize-erpnext/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/__init__.py b/erpnext/docs/user/manual/en/customize-erpnext/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/__init__.py b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/__init__.py b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/human-resources/__init__.py b/erpnext/docs/user/manual/en/human-resources/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/human-resources/articles/__init__.py b/erpnext/docs/user/manual/en/human-resources/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/human-resources/setup/__init__.py b/erpnext/docs/user/manual/en/human-resources/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/human-resources/tools/__init__.py b/erpnext/docs/user/manual/en/human-resources/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/introduction/__init__.py b/erpnext/docs/user/manual/en/introduction/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/manufacturing/__init__.py b/erpnext/docs/user/manual/en/manufacturing/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/manufacturing/articles/__init__.py b/erpnext/docs/user/manual/en/manufacturing/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/manufacturing/setup/__init__.py b/erpnext/docs/user/manual/en/manufacturing/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/manufacturing/tools/__init__.py b/erpnext/docs/user/manual/en/manufacturing/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/projects/__init__.py b/erpnext/docs/user/manual/en/projects/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/projects/articles/__init__.py b/erpnext/docs/user/manual/en/projects/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/selling/__init__.py b/erpnext/docs/user/manual/en/selling/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/selling/articles/__init__.py b/erpnext/docs/user/manual/en/selling/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/selling/setup/__init__.py b/erpnext/docs/user/manual/en/selling/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/__init__.py b/erpnext/docs/user/manual/en/setting-up/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/articles/__init__.py b/erpnext/docs/user/manual/en/setting-up/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/data/__init__.py b/erpnext/docs/user/manual/en/setting-up/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/email/__init__.py b/erpnext/docs/user/manual/en/setting-up/email/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/print/__init__.py b/erpnext/docs/user/manual/en/setting-up/print/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/settings/__init__.py b/erpnext/docs/user/manual/en/setting-up/settings/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/__init__.py b/erpnext/docs/user/manual/en/setting-up/setup-wizard/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/__init__.py b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/__init__.py b/erpnext/docs/user/manual/en/stock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/__init__.py b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/articles/__init__.py b/erpnext/docs/user/manual/en/stock/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/item/__init__.py b/erpnext/docs/user/manual/en/stock/item/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/setup/__init__.py b/erpnext/docs/user/manual/en/stock/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/stock/tools/__init__.py b/erpnext/docs/user/manual/en/stock/tools/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/support/__init__.py b/erpnext/docs/user/manual/en/support/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/using-erpnext/__init__.py b/erpnext/docs/user/manual/en/using-erpnext/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/__init__.py b/erpnext/docs/user/manual/en/using-erpnext/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/website/__init__.py b/erpnext/docs/user/manual/en/website/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/website/articles/__init__.py b/erpnext/docs/user/manual/en/website/articles/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/website/setup/__init__.py b/erpnext/docs/user/manual/en/website/setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/es/__init__.py b/erpnext/docs/user/manual/es/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/es/accounts/__init__.py b/erpnext/docs/user/manual/es/accounts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/videos/__init__.py b/erpnext/docs/user/videos/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/videos/learn/__init__.py b/erpnext/docs/user/videos/learn/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/doctype/job_opening/job_opening.json b/erpnext/hr/doctype/job_opening/job_opening.json index 3cf14313eb..4556ed3e46 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.json +++ b/erpnext/hr/doctype/job_opening/job_opening.json @@ -3,6 +3,7 @@ "allow_import": 0, "allow_rename": 0, "autoname": "field:job_title", + "beta": 0, "creation": "2013-01-15 16:13:36", "custom": 0, "description": "Description of a Job Opening", @@ -59,6 +60,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "publish", + "fieldname": "route", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Route", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 1 + }, { "allow_on_submit": 0, "bold": 0, @@ -108,71 +135,20 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "depends_on": "publish", - "fieldname": "page_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Page Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 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, - "default": "jobs", - "fieldname": "parent_website_route", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Parent Website Route", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 } ], "hide_heading": 0, "hide_toolbar": 0, "icon": "icon-bookmark", "idx": 1, + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-02 01:44:28.280777", + "modified": "2016-06-23 14:45:46.102129", "modified_by": "Administrator", "module": "HR", "name": "Job Opening", @@ -199,7 +175,9 @@ "write": 1 } ], + "quick_entry": 0, "read_only": 0, "read_only_onload": 0, - "sort_order": "ASC" + "sort_order": "ASC", + "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py index acc40b7b49..267e7a84ff 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.py +++ b/erpnext/hr/doctype/job_opening/job_opening.py @@ -17,9 +17,9 @@ class JobOpening(WebsiteGenerator): condition_field = "publish", page_title_field = "job_title", ) - - def get_route(self): - return 'jobs/' + quoted(self.page_name) + + def make_route(self): + return 'jobs/' + self.scrub(self.job_title) def get_context(self, context): context.parents = [{'name': 'jobs', 'title': _('All Jobs') }] diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 64df3710d7..2493643e66 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -272,3 +272,4 @@ execute:frappe.db.sql('update tabQuotation set status="Cancelled" where docstatu execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=True) erpnext.patches.v7_0.update_mins_to_first_response erpnext.patches.v6_20x.repost_valuation_rate_for_negative_inventory +erpnext.patches.v7_0.re_route diff --git a/erpnext/patches/v4_2/default_website_style.py b/erpnext/patches/v4_2/default_website_style.py index e9f2cb97c6..cdf0a7a983 100644 --- a/erpnext/patches/v4_2/default_website_style.py +++ b/erpnext/patches/v4_2/default_website_style.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe.templates.pages.style_settings import default_properties +from frappe.www.style_settings import default_properties def execute(): frappe.reload_doc('website', 'doctype', 'style_settings') diff --git a/erpnext/patches/v6_5/show_in_website_for_template_item.py b/erpnext/patches/v6_5/show_in_website_for_template_item.py index 48040ee949..af6e8304d6 100644 --- a/erpnext/patches/v6_5/show_in_website_for_template_item.py +++ b/erpnext/patches/v6_5/show_in_website_for_template_item.py @@ -9,7 +9,7 @@ def execute(): item = frappe.get_doc("Item", item_code) item.db_set("show_in_website", 1, update_modified=False) - item.get_route() - item.db_set("page_name", item.page_name, update_modified=False) + item.make_route() + item.db_set("route", item.route, update_modified=False) frappe.website.render.clear_cache() diff --git a/erpnext/patches/v7_0/re_route.py b/erpnext/patches/v7_0/re_route.py new file mode 100644 index 0000000000..1db492094b --- /dev/null +++ b/erpnext/patches/v7_0/re_route.py @@ -0,0 +1,4 @@ +from frappe.patches.v7_0.re_route import update_routes + +def execute(): + update_routes(['Item', 'Item Group', 'Sales Partner', 'Job Opening']) \ No newline at end of file diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json index e5ccc2d835..37d8c81585 100644 --- a/erpnext/setup/doctype/item_group/item_group.json +++ b/erpnext/setup/doctype/item_group/item_group.json @@ -3,6 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:item_group_name", + "beta": 0, "creation": "2013-03-28 10:35:29", "custom": 0, "description": "Item Classification", @@ -268,17 +269,18 @@ "bold": 0, "collapsible": 0, "depends_on": "show_in_website", - "fieldname": "page_name", + "fieldname": "route", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, - "label": "Page Name", + "label": "Route", "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -286,33 +288,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "depends_on": "show_in_website", - "fieldname": "parent_website_route", - "fieldtype": "Read Only", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Parent Website Route", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "unique": 1 }, { "allow_on_submit": 0, @@ -478,13 +454,14 @@ "hide_toolbar": 0, "icon": "icon-sitemap", "idx": 1, + "image_view": 0, "in_create": 1, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 3, - "modified": "2016-03-28 08:38:30.868523", + "modified": "2016-06-23 14:44:46.228923", "modified_by": "Administrator", "module": "Setup", "name": "Item Group", @@ -611,6 +588,7 @@ "write": 0 } ], + "quick_entry": 0, "read_only": 0, "read_only_onload": 0, "search_fields": "parent_item_group", diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index dc30de14f2..3484fe2e55 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -16,13 +16,16 @@ class ItemGroup(NestedSet, WebsiteGenerator): website = frappe._dict( condition_field = "show_in_website", template = "templates/generators/item_group.html", - parent_website_route_field = "parent_item_group", no_cache = 1 ) def autoname(self): self.name = self.item_group_name + def validate(self): + super(ItemGroup, self).validate() + self.make_route() + def on_update(self): NestedSet.on_update(self) WebsiteGenerator.on_update(self) @@ -30,6 +33,15 @@ class ItemGroup(NestedSet, WebsiteGenerator): self.validate_name_with_item() self.validate_one_root() + def make_route(self): + '''Make website route''' + if not self.route: + self.route = '' + if self.parent_item_group: + self.route = frappe.get_doc('Item Group', self.parent_item_group).route + '/' + + self.route += self.scrub(self.item_group_name) + def after_rename(self, olddn, newdn, merge=False): NestedSet.after_rename(self, olddn, newdn, merge) WebsiteGenerator.after_rename(self, olddn, newdn, merge) @@ -38,16 +50,6 @@ class ItemGroup(NestedSet, WebsiteGenerator): NestedSet.on_trash(self) WebsiteGenerator.on_trash(self) - def set_parent_website_route(self): - """Overwrite `parent_website_route` from `WebsiteGenerator`. - Only set `parent_website_route` if parent is visble. - - e.g. If `show_in_website` is set for Products then url should be `/products`""" - if self.parent_item_group and frappe.db.get_value("Item Group", self.parent_item_group, "show_in_website"): - WebsiteGenerator.set_parent_website_route(self) - else: - self.parent_website_route = "" - def validate_name_with_item(self): if frappe.db.exists("Item", self.name): frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name)) @@ -74,9 +76,8 @@ def get_product_list_for_group(product_group=None, start=0, limit=10, search=Non child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(product_group)]) # base query - query = """select name, item_name, item_code, page_name, image, website_image, thumbnail, item_group, - description, web_long_description as website_description, - concat(parent_website_route, "/", page_name) as route + query = """select name, item_name, item_code, route, image, website_image, thumbnail, item_group, + description, web_long_description as website_description from `tabItem` where show_in_website = 1 and disabled=0 @@ -127,7 +128,7 @@ def get_group_item_count(item_group): def get_parent_item_groups(item_group_name): item_group = frappe.get_doc("Item Group", item_group_name) - return frappe.db.sql("""select name, page_name from `tabItem Group` + return frappe.db.sql("""select name, route from `tabItem Group` where lft <= %s and rgt >= %s and show_in_website=1 order by lft asc""", (item_group.lft, item_group.rgt), as_dict=True) @@ -138,6 +139,5 @@ def invalidate_cache_for(doc, item_group=None): for d in get_parent_item_groups(item_group): d = frappe.get_doc("Item Group", d.name) - route = d.get_route() - if route: - clear_cache(route) + if d.route: + clear_cache(d.route) diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.json b/erpnext/setup/doctype/sales_partner/sales_partner.json index d6a49c5f9f..7cdb30d61a 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.json +++ b/erpnext/setup/doctype/sales_partner/sales_partner.json @@ -1,664 +1,694 @@ { - "allow_copy": 0, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:partner_name", - "creation": "2013-04-12 15:34:06", - "custom": 0, - "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Setup", + "allow_copy": 0, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:partner_name", + "beta": 0, + "creation": "2013-04-12 15:34:06", + "custom": 0, + "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", "fields": [ { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "partner_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Sales Partner Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "partner_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "partner_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Sales Partner Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "partner_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "partner_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Partner Type", - "length": 0, - "no_copy": 0, - "oldfieldname": "partner_type", - "oldfieldtype": "Select", - "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "partner_type", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Partner Type", + "length": 0, + "no_copy": 0, + "oldfieldname": "partner_type", + "oldfieldtype": "Select", + "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "description": "", - "fieldname": "territory", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Territory", - "length": 0, - "no_copy": 0, - "options": "Territory", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "", + "fieldname": "territory", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Territory", + "length": 0, + "no_copy": 0, + "options": "Territory", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break0", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "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_break0", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0, "width": "50%" - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "commission_rate", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Commission Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "commission_rate", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Commission Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "address_contacts", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Address & Contacts", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "address_contacts", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Address & Contacts", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "depends_on": "eval:doc.__islocal", - "fieldname": "address_desc", - "fieldtype": "HTML", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Address Desc", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "eval:doc.__islocal", + "fieldname": "address_desc", + "fieldtype": "HTML", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Address Desc", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "address_html", - "fieldtype": "HTML", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Address HTML", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "address_html", + "fieldtype": "HTML", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Address HTML", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "column_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "depends_on": "eval:doc.__islocal", - "fieldname": "contact_desc", - "fieldtype": "HTML", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Contact Desc", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "eval:doc.__islocal", + "fieldname": "contact_desc", + "fieldtype": "HTML", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Contact Desc", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "contact_html", - "fieldtype": "HTML", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Contact HTML", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "contact_html", + "fieldtype": "HTML", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Contact HTML", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "partner_target_details_section_break", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Sales Partner Target", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "partner_target_details_section_break", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Sales Partner Target", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "targets", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Targets", - "length": 0, - "no_copy": 0, - "oldfieldname": "partner_target_details", - "oldfieldtype": "Table", - "options": "Target Detail", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "targets", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Targets", + "length": 0, + "no_copy": 0, + "oldfieldname": "partner_target_details", + "oldfieldtype": "Table", + "options": "Target Detail", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "description": "Select Monthly Distribution to unevenly distribute targets across months.", - "fieldname": "distribution_id", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Target Distribution", - "length": 0, - "no_copy": 0, - "oldfieldname": "distribution_id", - "oldfieldtype": "Link", - "options": "Monthly Distribution", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "Select Monthly Distribution to unevenly distribute targets across months.", + "fieldname": "distribution_id", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Target Distribution", + "length": 0, + "no_copy": 0, + "oldfieldname": "distribution_id", + "oldfieldtype": "Link", + "options": "Monthly Distribution", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "website", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Website", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "website", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Website", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "show_in_website", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Show In Website", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "show_in_website", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Show In Website", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "depends_on": "eval:cint(doc.show_in_website)", - "fieldname": "section_break_17", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "show_in_website", + "fieldname": "section_break_17", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "logo", - "fieldtype": "Attach", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Logo", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "route", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Route", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 1 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "column_break_20", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "partner_website", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Partner's Website", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "logo", + "fieldtype": "Attach", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Logo", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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_20", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "partner_website", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Partner website", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "page_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Page Name", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "depends_on": "show_in_website", + "fieldname": "section_break_22", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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, - "depends_on": "eval:cint(doc.show_in_website)", - "fieldname": "section_break_22", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "introduction", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Introduction", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 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": "introduction", - "fieldtype": "Text", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Introduction", - "length": 0, - "no_copy": 0, - "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": "description", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "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, - "default": "partners", - "fieldname": "parent_website_route", - "fieldtype": "Read Only", - "hidden": 0, - "ignore_user_permissions": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Parent Website Route", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 } - ], - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-user", - "idx": 1, - "in_create": 0, - "in_dialog": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2015-11-16 06:29:57.096980", - "modified_by": "Administrator", - "module": "Setup", - "name": "Sales Partner", - "owner": "Administrator", + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-user", + "idx": 1, + "image_view": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2016-06-23 14:45:31.978973", + "modified_by": "Administrator", + "module": "Setup", + "name": "Sales Partner", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Manager", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 0 - }, + }, { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 0 - }, + }, { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Master Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, "write": 1 } - ], - "read_only": 0, - "read_only_onload": 0 -} + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "sort_order": "ASC", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py index 0e0f4ba967..5a2aa4993b 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/sales_partner.py @@ -22,7 +22,8 @@ class SalesPartner(WebsiteGenerator): self.name = self.partner_name def validate(self): - self.parent_website_route = "partners" + if not self.route: + self.route = "partners/" + self.scrub(self.partner_name) super(SalesPartner, self).validate() if self.partner_website and not self.partner_website.startswith("http"): self.partner_website = "http://" + self.partner_website diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index daecaa6863..d5cde4ad69 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -155,7 +155,7 @@ def guess_territory(): def decorate_quotation_doc(doc): for d in doc.get("items", []): d.update(frappe.db.get_value("Item", d.item_code, - ["thumbnail", "website_image", "description", "page_name"], as_dict=True)) + ["thumbnail", "website_image", "description", "route"], as_dict=True)) return doc diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 2d6dae205a..fd7a31b56d 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1861,18 +1861,18 @@ "bold": 0, "collapsible": 0, "depends_on": "show_in_website", - "description": "website page link", - "fieldname": "page_name", + "fieldname": "route", "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, - "label": "Page Name", + "label": "Route", "length": 0, - "no_copy": 1, + "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1880,7 +1880,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0 + "unique": 1 }, { "allow_on_submit": 0, @@ -2166,31 +2166,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "parent_website_route", - "fieldtype": "Read Only", - "hidden": 0, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Parent Website Route", - "length": 0, - "no_copy": 1, - "options": "", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -2222,13 +2197,14 @@ "icon": "icon-tag", "idx": 2, "image_field": "image", + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2016-06-02 14:48:46.128121", + "modified": "2016-06-23 14:44:31.115557", "modified_by": "Administrator", "module": "Stock", "name": "Item", diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index bd2ada9f33..686c5d887e 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -22,7 +22,6 @@ class Item(WebsiteGenerator): page_title_field = "item_name", condition_field = "show_in_website", template = "templates/generators/item.html", - parent_website_route_field = "item_group", no_cache = 1 ) @@ -133,6 +132,14 @@ class Item(WebsiteGenerator): stock_entry.add_comment("Comment", _("Opening Stock")) + def make_route(self): + if not self.route: + self.route = frappe.db.get_value('Item Group', self.item_group, 'route') + '/' + self.scrub(self.item_name) + + def get_parents(self, context): + item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route']) + context.parents = [{'name': route, 'label': item_group}] + def validate_website_image(self): """Validate if the website image is a public file""" auto_set_website_image = False @@ -218,7 +225,7 @@ class Item(WebsiteGenerator): if self.variant_of: # redirect to template page! template_item = frappe.get_doc("Item", self.variant_of) - frappe.flags.redirect_location = template_item.get_route() + "?variant=" + urllib.quote(self.name) + frappe.flags.redirect_location = template_item.route + "?variant=" + urllib.quote(self.name) raise frappe.Redirect context.parent_groups = get_parent_item_groups(self.item_group) + \ @@ -506,9 +513,9 @@ class Item(WebsiteGenerator): def after_rename(self, old_name, new_name, merge): super(Item, self).after_rename(old_name, new_name, merge) - if self.page_name: + if self.route: invalidate_cache_for_item(self) - clear_cache(self.page_name) + clear_cache(self.route) frappe.db.set_value("Item", new_name, "item_code", new_name) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index ab8e6d8a97..36d0876bbd 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -64,7 +64,7 @@ def get_list_context(context=None): } def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20): - from frappe.templates.pages.list import get_list + from frappe.www.list import get_list user = frappe.session.user ignore_permissions = False if is_website_user(): diff --git a/erpnext/templates/includes/products_as_grid.html b/erpnext/templates/includes/products_as_grid.html index 0a66de2165..7a15c1ffe3 100644 --- a/erpnext/templates/includes/products_as_grid.html +++ b/erpnext/templates/includes/products_as_grid.html @@ -1,6 +1,6 @@ {% from "erpnext/templates/includes/macros.html" import product_image_square %} - +
{{ product_image_square(thumbnail or website_image) }} diff --git a/erpnext/templates/includes/products_as_list.html b/erpnext/templates/includes/products_as_list.html index a5523a99e0..b2069e4509 100644 --- a/erpnext/templates/includes/products_as_list.html +++ b/erpnext/templates/includes/products_as_list.html @@ -1,6 +1,6 @@ {% from "erpnext/templates/includes/macros.html" import product_image_square %} - +
{{ product_image_square(thumbnail or website_image) }} diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html index 7d8d0ff728..35e49894e3 100644 --- a/erpnext/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -75,5 +75,5 @@
- + {% endblock %} diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py index 4440f7e1ea..e62687e63c 100644 --- a/erpnext/templates/pages/home.py +++ b/erpnext/templates/pages/home.py @@ -11,9 +11,7 @@ def get_context(context): homepage = frappe.get_doc('Homepage') for item in homepage.products: - parent_website_route, page_name = frappe.db.get_value('Item', item.item_code, - ['parent_website_route', 'page_name']) - item.route = '/' + '/'.join(filter(None, [parent_website_route, page_name])) + item.route = '/' + frappe.db.get_value('Item', item.item_code, 'route') # show atleast 3 products if len(homepage.products) < 3: diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index b548e1f795..71291783b0 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -4,13 +4,10 @@ {% block breadcrumbs %} {% include "templates/includes/breadcrumbs.html" %} {% endblock %} -{% block title %} -{{ doc.name }} -{% endblock %} -{% block header %} -

{{ doc.name }}

-{% endblock %} +{% block title %}{{ doc.name }}{% endblock %} + +{% block header %}

{{ doc.name }}

{% endblock %} {% block page_content %} diff --git a/erpnext/templates/pages/partners.html b/erpnext/templates/pages/partners.html index 132c06b294..72d6a6478f 100644 --- a/erpnext/templates/pages/partners.html +++ b/erpnext/templates/pages/partners.html @@ -10,7 +10,7 @@
{% if partner_info.logo -%} - + diff --git a/erpnext/templates/pages/partners.py b/erpnext/templates/pages/partners.py index 508ea71333..6725a3e294 100644 --- a/erpnext/templates/pages/partners.py +++ b/erpnext/templates/pages/partners.py @@ -11,9 +11,6 @@ def get_context(context): partners = frappe.db.sql("""select * from `tabSales Partner` where show_in_website=1 order by name asc""", as_dict=True) - for p in partners: - p.route = frappe.get_doc("Sales Partner", p.name).get_route() - return { "partners": partners, "title": page_title diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py index 465fdd5ecf..8124215f74 100644 --- a/erpnext/templates/pages/product_search.py +++ b/erpnext/templates/pages/product_search.py @@ -14,8 +14,8 @@ def get_product_list(search=None, start=0, limit=12): # limit = 12 because we show 12 items in the grid view # base query - query = """select name, item_name, item_code, page_name, website_image, thumbnail, item_group, - description, web_long_description as website_description, parent_website_route + query = """select name, item_name, item_code, route, website_image, thumbnail, item_group, + description, web_long_description as website_description from `tabItem` where show_in_website = 1 and disabled=0 @@ -38,9 +38,5 @@ def get_product_list(search=None, start=0, limit=12): "today": nowdate() }, as_dict=1) - for d in data: - d.route = ((d.parent_website_route + "/") if d.parent_website_route else "") \ - + (d.page_name or "") - return [get_item_for_list_in_html(r) for r in data] diff --git a/erpnext/templates/pages/rfq.html b/erpnext/templates/pages/rfq.html index cef93a55e1..5729e89d40 100644 --- a/erpnext/templates/pages/rfq.html +++ b/erpnext/templates/pages/rfq.html @@ -71,5 +71,5 @@
- + {% endblock %} diff --git a/erpnext/templates/pages/task_info.html b/erpnext/templates/pages/task_info.html index c756cd5679..1d6574b0ab 100644 --- a/erpnext/templates/pages/task_info.html +++ b/erpnext/templates/pages/task_info.html @@ -1,23 +1,23 @@ {% extends "templates/web.html" %} {% block title %} {{ doc.name }} {% endblock %} {% block breadcrumbs %} -