630 lines
No EOL
14 KiB
HTML
630 lines
No EOL
14 KiB
HTML
<!-- title: Custom Field -->
|
|
|
|
|
|
|
|
|
|
|
|
<div class="dev-header">
|
|
|
|
<a class="btn btn-default btn-sm" disabled style="margin-bottom: 10px;">
|
|
Version 6.x.x</a>
|
|
|
|
|
|
<a class="btn btn-default btn-sm" href="https://github.com/frappe/frappe/tree/develop/frappe/custom/doctype/custom_field"
|
|
target="_blank" style="margin-left: 10px; margin-bottom: 10px;"><i class="octicon octicon-mark-github"></i> Source</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<p><b>Table Name:</b> <code>tabCustom Field</code></p>
|
|
|
|
|
|
Adds a custom field to a DocType
|
|
|
|
<h3>Fields</h3>
|
|
|
|
<table class="table table-bordered" style="table-layout: fixed;">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 5%">Sr</th>
|
|
<th style="width: 25%">Fieldname</th>
|
|
<th style="width: 20%">Type</th>
|
|
<th style="width: 25%">Label</th>
|
|
<th style="width: 25%">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr >
|
|
<td>1</td>
|
|
<td class="danger" title="Mandatory"><code>dt</code></td>
|
|
<td >
|
|
Link</td>
|
|
<td >
|
|
Document
|
|
|
|
</td>
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<a href="https://frappe.github.io/frappe/current/models/core/doctype">DocType</a>
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>2</td>
|
|
<td ><code>label</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Label
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>3</td>
|
|
<td ><code>label_help</code></td>
|
|
<td >
|
|
HTML</td>
|
|
<td >
|
|
Label Help
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>4</td>
|
|
<td ><code>insert_after</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Insert After
|
|
<p class="text-muted small">
|
|
Select the label after which you want to insert new field.</p>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>5</td>
|
|
<td class="danger" title="Mandatory"><code>fieldtype</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Field Type
|
|
|
|
</td>
|
|
<td>
|
|
<pre>Attach
|
|
Button
|
|
Check
|
|
Code
|
|
Column Break
|
|
Currency
|
|
Data
|
|
Date
|
|
Datetime
|
|
Dynamic Link
|
|
Float
|
|
HTML
|
|
Image
|
|
Int
|
|
Link
|
|
Long Text
|
|
Password
|
|
Percent
|
|
Read Only
|
|
Section Break
|
|
Select
|
|
Small Text
|
|
Table
|
|
Text
|
|
Text Editor
|
|
Time</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>6</td>
|
|
<td ><code>precision</code></td>
|
|
<td >
|
|
Select</td>
|
|
<td >
|
|
Precision
|
|
<p class="text-muted small">
|
|
Set non-standard precision for a Float or Currency field</p>
|
|
</td>
|
|
<td>
|
|
<pre>
|
|
1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9</pre>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>7</td>
|
|
<td ><code>collapsible</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Collapsible
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>8</td>
|
|
<td ><code>collapsible_depends_on</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Collapsible Depends On
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>9</td>
|
|
<td ><code>options_help</code></td>
|
|
<td >
|
|
HTML</td>
|
|
<td >
|
|
Options Help
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>10</td>
|
|
<td ><code>options</code></td>
|
|
<td >
|
|
Text</td>
|
|
<td >
|
|
Options
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>11</td>
|
|
<td ><code>description</code></td>
|
|
<td >
|
|
Text</td>
|
|
<td >
|
|
Field Description
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>12</td>
|
|
<td ><code>fieldname</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Fieldname
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>13</td>
|
|
<td ><code>properties</code></td>
|
|
<td class="info">
|
|
Column Break</td>
|
|
<td >
|
|
Properties
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>14</td>
|
|
<td ><code>permlevel</code></td>
|
|
<td >
|
|
Int</td>
|
|
<td >
|
|
Permission Level
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>15</td>
|
|
<td ><code>reqd</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Is Mandatory Field
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>16</td>
|
|
<td ><code>unique</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Unique
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>17</td>
|
|
<td ><code>read_only</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Read Only
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>18</td>
|
|
<td ><code>ignore_user_permissions</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Ignore User Permissions
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>19</td>
|
|
<td ><code>width</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td >
|
|
Width
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>20</td>
|
|
<td ><code>default</code></td>
|
|
<td >
|
|
Text</td>
|
|
<td >
|
|
Default Value
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>21</td>
|
|
<td ><code>hidden</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Hidden
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>22</td>
|
|
<td ><code>depends_on</code></td>
|
|
<td >
|
|
Small Text</td>
|
|
<td >
|
|
Depends On
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>23</td>
|
|
<td ><code>print_hide</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Print Hide
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>24</td>
|
|
<td ><code>print_hide_if_no_value</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Print Hide If No Value
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>25</td>
|
|
<td ><code>print_width</code></td>
|
|
<td >
|
|
Data</td>
|
|
<td class="text-muted" title="Hidden">
|
|
Print Width
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>26</td>
|
|
<td ><code>no_copy</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
No Copy
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>27</td>
|
|
<td ><code>allow_on_submit</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Allow on Submit
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>28</td>
|
|
<td ><code>in_filter</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
In Report Filter
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>29</td>
|
|
<td ><code>in_list_view</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
In List View
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>30</td>
|
|
<td ><code>report_hide</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td >
|
|
Report Hide
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr >
|
|
<td>31</td>
|
|
<td ><code>search_index</code></td>
|
|
<td >
|
|
Check</td>
|
|
<td class="text-muted" title="Hidden">
|
|
Index
|
|
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<hr>
|
|
<h3>Controller</h3>
|
|
<h4>frappe.custom.doctype.custom_field.custom_field</h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>CustomField</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.model.document.Document</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="autoname" href="#autoname" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>autoname</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="create_property_setter" href="#create_property_setter" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>create_property_setter</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_trash" href="#on_trash" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_trash</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_update" href="#on_update" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_update</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="set_fieldname" href="#set_fieldname" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>set_fieldname</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate" href="#validate" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.custom.doctype.custom_field.custom_field.create_custom_field" href="#frappe.custom.doctype.custom_field.custom_field.create_custom_field" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.custom.doctype.custom_field.custom_field.<b>create_custom_field</b>
|
|
<i class="text-muted">(doctype, df)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.custom.doctype.custom_field.custom_field.create_custom_field_if_values_exist" href="#frappe.custom.doctype.custom_field.custom_field.create_custom_field_if_values_exist" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.custom.doctype.custom_field.custom_field.<b>create_custom_field_if_values_exist</b>
|
|
<i class="text-muted">(doctype, df)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p><span class="label label-info">Public API</span>
|
|
<br><code>/api/method/frappe.custom.doctype.custom_field.custom_field.get_fields_label</code>
|
|
</p>
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.custom.doctype.custom_field.custom_field.get_fields_label" href="#frappe.custom.doctype.custom_field.custom_field.get_fields_label" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.custom.doctype.custom_field.custom_field.<b>get_fields_label</b>
|
|
<i class="text-muted">(doctype=None)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- autodoc -->
|
|
<!-- jinja -->
|
|
<!-- static --> |