seitime-frappe/frappe/model
Zhixuan Lai 2d416098c2
fix: link validation fetch from virtual doc (#20055)
Problem: 
document.save() throws "Object is not scriptable exception" when fetching values from virtual doc.

Root cause:
```python
        # ....
        if frappe.get_meta(doctype).get("is_virtual"):
	    values = frappe.get_doc(doctype, docname) <--- Document is not scriptable.
.as_dict()
        # ....

	def set_fetch_from_value(self, doctype, df, values):
		fetch_from_fieldname = df.fetch_from.split(".")[-1]
		value = values[fetch_from_fieldname] <--- Tries to access value by key and throws "Object is not scriptable" exception
```

Solution:
```python
        if frappe.get_meta(doctype).get("is_virtual"):
	    values = frappe.get_doc(doctype, docname).as_dict() <--- Makes the document scriptable.
```
2023-02-16 18:15:40 +05:30
..
utils fix: handle missing is_virtual column via is_virtual_doctype 2023-01-31 15:31:24 +05:30
__init__.py fix: Add DefaultValue to core_doctypes_list 2023-02-06 12:45:02 +05:30
base_document.py fix: link validation fetch from virtual doc (#20055) 2023-02-16 18:15:40 +05:30
create_new.py refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
db_query.py fix: Do not filter columns like "_assign" & "_user_tags" 2023-02-14 14:00:42 +05:30
delete_doc.py refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
docfield.py chore!: dead code (#19551) 2023-01-10 18:53:08 +05:30
docstatus.py feat: utility methods for docstatus (#15515) 2022-02-04 07:41:25 +00:00
document.py fix: Check if attr exists before checking permlevel 2023-01-24 12:17:57 +05:30
dynamic_links.py style: format all python files using black (#16453) 2022-04-12 10:59:25 +05:30
mapper.py refactor: clean up code to py310 supported features (#17367) 2022-07-01 11:51:05 +05:30
meta.py Merge pull request #19916 from gavindsouza/distinct-get_count 2023-02-14 11:56:22 +05:30
naming.py fix: Migration fails while inserting docfield 2023-02-03 13:28:59 +05:30
rename_doc.py fix: Consider parenttype when renaming (#19901) 2023-02-02 17:05:44 +05:30
sync.py fix: remove ad-hoc maintenance mode implementation 2022-09-09 17:34:46 +05:30
virtual_doctype.py fix(DX): validate virtual doctype controllers 2022-12-13 14:18:19 +05:30
workflow.py perf(workflow): get_transitions (#18834) 2022-11-10 16:22:28 +05:30