Browse Source

[fix] [hot] copy_doc docstatus

version-14
Anand Doshi 9 years ago
parent
commit
38374dceca
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      frappe/__init__.py

+ 6
- 3
frappe/__init__.py View File

@@ -48,9 +48,9 @@ def _(msg, lang=None):

# msg should always be unicode
msg = cstr(msg)
return get_full_dict(local.lang).get(msg) or msg
def get_lang_dict(fortype, name=None):
"""Returns the translated language dict for the given type and name.

@@ -836,7 +836,10 @@ def copy_doc(doc, ignore_no_copy=True):
if hasattr(d, df.fieldname):
d.set(df.fieldname, None)

fields_to_clear = ['name', 'owner', 'creation', 'modified', 'modified_by', 'docstatus']
fields_to_clear = ['name', 'owner', 'creation', 'modified', 'modified_by']

if not frappe.local.flags.in_test:
fields_to_clear.append("docstatus")

if not isinstance(doc, dict):
d = doc.as_dict()


Loading…
Cancel
Save