* fix: make automatically following documents optional
* fix: optimize email triggers for document followed
* test: add tests for document follow settings
* test: sync global search before testing
* fix: extend pypika's cast function to mimic varchar cast in MariaDB
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: phot0n <ritwikpuri5678@gmail.com>
* feat: utility methods for docstatus
* refactor: use utility method for doctsatus
* refactor: enum for docstatus
* refactor: docstatus as property
* fix: set docstatus
* feat: docstatus extends int class
* test: docstatus of BaseDocument
* refactor: occurrences of docstatus
* fix: typo
* refactor: move docstatus to a separate file
* test: docstatus
* fix: sider
problem: if a whitelisted document method returns a falsy value like
`[]`, `{}`, `0` then response.message is not set and not returned
in the response.
this change checks if the return value is `None` and falsy values
are returned properly in the response
* [fix] Clarified docstatus transition exceptions
Exceptions issued by the document.py `check_docstatus_transition` method are potentially very misleading. In cases where an invalid docstatus is used, users receive an confusing exception stating "Cannot change docstatus from 0 to 2" or "Cannot change docstatus from 1 to 0".
This PR adds an additional exception message when an invalid docstatus is used.
* fix: Clarified docstatus transition exceptions
Added additional clarifications to exception messages
`Document.save` returns self but `submit` and `cancel` don't.
change:
For sake of consistency and better support for `run_method` via REST API, return the document.
ref: https://github.com/frappe/frappe/issues/14869
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql ;)
This commit focuses on the pending modules that had relatively easier
DELETE statements.
Currently, whenever a document is amended it's name is set
to name-X(X is a counter) when amended again and so on. In this PR,
we have postfixed all cancelled document names with '-CAN' and new
cancelled documents gets a name as original_name-CANC-X.
so that amended docs can use the original name instead of name-X.