Browse Source

[fixes] changed patches while migrating from v4 to v6

version-14
Rushabh Mehta 9 years ago
parent
commit
2e6b3ad356
17 changed files with 47 additions and 23 deletions
  1. +1
    -1
      frappe/config/docs.py
  2. +2
    -0
      frappe/docs/_config.yml
  3. +1
    -4
      frappe/docs/index.html
  4. +1
    -0
      frappe/docs/user/en/index.txt
  5. +3
    -0
      frappe/docs/user/en/tutorial/index.md
  6. +1
    -1
      frappe/docs/user/en/videos/index.md
  7. +1
    -0
      frappe/docs/user/fr/index.txt
  8. +2
    -2
      frappe/docs/user/fr/tutorial/web-views.md
  9. +1
    -1
      frappe/docs/user/fr/videos/index.md
  10. +6
    -0
      frappe/docs/user/index.md
  11. +2
    -0
      frappe/docs/user/index.txt
  12. +1
    -0
      frappe/patches.txt
  13. +3
    -0
      frappe/patches/v4_0/change_varchar_length.py
  14. +1
    -0
      frappe/patches/v5_0/update_shared.py
  15. +2
    -1
      frappe/patches/v6_11/rename_field_in_email_account.py
  16. +15
    -11
      frappe/patches/v6_19/comment_feed_communication.py
  17. +4
    -2
      frappe/website/doctype/web_page/web_page.py

+ 1
- 1
frappe/config/docs.py View File

