Commit graph

44 commits

Author SHA1 Message Date
Ankush Menat
95f67b8de8
fix: ignore empty part in naming series (#17508)
on v13 doc.get("") returns entire doc dictionary, this gets strigified
and becomes a problem for naming.
2022-07-14 13:14:58 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
barredterra
ef3777badb test: refactor date naming test 2022-06-21 16:22:22 +02:00
vishdha
80de434984 chore: Test case added for datetime, date and time field 2022-06-17 20:07:14 +05:30
vishdha
754de9a56b fix: minor change added 2022-06-17 14:03:29 +05:30
vishdha
a9e222a706 chore: test case added for _auto_name format for date field 2022-06-17 13:59:21 +05:30
Ankush Menat
462aa20386
fix: naming using doc fields (#17040) 2022-05-31 19:55:34 +05:30
Ankush Menat
5590cb0be8 feat: NamingSeries class
Single class to group together everything required related to naming
series
2022-05-31 11:53:58 +05:30
Ankush Menat
5c35aae876 fix: accurate prefix parsing
Previous version of prefix parsing relied on partial reimplemntation of
naming series logic which was outdated and often incorrect.
2022-05-31 11:53:58 +05:30
Ankush Menat
ebcb568e9d test: making naming tests re-runnable
These were modifying TODO schema ._. WAD
2022-05-31 11:53:58 +05:30
Ankush Menat
a615c60be4 test: naming on child tables 2022-04-14 16:33:23 +05:30
Gavin D'souza
70a8a49c9c fix: new_doctype API testing util
Use kwargs instead of mapping defined kwargs to single actions
2022-04-12 19:06:35 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Ankush Menat
046f5d31af
fix: don't update autoname field when using Document.save (#16436) 2022-04-01 14:00:27 +05:30
phot0n
bebc8058b6 feat: integer primary keys 2022-03-11 23:46:00 +05:30
Rucha Mahabal
240665940f fix: remove redundant test record deletions and resetting 2022-02-09 11:01:05 +05:30
Rucha Mahabal
78e606bd0f
Merge branch 'develop' into fix-naming-validation 2022-02-09 10:52:24 +05:30
Mohammad Hasnain Mohsin Rajan
4ff86e1d63
revert: "refactor: set amended docname to original docname" (#15867)
* Revert: "refactor: set amended docname to original docname"

80d111baf2.

* test: test if amended doc has different name
2022-02-04 17:22:18 +05:30
Rucha Mahabal
62331fcba3 test: validation for no name specified 2022-01-31 13:49:37 +05:30
Rucha Mahabal
66c8fb9cfa fix: validate doc naming when set via prompt or by passing set_name 2022-01-27 12:24:22 +05:30
Daniel Gerhardt
16dca0b1c1 feat: add consecutive calendar week (WW) for naming series
The calendar week is based on ISO 8601 but behaves slightly different
for the first and last days of a year to ensure consecutiveness:

* If the first days of a year would be in week 53 then 00 is used
  instead.
* if the last days of a year would be in week 01 then 53 is used
  instead.

Closes #14413
2021-11-18 17:52:36 +01:00
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
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.
2021-09-03 12:02:59 +05:30
Gavin D'souza
c00a5003f4 refactor(tests): frappe.db.delete > frappe.db.sql
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql
;)

This commit focuses on the frappe.tests module
2021-08-19 19:48:42 +05:30
leela
80d111baf2 refactor: set amended docname to original docname
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.
2021-08-09 14:59:07 +05:30
leela
b719e1481d Revert "refactor: set amended docname to original docname"
This reverts commit d459847ae3.
2021-07-28 17:00:12 +05:30
leela
d459847ae3 refactor: set amended docname to original docname
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 changed all cancelled doc patterns to name-CAN-X,
so that amended docs can use the original name instead of name-X.
2021-07-21 10:51:32 +05:30
leela
f31d01a2a6 Revert "Merge pull request #13244 from prssanna/amended-doc-naming"
This reverts commit 58b95662c2, reversing
changes made to c553b7e23a.
2021-07-02 17:43:16 +05:30
Leela vadlamudi
4800ee8725
Merge branch 'develop' into amended-doc-naming 2021-07-02 10:47:47 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Prssanna Desai
081677c6c4 fix: typo in test 2021-05-17 17:13:51 +05:30
prssanna
209ece8b6c fix: delete test submittable doctype 2021-05-17 17:13:51 +05:30
prssanna
3614ca2a4d style: fix indent 2021-05-17 17:13:51 +05:30
prssanna
251f878009 test: test naming for cancelled and amended docs 2021-05-17 17:12:32 +05:30
shariquerik
e7552413b4 refactor: minor fix 2021-05-07 18:10:59 +05:30
shariquerik
f46c3b59a6 fix: sider fix 2021-05-06 17:26:54 +05:30
shariquerik
47d1f3d50a test: uncomment 2021-05-06 17:24:12 +05:30
shariquerik
bc08459ca7 test: Test case for revert series 2021-05-06 17:22:59 +05:30
Suraj Shetty
d3e4a97b6f
test: Make email account is email account test (#11139) 2020-07-29 17:17:53 +05:30
Himanshu Mishra
4da80bae91 fix: doctype passed but not used (#7112) 2019-03-28 11:57:15 +05:30
Suraj Shetty
d3722cdaee test: Add code to test build_match_conditions (#6704)
* Add code to test build match condition

* Fix typo

* Make quotes consistent

* Reorganize

* Fix test
- Add user permission for record created during test

* Reset session user as admin

* Fix a year dependent test
- Remove hardcoded year from test
2019-01-01 15:04:30 +05:30
Shreya
aca6dd0686 test: Add test case 2018-10-30 12:13:28 +05:30
Prateeksha Singh
eb5b7a77c9 [Feature] Format Autoname (#6017)
* [Feature] Format Autoname

- Generate autoname by replacing all instances of braced params
- Independent of remaining string or separators.
- Remove autoname Concatenate option

* [autoname] add test for format autoname
2018-09-03 10:58:56 +05:30
Achilles Rasquinha
abb7f14bbd self.assertEqual 2018-02-28 21:19:01 +05:30
Faris Ansari
aa7d93cfdb Generic Append number in naming (#4845)
* Generic append_number_if_name_exists

* Add test
2018-01-17 18:45:37 +05:30