added fields to asset and new doctype for assets

This commit is contained in:
Ali 2025-09-02 20:44:47 +04:00
parent 5f77a084cc
commit 914ce3ae3a
7 changed files with 378 additions and 5 deletions

View File

@ -159,14 +159,14 @@ def create_custom_fields():
insert_after='section_break_42', insert_after='section_break_42',
depends_on='eval:doc.company_main_activity && ["92000", "9200003", "9200004", "9200001", "9200002", "9200005"].includes(doc.company_main_activity)', depends_on='eval:doc.company_main_activity && ["92000", "9200003", "9200004", "9200001", "9200002", "9200005"].includes(doc.company_main_activity)',
options=""" options="""
<div style="display: flex; gap: 20px; margin: 8px 0;"> <div style="display: flex; gap: 50px; margin: 8px 0;">
<label style="display: flex; align-items: center; gap: 5px;"> <label style="display: flex; align-items: center; gap: 8px;">
<input type="checkbox" class="won-checkbox" checked style="margin: 0;"> <input type="checkbox" class="won-checkbox" checked style="margin: 0;">
<span>Won</span> <span style="font-weight: 500;">Won</span>
</label> </label>
<label style="display: flex; align-items: center; gap: 5px;"> <label style="display: flex; align-items: center; gap: 8px;">
<input type="checkbox" class="lost-checkbox" style="margin: 0;"> <input type="checkbox" class="lost-checkbox" style="margin: 0;">
<span>Lost</span> <span style="font-weight: 500;">Lost</span>
</label> </label>
</div> </div>
""" """
@ -292,6 +292,104 @@ def create_custom_fields():
columns=2 columns=2
) )
], ],
"Asset": [
# Asset Type field
dict(
fieldname='asset_type',
label='Asset Type',
fieldtype='Select',
options='Kənd təsərrüfatı təyinatlı torpaq sahələri\nSənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri',
insert_after='asset_name'
),
# Land Information Section (only for agricultural land)
dict(
fieldname='land_information_section',
label='Land Information',
fieldtype='Section Break',
insert_after='asset_type',
depends_on='eval:doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri"',
collapsible=1
),
# Purpose field
dict(
fieldname='purpose',
label='Purpose',
fieldtype='Select',
options='Təyinatı üzrə istifadə edilməyən kənd təsərrüfatı torpaqları üzrə hesablanmış vergi məbləği\n Təyinatı üzrə istifadə edilən və ya irriqasiya, meliorasiya və digər aqrotexniki səbəblərdən təyinatı üzrə istifadə edilməsi mümkün olmayan kənd təsərrüfatı torpaqları üzrə verginin məbləği',
insert_after='land_information_section',
depends_on='eval:doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri"'
),
# Cadastral valuation district
dict(
fieldname='cadastral_valuation_district',
label='Name of the cadastral valuation district where the land plot is located',
fieldtype='Link',
options='Cadastral Valuation District',
insert_after='purpose',
depends_on='eval:doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri"'
),
# Quality groups
dict(
fieldname='quality_groups',
label='Quality groups',
fieldtype='Select',
options='I\nII\nIII\nIV\nV',
insert_after='cadastral_valuation_district',
depends_on='eval:doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri"'
),
# Purpose of the land plot
dict(
fieldname='purpose_of_land_plot',
label='Purpose of the land plot',
fieldtype='Select',
options='Əkin, dinc və çoxillik əkmələr\nBiçənək, örüş və otlaqlar',
insert_after='quality_groups',
depends_on='eval:doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri"'
),
# Industrial Land Information Section (only for industrial land)
dict(
fieldname='industrial_land_information_section',
label='Industrial Land Information',
fieldtype='Section Break',
insert_after='purpose_of_land_plot',
depends_on='eval:doc.asset_type == "Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri"',
collapsible=1
),
# Name of the territorial unit for industrial land
dict(
fieldname='territorial_unit_industrial',
label='Name of the territorial unit where the land plot is located',
fieldtype='Select',
options='Bakı\nGəncə, Sumqayıt, Xırdalan, Abşeron\nDigər şəhərlər (rayon tabeliyində olan şəhərlər istisna olmaqla), Rayon mərkəzləri\nRayon tabeçiliyində olan şəhərlərdə, qəsəbələrdə və kəndlərdə (Bakı və Sumqayıt şəhərlərinin qəsəbə və kəndləri istisna olmaqla)',
insert_after='industrial_land_information_section',
depends_on='eval:doc.asset_type == "Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri"'
),
# Purpose of the land plot for industrial land
dict(
fieldname='purpose_of_land_plot_industrial',
label='Purpose of the land plot',
fieldtype='Select',
options='Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xid-ti və dig. xüs. təy-tlı sahələr\nYaşayış fondları, həyətyanı və bağsahələri üzrə sahələr',
insert_after='territorial_unit_industrial',
depends_on='eval:doc.asset_type == "Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri"'
),
# Note on mining
dict(
fieldname='note_on_mining',
label='Note on mining',
fieldtype='Check',
insert_after='purpose_of_land_plot_industrial',
depends_on='eval:doc.asset_type == "Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri"'
),
# Tax-exempt area (shared field for both asset types)
dict(
fieldname='tax_exempt_area',
label='Tax-exempt area',
fieldtype='Data',
insert_after='note_on_mining',
depends_on='eval:doc.asset_type && (doc.asset_type == "Kənd təsərrüfatı təyinatlı torpaq sahələri" || doc.asset_type == "Sənaye, tikinti, nəqliyyat, rabitə, ticarət-məişət xidməti və digər xüsusi təyinatlı torpaq sahələri")'
)
],
"Item": [ "Item": [
# Product Group Code field in Details tab # Product Group Code field in Details tab
dict( dict(

View File

@ -0,0 +1,178 @@
[
{
"cadastr_name": "Abşeron—Qobustan",
"description": "Abşeron rayonu, Hacıqabul rayonunun Nəvahi-Atbulaq massivi, Siyəzən və Xızı rayonlarının düzən torpaqları, habelə Bakı və Sumqayıt şəhərlərinin mövcud hüdudundan kənarda olan kənd təsərrüfatı təyinatlı torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Abşeron—Qobustan"
},
{
"cadastr_name": "Şabran—Xaçmaz",
"description": "Xaçmaz rayonu, Şabran, Quba, Qusar və Siyəzən rayonlarının düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Şabran—Xaçmaz"
},
{
"cadastr_name": "Qanıx—Türyançay",
"description": "Balakən, Qax, Zaqatala, Şəki, Oğuz və Qəbələ rayonlarının düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Qanıx—Türyançay"
},
{
"cadastr_name": "Şəki-Zaqatala",
"description": "Balakən, Qax, Zaqatala, Şəki, Oğuz və Qəbələ rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Şəki-Zaqatala"
},
{
"cadastr_name": "Qusar—Qonaqkənd",
"description": "Qusar, Quba, Şabran, Siyəzən və Xızı rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Qusar—Qonaqkənd"
},
{
"cadastr_name": "Xınalıq—Xaltan",
"description": "Qusar və Quba rayonlarının orta və yüksək dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Xınalıq—Xaltan"
},
{
"cadastr_name": "Dağ—Şirvan",
"description": "Şamaxı, İsmayıllı rayonları, Ağsu və Göyçay rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Dağ—Şirvan"
},
{
"cadastr_name": "Qobustan—Xilmilli",
"description": "Qobustan rayonunun dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Qobustan—Xilmilli"
},
{
"cadastr_name": "Gəncə—Qazax",
"description": "Samux rayonu, Goranboy, Göygöl, Tovuz, Ağstafa, Şəmkir və Qazax rayonlarının düzən torpaqları, habelə Gəncə və Naftalan şəhərlərinin mövcud hüdudundan kənarda olan kənd təsərrüfatı təyinatlı torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Gəncə—Qazax"
},
{
"cadastr_name": "Mil—Qarabağ",
"description": "Bərdə, Ağcəbədi, Beyləqan, Tərtər rayonları, Ağdam, keçmiş Ağdərə rayonunun ərazisi və Xocavəndin düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Mil—Qarabağ"
},
{
"cadastr_name": "Arazboyu",
"description": "Füzuli, Zəngilan və Cəbrayıl rayonlarının düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Arazboyu"
},
{
"cadastr_name": "Daşkəsən—Gədəbəy",
"description": "Gədəbəy, Daşkəsən rayonları, Goranboy, Göygöl, Şəmkir, Tovuz, Ağstafa və Qazax rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Daşkəsən—Gədəbəy"
},
{
"cadastr_name": "Laçın—Qubadlı",
"description": "Kəlbəcər, Laçın, Qubadlı rayonları və Zəngilan rayonunun dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Laçın—Qubadlı"
},
{
"cadastr_name": "Dağ—Qarabağ",
"description": "Şuşa, Xocalı rayonları, Xocavənd, keçmiş Ağdərə rayonunun ərazisi, habelə Ağdam, Füzuli, Cəbrayıl rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Dağ—Qarabağ"
},
{
"cadastr_name": "Muğan-Salyan",
"description": "Salyan, Saatlı, Sabirabad, İmişli, Neftçala və Biləsuvar rayonları, Hacıqabulun Kürqırağı düzən hissəsi, habelə Şirvan şəhərinin mövcud hüdudundan kənarda olan kənd təsərrüfatı təyinatlı torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Muğan-Salyan"
},
{
"cadastr_name": "Aran—Şirvan",
"description": "Kürdəmir, Zərdab, Ucar, Yevlax, Ağdaş rayonları, Ağsu, Göyçay rayonlarının düzən torpaqları və Mingəçevir şəhərinin mövcud hüdudundan kənarda olan kənd təsərrüfatı təyinatlı torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Aran—Şirvan"
},
{
"cadastr_name": "Lənkəran—Astara",
"description": "Lənkəran, Masallı və Astara rayonlarının düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Lənkəran—Astara"
},
{
"cadastr_name": "Cəlilabad",
"description": "Cəlilabad rayonunun düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Cəlilabad"
},
{
"cadastr_name": "Üçtəpə—Təzəkənd",
"description": "Cəlilabad rayonunun dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Üçtəpə—Təzəkənd"
},
{
"cadastr_name": "Lerik— Yardımlı",
"description": "Lerik, Yardımlı rayonları, Masallı, Lənkəran və Astara rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Lerik— Yardımlı"
},
{
"cadastr_name": "Şərur—Ordubad",
"description": "Şərur, Sədərək, Babək, Ordubad və Culfa rayonlarının düzən torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Şərur—Ordubad"
},
{
"cadastr_name": "Şahbuz—Paraqaçay",
"description": "Şahbuz rayonu, Şərur, Sədərək, Babək, Ordubad, Culfa rayonlarının dağ torpaqları",
"docstatus": 0,
"doctype": "Cadastral Valuation District",
"modified": "2025-09-02 17:29:31.662366",
"name": "Şahbuz—Paraqaçay"
}
]

View File

@ -0,0 +1,8 @@
// Copyright (c) 2025, JeyERP and contributors
// For license information, please see license.txt
// frappe.ui.form.on("Cadastral Valuation District", {
// refresh(frm) {
// },
// });

View File

@ -0,0 +1,50 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "field:cadastr_name",
"creation": "2025-09-02 14:25:09.903748",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"cadastr_name",
"description"
],
"fields": [
{
"fieldname": "cadastr_name",
"fieldtype": "Data",
"label": "Cadastr Name",
"unique": 1
},
{
"fieldname": "description",
"fieldtype": "Text",
"label": "Description"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-09-02 14:33:09.202479",
"modified_by": "Administrator",
"module": "Jey Erp",
"name": "Cadastral Valuation District",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@ -0,0 +1,9 @@
# Copyright (c) 2025, JeyERP and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class CadastralValuationDistrict(Document):
pass

View File

@ -0,0 +1,30 @@
# Copyright (c) 2025, JeyERP and Contributors
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase, UnitTestCase
# On IntegrationTestCase, the doctype test records and all
# link-field test record depdendencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
class UnitTestCadastralValuationDistrict(UnitTestCase):
"""
Unit tests for CadastralValuationDistrict.
Use this class for testing individual functions and methods.
"""
pass
class IntegrationTestCadastralValuationDistrict(IntegrationTestCase):
"""
Integration tests for CadastralValuationDistrict.
Use this class for testing interactions between multiple components.
"""
pass