diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 300d95d37ee..3397f7708f5 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -34,86 +34,6 @@ from erpnext.controllers.accounts_controller import AccountsController class Asset(AccountsController): -<<<<<<< HEAD -======= - # begin: auto-generated types - # This code is auto-generated. Do not modify anything in this block. - - from typing import TYPE_CHECKING - - if TYPE_CHECKING: - from frappe.types import DF - - from erpnext.assets.doctype.asset_finance_book.asset_finance_book import AssetFinanceBook - - additional_asset_cost: DF.Currency - amended_from: DF.Link | None - asset_category: DF.Link | None - asset_name: DF.Data - asset_owner: DF.Literal["", "Company", "Supplier", "Customer"] - asset_owner_company: DF.Link | None - asset_quantity: DF.Int - available_for_use_date: DF.Date | None - booked_fixed_asset: DF.Check - calculate_depreciation: DF.Check - capitalized_in: DF.Link | None - company: DF.Link - comprehensive_insurance: DF.Data | None - cost_center: DF.Link | None - custodian: DF.Link | None - customer: DF.Link | None - default_finance_book: DF.Link | None - department: DF.Link | None - depr_entry_posting_status: DF.Literal["", "Successful", "Failed"] - depreciation_method: DF.Literal["", "Straight Line", "Double Declining Balance", "Manual"] - disposal_date: DF.Date | None - finance_books: DF.Table[AssetFinanceBook] - frequency_of_depreciation: DF.Int - gross_purchase_amount: DF.Currency - image: DF.AttachImage | None - insurance_end_date: DF.Date | None - insurance_start_date: DF.Date | None - insured_value: DF.Data | None - insurer: DF.Data | None - is_composite_asset: DF.Check - is_existing_asset: DF.Check - is_fully_depreciated: DF.Check - item_code: DF.Link - item_name: DF.ReadOnly | None - journal_entry_for_scrap: DF.Link | None - location: DF.Link - maintenance_required: DF.Check - naming_series: DF.Literal["ACC-ASS-.YYYY.-"] - next_depreciation_date: DF.Date | None - number_of_depreciations_booked: DF.Int - opening_accumulated_depreciation: DF.Currency - policy_number: DF.Data | None - purchase_date: DF.Date | None - purchase_invoice: DF.Link | None - purchase_receipt: DF.Link | None - purchase_receipt_amount: DF.Currency - split_from: DF.Link | None - status: DF.Literal[ - "Draft", - "Submitted", - "Partially Depreciated", - "Fully Depreciated", - "Sold", - "Scrapped", - "In Maintenance", - "Out of Order", - "Issue", - "Receipt", - "Capitalized", - "Decapitalized", - ] - supplier: DF.Link | None - total_asset_cost: DF.Currency - total_number_of_depreciations: DF.Int - value_after_depreciation: DF.Currency - # end: auto-generated types - ->>>>>>> c34f09c503 (fix: Purchase date and amount is not mandatory for composite asset creation) def validate(self): self.validate_asset_values() self.validate_asset_and_reference() @@ -327,16 +247,12 @@ class Asset(AccountsController): frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError) if is_cwip_accounting_enabled(self.asset_category): -<<<<<<< HEAD - if not self.is_existing_asset and not (self.purchase_receipt or self.purchase_invoice): -======= if ( not self.is_existing_asset and not self.is_composite_asset and not self.purchase_receipt and not self.purchase_invoice ): ->>>>>>> c34f09c503 (fix: Purchase date and amount is not mandatory for composite asset creation) frappe.throw( _("Please create purchase receipt or purchase invoice for the item {0}").format( self.item_code