[minor] cache refactor and workflow docs (#13598)

This commit is contained in:
Rushabh Mehta 2018-04-11 00:38:19 -08:00 committed by GitHub
parent ad76f9ad70
commit fb5d678b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -42,7 +42,19 @@ submit button / option if you have not specified it in the workflow.
> Note 4: If you wish to give the option to cancel, you will have to write a > Note 4: If you wish to give the option to cancel, you will have to write a
workflow transition step that says from submitted you can cancel. workflow transition step that says from submitted you can cancel.
#### Conditions
> New in Version 11
In Version 11, you can also add a condition for the transition to be applicable. For example in this case if someone applies to leave for more than 5 days, a particular role must approve. For this in the particular transition you can set a property for `Condition` as:
```
doc.total_leave_days <= 5
```
Then if someone applied for leave for less than 5 days, only that particular transition will apply.
This can be extended to any property of the document.
#### Example of a Leave Application Process: #### Example of a Leave Application Process:

View File

@ -7,7 +7,7 @@ from frappe import _
from frappe.utils import cint, today, formatdate from frappe.utils import cint, today, formatdate
import frappe.defaults import frappe.defaults
from frappe.cache_manager import clear_defaults_cache
from frappe.model.document import Document from frappe.model.document import Document
from frappe.contacts.address_and_contact import load_address_and_contact from frappe.contacts.address_and_contact import load_address_and_contact
@ -240,7 +240,7 @@ class Company(Document):
frappe.db.sql("""update `tabDefaultValue` set defvalue=%s frappe.db.sql("""update `tabDefaultValue` set defvalue=%s
where defkey='Company' and defvalue=%s""", (newdn, olddn)) where defkey='Company' and defvalue=%s""", (newdn, olddn))
frappe.defaults.clear_cache() clear_defaults_cache()
def abbreviate(self): def abbreviate(self):
self.abbr = ''.join([c[0].upper() for c in self.company_name.split()]) self.abbr = ''.join([c[0].upper() for c in self.company_name.split()])