Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Unify BaseDocument and Document #5

Closed
wants to merge 682 commits into from

Conversation

Abdeali099
Copy link
Member

WORK

  1. Removed BaseDocument from base_document.py

  2. Removed Inheritance of BaseDocument from Document

- class Document(BaseDocument):
+ class Document: 
  1. Added all methods of BaseDocument into Document

  2. Rename BaseDocument's __init__() to base_initialization()

changed 3 call :

https://github.com/frappe/frappe/blob/cd885006f07eddb91bbc9091815626f690ae867a/frappe/model/document.py#L187
https://github.com/frappe/frappe/blob/cd885006f07eddb91bbc9091815626f690ae867a/frappe/model/document.py#L209
https://github.com/frappe/frappe/blob/cd885006f07eddb91bbc9091815626f690ae867a/frappe/model/document.py#L228

  1. Moved some attributes and method to document.py from base_document.py

  2. Give alias for compatibility to BaseDocument import in other file as :

from frappe.model.document import Document as BaseDocument

closes : frappe#16811

mergify bot and others added 30 commits December 26, 2023 14:29
…when the type name includes multiple spaces (frappe#23940)

(cherry picked from commit 854cebd)
…fix/pr-23908

fix(translations): Add context to Image Cropper text (backport frappe#23908)
To check if it is the reason for test are failing frequently
# [15.7.0](frappe/frappe@v15.6.1...v15.7.0) (2023-12-27)

### Bug Fixes

* allow aspect ratio options to crop from sidebar image field ([57c7723](frappe@57c7723))
* Allow periodically clearing deleted documents ([c371840](frappe@c371840))
* **document:** Pass parent_doc and parentfield in _set_defaults ([frappe#23939](frappe#23939)) ([0f054f2](frappe@0f054f2))
* don't allow deleting original doc if amendment exists (backport [frappe#23874](frappe#23874)) ([frappe#23880](frappe#23880)) ([21b5292](frappe@21b5292))
* ignore and gracefully handle img optimization failure ([08c9d75](frappe@08c9d75))
* optimize clear_permissions_cache method ([frappe#23858](frappe#23858)) ([frappe#23885](frappe#23885)) ([eede38e](frappe@eede38e))
* render new doctype dialog box if doctype is not copied ([frappe#23854](frappe#23854)) ([37019a3](frappe@37019a3))
* **sentry:** `name` field is ignored ([a789164](frappe@a789164))
* skip virtual fields in perm level checks during DB Query ([d907ed7](frappe@d907ed7))
* **test_customize_form:** drop checking of `flags.update_db` ([8edf476](frappe@8edf476))
* **translations:** Add context to Image Cropper text ([frappe#23908](frappe#23908)) ([3a276c5](frappe@3a276c5))
* Treat Document Links entries as all non-std fields ([9823ae2](frappe@9823ae2))

### Features

* **Newsletter:** redirect to welcome URL ([adcb31d](frappe@adcb31d))
* **sentry:** drop events which have `frappe.throw` ([frappe#23886](frappe#23886)) ([frappe#23887](frappe#23887)) ([8420baf](frappe@8420baf))

### Reverts

* Revert "fix: check the correct email account" ([e5f385d](frappe@e5f385d))
…fix/pr-23964

fix: show relative path in loaded JS (backport frappe#23964)
…ppe#23969)

only try to find parent_element_selector if element exists

(cherry picked from commit fe90696)

Co-authored-by: Maharshi Patel <[email protected]>
removed `.collapse.show` class as it is removed during opening animation of menu.

(cherry picked from commit 547523c)

Co-authored-by: Maharshi Patel <[email protected]>
* fix: numbercard layout

(cherry picked from commit 7464b91)

* fix: shortcut-widget-box should have flex-start

As we changed align-items to space-between for widget head,
we need to override .shortcut-widget-box to flex-start

(cherry picked from commit 39136b0)

---------

Co-authored-by: fadilsid <[email protected]>
Co-authored-by: Maharshi Patel <[email protected]>
If link field has no value then its title will always be undefined.

(cherry picked from commit 6367194)

Co-authored-by: Ankush Menat <[email protected]>
(cherry picked from commit 32469b5)

Co-authored-by: Jannat Patel <[email protected]>
…fix/pr-23940

fix: Solve the problem that the document editor will report an error … (backport frappe#23940)
)

We set defaults on creation of new doc but when you append a new child
doc on existing document it doesn't seem to set the defaults.

This seems like a bug and not a deliberate choice.

(cherry picked from commit 4d68a46)

Co-authored-by: Ankush Menat <[email protected]>
) (frappe#23990)

* fix: strip exc from json response if traceback not allowed

* fix: use pop instead of del to avoid key error

* fix: Avoid showing exc when traceback is disabled

---------

Co-authored-by: Ankush Menat <[email protected]>
(cherry picked from commit 37803a0)

Co-authored-by: Revant Nandgaonkar <[email protected]>
…MLCollection in some environments, which leads to the failure of camera-related functions. (frappe#23988)

(cherry picked from commit c599093)

Co-authored-by: Fierflame <[email protected]>
… (frappe#23993)

* Add timezone for palestinian territory country. It's blocking the first start wizard from completion.

* add currency and additional timezone for Palestine

[skip ci]

(cherry picked from commit 8583c01)

Co-authored-by: Anas AlGhanem <[email protected]>
* feat: sort multicheck by label

* fix: avoid double translation

* fix: always cast to string before comparing

---------

Co-authored-by: Ankush Menat <[email protected]>
(cherry picked from commit 3527489)
…fix/pr-23985

feat: sort multicheck by label (backport frappe#23985)
…fix/pr-23975

fix(Data Import): show failed import logs (backport frappe#23975)
* Update country_info.json

Update Sudan Currency

* chore: fix currency symbol

---------

Co-authored-by: Ankush Menat <[email protected]>

[skip ci]
…rappe#23759 &  frappe#23143 ) (frappe#23778)

* fix(float): input formatting

* fix: remove delay from numeric field selection (frappe#23759)

(cherry picked from commit 119a4bd)

---------

Co-authored-by: David Arnold <[email protected]>
Co-authored-by: Ankush Menat <[email protected]>
…#24003)

* fix: Solve the problem that the filter conditions are regarded as the same when the filter values are equivalent arrays in the filter

(cherry picked from commit 3ee00cf)

* refactor: simplify duplicate filter checking code

keeping track of `exists` variable is weird to read and prone to bugs...
what if next field makes exist = false, even if one filter already
exists?

(cherry picked from commit acf032f)

---------

Co-authored-by: Fierflame <[email protected]>
Co-authored-by: Ankush Menat <[email protected]>
…fix/pr-24005

fix(minor): spacing for sidebar item with child items (backport frappe#24005)
Co-authored-by: Aditya Hase <[email protected]>
Signed-off-by: Akhil Narang <[email protected]>
(cherry picked from commit 067104c)
mergify bot and others added 24 commits January 27, 2024 10:06
(cherry picked from commit 9fa409e)

Co-authored-by: barredterra <[email protected]>
(cherry picked from commit 7651b51)

Co-authored-by: Corentin Flr <[email protected]>
…intain order

Signed-off-by: Akhil Narang <[email protected]>
(cherry picked from commit b2002e6)
…fix/pr-24575

fix(grid_row): sort options based on selected data first, so as to maintain order (backport frappe#24575)
…fix/pr-24555

fix(mobile): scroll issue after workspace change (backport frappe#24555)
…fix/pr-24584

revert: added back quick list status indicator (backport frappe#24584)
…fix/pr-24588

fix: typeerror in event.js (backport frappe#24588)
…box"

This reverts commit 34f03a2.

(cherry picked from commit ba64285)
Signed-off-by: Akhil Narang <[email protected]>
(cherry picked from commit db1e692)
…fix/pr-24616

fix: show successful rows in the import log (backport frappe#24616)
# [15.12.0](frappe/frappe@v15.11.0...v15.12.0) (2024-01-30)

### Bug Fixes

* **Custom Field:** default fieldname in rename fieldname prompt ([frappe#24492](frappe#24492)) ([frappe#24512](frappe#24512)) ([b7e4a99](frappe@b7e4a99))
* Duplicate columns while configuring columns in New Print Format Builder ([frappe#24520](frappe#24520)) ([4595192](frappe@4595192))
* error when configuring child table columns in New Print Format Builder ([frappe#24514](frappe#24514)) ([5e9b68c](frappe@5e9b68c))
* **grid_row:** sort options based on selected data first, so as to maintain order ([7768444](frappe@7768444))
* ignore dead columns in user_settings ([frappe#24572](frappe#24572)) ([frappe#24574](frappe#24574)) ([2f82b11](frappe@2f82b11))
* improve translatability of search results ([frappe#24499](frappe#24499)) ([0ca8534](frappe@0ca8534))
* **meta:** Allow level 0 fields if a doc has been shared with user backport [frappe#23904](frappe#23904) ([frappe#24595](frappe#24595)) ([88b4455](frappe@88b4455))
* Missing traduction in the query popup ([d1196cb](frappe@d1196cb))
* **mobile:** scroll issue after workspace change ([frappe#24555](frappe#24555)) ([1facad9](frappe@1facad9))
* Return empty result if no perm level access ([frappe#24591](frappe#24591)) ([frappe#24593](frappe#24593)) ([289a1c3](frappe@289a1c3))
* **search:** Fix URL encoding for search result ([frappe#24559](frappe#24559)) ([c54d3d1](frappe@c54d3d1))
* sentry minor fix ([frappe#24588](frappe#24588)) ([1678601](frappe@1678601))
* set same cookie expiry as client side ([frappe#24560](frappe#24560)) ([frappe#24568](frappe#24568)) ([ffd68e7](frappe@ffd68e7))
* translatability ([frappe#24554](frappe#24554)) ([b6ca0e9](frappe@b6ca0e9))
* update all users after commit ([frappe#24522](frappe#24522)) ([frappe#24523](frappe#24523)) ([21eb062](frappe@21eb062))

### Features

* Configurable search link limit ([frappe#24539](frappe#24539)) ([frappe#24540](frappe#24540)) ([02b8281](frappe@02b8281))
* permission inspector (backport [frappe#24239](frappe#24239)) ([frappe#24541](frappe#24541)) ([cda63fb](frappe@cda63fb))
* show doctype description in list views ([frappe#24583](frappe#24583)) ([frappe#24603](frappe#24603)) ([279c3c0](frappe@279c3c0))

### Reverts

* Revert "fix(data_import): respect the value of show_failed_logs checkbox" ([f3d89d4](frappe@f3d89d4))
* added back quick list status indicator ([178580a](frappe@178580a))
@Abdeali099 Abdeali099 force-pushed the Unify-BaseDocument-and-Document branch from cd88500 to c469abd Compare February 13, 2024 13:12
@Abdeali099 Abdeali099 closed this Feb 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify BaseDocument and Document