@@ -20,7 +20,7 @@ to ERPNext.
Frappe Framework was designed to build [ERPNext](https://erpnext.com), open source
ERP for managing small and medium sized businesses.

[Get started with the Tutorial](https://frappe.github.io/frappe/user/tutorial)
[Get started with the Tutorial](https://frappe.github.io/frappe/user/)
"""
docs_version = "6.x.x"



+ 2
- 0
frappe/docs/_config.yml View File

@@ -0,0 +1,2 @@
gems:
- jekyll-redirect-from

+ 1
- 4
frappe/docs/index.html View File

@@ -44,10 +44,7 @@ to ERPNext.</p>
<p>Frappe Framework was designed to build <a href="https://erpnext.com">ERPNext</a>, open source
ERP for managing small and medium sized businesses.</p>

<p>
<a href="https://frappe.github.io/frappe/user/en/tutorial">Get started with the Tutorial</a>
<a href="https://frappe.github.io/frappe/user/fr/tutorial">Débuter le tutoriel</a>
</p>
<p><a href="https://frappe.github.io/frappe/user/tutorial">Get started with the Tutorial</a></p>

</div>
</div>


+ 1
- 0
frappe/docs/user/en/index.txt View File

@@ -1,2 +1,3 @@
tutorial
guides
videos

+ 3
- 0
frappe/docs/user/en/tutorial/index.md View File

@@ -1,3 +1,6 @@
---
redirect_from: "/user/tutorial"
---
# Frappe Tutorial

In this guide we will show you how to create an application from scratch using **Frappe**. Using the example of a Library Management System, we will cover:


+ 1
- 1
frappe/docs/user/en/videos/index.md View File

@@ -2,7 +2,7 @@

This 10-part video tutorial will teach you how to build complex apps in Frappe

Pre-requisites: <a href="{{ docs_base_url }}/user/tutorial/before.html" target="_blank">You must have some understanding of Python, Javascript and MySQL before you start this tutorial.</a>
Pre-requisites: <a href="{{ docs_base_url }}/user/en/tutorial/before.html" target="_blank">You must have some understanding of Python, Javascript and MySQL before you start this tutorial.</a>

---



+ 1
- 0
frappe/docs/user/fr/index.txt View File

@@ -1,2 +1,3 @@
tutorial
guides
videos

+ 2
- 2
frappe/docs/user/fr/tutorial/web-views.md View File

@@ -29,7 +29,7 @@ Cliquez sur un article et vous devriez voir une vue par défaut.
Maintenant, si vous voulez une meilleur liste pour vos articles, créez un fichier appelé `list_item.html` dans le
repertoire `library_management/doctype/article`. Voici un exemple du contenu de ce fichier:

<div class="row">
{% raw %}<div class="row">
<div class="col-sm-4">
<a href="/Article/{{ doc.name }}">
<img src="{{ doc.image }}"
@@ -43,7 +43,7 @@ repertoire `library_management/doctype/article`. Voici un exemple du contenu de
if doc.description|length > 200 else doc.description }}</p>
<p class="text-muted">Publisher: {{ doc.publisher }}</p>
</div>
</div>
</div>{% endraw %}


Ici, vous aurez toutes les propriétés d'un article dans l'object `doc`.


+ 1
- 1
frappe/docs/user/fr/videos/index.md View File

@@ -2,7 +2,7 @@

This 10-part video tutorial will teach you how to build complex apps in Frappe

Pre-requisites: <a href="{{ docs_base_url }}/user/tutorial/before.html" target="_blank">You must have some understanding of Python, Javascript and MySQL before you start this tutorial.</a>
Pre-requisites: <a href="{{ docs_base_url }}/user/fr/tutorial/before.html" target="_blank">You must have some understanding of Python, Javascript and MySQL before you start this tutorial.</a>

---



+ 6
- 0
frappe/docs/user/index.md View File

@@ -0,0 +1,6 @@
# Frappe Developer Tutorial

Select your language

1. [English](en)
1. [Français](fr)

+ 2
- 0
frappe/docs/user/index.txt View File

@@ -0,0 +1,2 @@
en
fr

+ 1
- 0
frappe/patches.txt View File

@@ -15,6 +15,7 @@ execute:frappe.reload_doc('custom', 'doctype', 'property_setter') #2014-12-31-1
execute:frappe.reload_doc('core', 'doctype', 'patch_log') #2016-10-31
execute:frappe.reload_doctype("File") # 2015-10-19
execute:frappe.reload_doc('core', 'doctype', 'error_snapshot')

execute:frappe.db.sql("alter table `tabSessions` modify `user` varchar(255), engine=InnoDB")
execute:frappe.db.sql("delete from `tabDocField` where parent='0'")
frappe.patches.v4_0.change_varchar_length


+ 3
- 0
frappe/patches/v4_0/change_varchar_length.py View File

@@ -5,6 +5,9 @@ from __future__ import unicode_literals
import frappe

def execute():
frappe.db.sql('update tabDocField set search_index=0 where fieldtype="Small Text"')
frappe.db.sql('update tabDocField set in_list_view=0 where fieldtype="Image"')

for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=0"""):
desc = dict((d["Field"], d) for d in frappe.db.sql("desc `tab{}`".format(dt), as_dict=True))
alter_table = []


+ 1
- 0
frappe/patches/v5_0/update_shared.py View File

@@ -4,6 +4,7 @@ import frappe.share
def execute():
frappe.reload_doc("core", "doctype", "docperm")
frappe.reload_doc("core", "doctype", "docshare")
frappe.reload_doc('email', 'doctype', 'email_account')

# default share to all writes
frappe.db.sql("""update tabDocPerm set `share`=1 where ifnull(`write`,0)=1 and ifnull(`permlevel`,0)=0""")


+ 2
- 1
frappe/patches/v6_11/rename_field_in_email_account.py View File

@@ -2,4 +2,5 @@ import frappe

def execute():
frappe.reload_doc("email", "doctype", "email_account")
frappe.db.sql("update `tabEmail Account` set email_server = pop3_server")
if frappe.db.has_column('Email Account', 'pop3_server'):
frappe.db.sql("update `tabEmail Account` set email_server = pop3_server")

+ 15
- 11
frappe/patches/v6_19/comment_feed_communication.py View File

@@ -20,6 +20,13 @@ def execute():
update_timeline_doc_for("Blogger")

def migrate_comments():
from_fields = ""
to_fields = ""

if "reference_doctype" in frappe.db.get_table_columns("Comment"):
from_fields = "reference_doctype as link_doctype, reference_name as link_name,"
to_fields = "link_doctype, link_name,"

# comments
frappe.db.sql("""insert ignore into `tabCommunication` (
subject,
@@ -30,8 +37,7 @@ def migrate_comments():
communication_date,
reference_doctype,
reference_name,
link_doctype,
link_name,
{to_fields}

name,
user,
@@ -53,8 +59,7 @@ def migrate_comments():
ifnull(timestamp(comment_date, comment_time), creation) as communication_date,
comment_doctype as reference_doctype,
comment_docname as reference_name,
reference_doctype as link_doctype,
reference_name as link_name,
{from_fields}

name,
owner as user,
@@ -66,7 +71,8 @@ def migrate_comments():
'Sent' as sent_or_received,
'Comment' as communication_type,
1 as seen
from `tabComment` where comment_doctype is not null and comment_doctype not in ('Message', 'My Company')""")
from `tabComment` where comment_doctype is not null and comment_doctype not in ('Message', 'My Company')"""
.format(to_fields=to_fields, from_fields=from_fields))

# chat and assignment notifications
frappe.db.sql("""insert ignore into `tabCommunication` (
@@ -78,8 +84,7 @@ def migrate_comments():
communication_date,
reference_doctype,
reference_name,
link_doctype,
link_name,
{to_fields}

name,
user,
@@ -105,8 +110,7 @@ def migrate_comments():
ifnull(timestamp(comment_date, comment_time), creation) as communication_date,
'User' as reference_doctype,
comment_docname as reference_name,
reference_doctype as link_doctype,
reference_name as link_name,
{from_fields}

name,
owner as user,
@@ -122,7 +126,8 @@ def migrate_comments():
end
as communication_type,
1 as seen
from `tabComment` where comment_doctype in ('Message', 'My Company')""", {"assignment": _("Assignment")})
from `tabComment` where comment_doctype in ('Message', 'My Company')"""
.format(to_fields=to_fields, from_fields=from_fields), {"assignment": _("Assignment")})

def migrate_feed():
# migrate delete feed
@@ -296,4 +301,3 @@ def is_valid_timeline_doctype(reference_doctype, timeline_doctype):


return True


+ 4
- 2
frappe/website/doctype/web_page/web_page.py View File

@@ -52,8 +52,10 @@ class WebPage(WebsiteGenerator):
# render dynamic context (if .py file exists)

# get absolute template path considering first fragment as app name
split_path = self.template_path.split(os.sep)
self.template_path = os.path.join(frappe.get_app_path(split_path[0]), *split_path[1:])
if not self.template_path.startswith(os.sep):
split_path = self.template_path.split(os.sep)

self.template_path = os.path.join(frappe.get_app_path(split_path[0]), *split_path[1:])

context = self.get_dynamic_context(frappe._dict(context))



Loading…
Cancel
Save