From 6ad939651c3c479475d394a38207364cb505ff31 Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:28:43 +0530 Subject: [PATCH 01/10] chore: Added isort to pre-commit config --- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df15b687c362..2b3a471f7745 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,6 +23,12 @@ repos: args: ['--config', '.github/helper/.flake8_strict'] exclude: ".*setup.py$" + - repo: https://github.com/timothycrosley/isort + rev: 5.9.1 + hooks: + - id: isort + exclude: ".*setup.py$" + ci: autoupdate_schedule: weekly skip: [] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000000..8043dd990651 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[tool.black] +line-length = 99 + +[tool.isort] +line_length = 99 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true +indent = "\t" From 60f2c8d6bc33c1b321ec390ec663cb4eeaa74e15 Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:42:41 +0530 Subject: [PATCH 02/10] chore: Sort imports with isort --- .github/helper/documentation.py | 2 +- .../semgrep_rules/frappe_correctness.py | 1 - .github/helper/semgrep_rules/report.py | 1 - .github/helper/semgrep_rules/ux.py | 3 +- erpnext/__init__.py | 5 +- erpnext/accounts/custom/address.py | 8 +- .../account_balance_timeline.py | 19 ++++- erpnext/accounts/deferred_revenue.py | 22 ++++- erpnext/accounts/doctype/account/account.py | 4 +- .../chart_of_accounts/chart_of_accounts.py | 18 ++-- .../chart_of_accounts/import_from_openerp.py | 7 +- .../verified/standard_chart_of_accounts.py | 2 + ...d_chart_of_accounts_with_account_number.py | 2 + .../accounts/doctype/account/test_account.py | 8 +- .../accounting_dimension.py | 12 +-- .../test_accounting_dimension.py | 6 +- .../accounting_dimension_detail.py | 2 + .../accounting_dimension_filter.py | 2 + .../test_accounting_dimension_filter.py | 9 +- .../accounting_period/accounting_period.py | 4 +- .../test_accounting_period.py | 8 +- .../accounts_settings/accounts_settings.py | 5 +- .../test_accounts_settings.py | 1 + .../advance_taxes_and_charges.py | 2 + .../allowed_dimension/allowed_dimension.py | 2 + .../allowed_to_transact_with.py | 2 + .../applicable_on_account.py | 2 + erpnext/accounts/doctype/bank/bank.py | 7 +- erpnext/accounts/doctype/bank/test_bank.py | 4 +- .../doctype/bank_account/bank_account.py | 7 +- .../doctype/bank_account/test_bank_account.py | 6 +- .../bank_account_subtype.py | 2 + .../test_bank_account_subtype.py | 1 + .../bank_account_type/bank_account_type.py | 2 + .../test_bank_account_type.py | 1 + .../doctype/bank_clearance/bank_clearance.py | 5 +- .../bank_clearance/test_bank_clearance.py | 1 + .../bank_clearance_detail.py | 2 + .../doctype/bank_guarantee/bank_guarantee.py | 8 +- .../bank_guarantee/test_bank_guarantee.py | 4 +- .../bank_reconciliation_tool.py | 10 ++- .../test_bank_reconciliation_tool.py | 1 + .../bank_statement_import.py | 14 +-- .../test_bank_statement_import.py | 1 + .../bank_transaction/bank_transaction.py | 7 +- .../bank_transaction_upload.py | 5 +- .../bank_transaction/test_bank_transaction.py | 15 ++-- .../bank_transaction_mapping.py | 2 + .../bank_transaction_payments.py | 2 + erpnext/accounts/doctype/budget/budget.py | 11 ++- .../accounts/doctype/budget/test_budget.py | 10 ++- .../doctype/budget_account/budget_account.py | 2 + erpnext/accounts/doctype/c_form/c_form.py | 4 +- .../accounts/doctype/c_form/test_c_form.py | 3 +- .../c_form_invoice_detail.py | 2 + .../doctype/campaign_item/campaign_item.py | 1 + .../cash_flow_mapper/cash_flow_mapper.py | 1 + .../cash_flow_mapping/cash_flow_mapping.py | 1 + .../test_cash_flow_mapping.py | 3 +- .../cash_flow_mapping_accounts.py | 1 + .../cash_flow_mapping_template.py | 1 + .../cash_flow_mapping_template_details.py | 1 + .../cashier_closing/cashier_closing.py | 6 +- .../cashier_closing/test_cashier_closing.py | 4 +- .../cashier_closing_payments.py | 2 + .../chart_of_accounts_importer.py | 20 ++++- .../test_chart_of_accounts_importer.py | 4 +- .../cheque_print_template.py | 4 +- .../test_cheque_print_template.py | 3 +- .../closed_document/closed_document.py | 2 + .../doctype/cost_center/cost_center.py | 2 + .../doctype/cost_center/test_cost_center.py | 2 + .../doctype/coupon_code/coupon_code.py | 5 +- .../doctype/coupon_code/test_coupon_code.py | 6 +- .../customer_group_item.py | 1 + .../doctype/customer_item/customer_item.py | 1 + .../discounted_invoice/discounted_invoice.py | 2 + .../distributed_cost_center.py | 2 + erpnext/accounts/doctype/dunning/dunning.py | 15 +++- .../doctype/dunning/dunning_dashboard.py | 2 + .../accounts/doctype/dunning/test_dunning.py | 14 ++- .../dunning_letter_text.py | 2 + .../doctype/dunning_type/dunning_type.py | 2 + .../doctype/dunning_type/test_dunning_type.py | 1 + .../exchange_rate_revaluation.py | 10 ++- .../exchange_rate_revaluation_dashboard.py | 1 + .../test_exchange_rate_revaluation.py | 4 +- .../exchange_rate_revaluation_account.py | 2 + .../doctype/finance_book/finance_book.py | 2 + .../doctype/finance_book/test_finance_book.py | 6 +- .../doctype/fiscal_year/fiscal_year.py | 7 +- .../doctype/fiscal_year/test_fiscal_year.py | 4 +- .../fiscal_year_company.py | 2 + erpnext/accounts/doctype/gl_entry/gl_entry.py | 28 ++++-- .../doctype/gl_entry/test_gl_entry.py | 9 +- .../doctype/gst_account/gst_account.py | 2 + .../invoice_discounting.py | 16 +++- .../invoice_discounting_dashboard.py | 2 + .../test_invoice_discounting.py | 12 ++- .../item_tax_template/item_tax_template.py | 4 +- .../test_item_tax_template.py | 4 +- .../item_tax_template_detail.py | 2 + .../doctype/journal_entry/journal_entry.py | 31 ++++--- .../journal_entry/test_journal_entry.py | 9 +- .../journal_entry_account.py | 2 + .../journal_entry_template.py | 2 + .../test_journal_entry_template.py | 1 + .../journal_entry_template_account.py | 2 + .../loyalty_point_entry.py | 1 + .../test_loyalty_point_entry.py | 4 +- .../loyalty_point_entry_redemption.py | 2 + .../loyalty_program/loyalty_program.py | 5 +- .../loyalty_program/test_loyalty_program.py | 11 ++- .../loyalty_program_collection.py | 2 + .../mode_of_payment/mode_of_payment.py | 5 +- .../mode_of_payment/test_mode_of_payment.py | 3 +- .../mode_of_payment_account.py | 2 + .../monthly_distribution.py | 4 +- .../test_monthly_distribution.py | 4 +- .../monthly_distribution_percentage.py | 2 + .../opening_invoice_creation_tool.py | 11 ++- .../test_opening_invoice_creation_tool.py | 7 +- .../opening_invoice_creation_tool_item.py | 2 + .../doctype/party_account/party_account.py | 2 + .../accounts/doctype/party_link/party_link.py | 1 + .../doctype/party_link/test_party_link.py | 1 + .../doctype/payment_entry/payment_entry.py | 39 ++++++--- .../payment_entry/test_payment_entry.py | 26 ++++-- .../payment_entry_deduction.py | 2 + .../payment_entry_reference.py | 2 + .../payment_gateway_account.py | 2 + .../test_payment_gateway_account.py | 3 +- .../doctype/payment_order/payment_order.py | 5 +- .../payment_order/payment_order_dashboard.py | 2 + .../payment_order/test_payment_order.py | 10 ++- .../payment_order_reference.py | 2 + .../payment_reconciliation.py | 17 ++-- .../test_payment_reconciliation.py | 1 + .../payment_reconciliation_allocation.py | 1 + .../payment_reconciliation_invoice.py | 2 + .../payment_reconciliation_payment.py | 2 + .../payment_request/payment_request.py | 17 ++-- .../payment_request/test_payment_request.py | 6 +- .../payment_schedule/payment_schedule.py | 1 + .../doctype/payment_term/payment_term.py | 1 + .../doctype/payment_term/test_payment_term.py | 1 + .../payment_terms_template.py | 4 +- .../test_payment_terms_template.py | 1 + .../payment_terms_template_detail.py | 1 + .../period_closing_voucher.py | 11 ++- .../test_period_closing_voucher.py | 8 +- .../pos_closing_entry/pos_closing_entry.py | 13 ++- .../test_pos_closing_entry.py | 12 ++- .../pos_closing_entry_detail.py | 2 + .../pos_closing_entry_taxes.py | 2 + .../pos_customer_group/pos_customer_group.py | 2 + .../accounts/doctype/pos_field/pos_field.py | 2 + .../doctype/pos_invoice/pos_invoice.py | 22 +++-- .../doctype/pos_invoice/test_pos_invoice.py | 56 ++++++++---- .../pos_invoice_item/pos_invoice_item.py | 2 + .../pos_invoice_merge_log.py | 11 ++- .../test_pos_invoice_merge_log.py | 15 ++-- .../pos_invoice_reference.py | 2 + .../doctype/pos_item_group/pos_item_group.py | 2 + .../pos_opening_entry/pos_opening_entry.py | 3 + .../test_pos_opening_entry.py | 4 +- .../pos_opening_entry_detail.py | 2 + .../pos_payment_method/pos_payment_method.py | 2 + .../doctype/pos_profile/pos_profile.py | 8 +- .../doctype/pos_profile/test_pos_profile.py | 6 +- .../pos_profile_user/pos_profile_user.py | 2 + .../pos_profile_user/test_pos_profile_user.py | 1 + .../pos_search_fields/pos_search_fields.py | 2 + .../doctype/pos_settings/pos_settings.py | 2 + .../doctype/pos_settings/test_pos_settings.py | 1 + .../doctype/pricing_rule/pricing_rule.py | 24 ++++-- .../doctype/pricing_rule/test_pricing_rule.py | 21 +++-- .../accounts/doctype/pricing_rule/utils.py | 7 +- .../pricing_rule_brand/pricing_rule_brand.py | 2 + .../pricing_rule_detail.py | 2 + .../pricing_rule_item_code.py | 2 + .../pricing_rule_item_group.py | 2 + .../process_deferred_accounting.py | 12 ++- .../test_process_deferred_accounting.py | 10 ++- .../process_statement_of_accounts.py | 24 +++--- .../test_process_statement_of_accounts.py | 1 + .../process_statement_of_accounts_customer.py | 2 + .../promotional_scheme/promotional_scheme.py | 5 +- .../promotional_scheme_dashboard.py | 1 + .../test_promotional_scheme.py | 4 +- .../promotional_scheme_price_discount.py | 2 + .../promotional_scheme_product_discount.py | 2 + .../psoa_cost_center/psoa_cost_center.py | 2 + .../doctype/psoa_project/psoa_project.py | 2 + .../purchase_invoice/purchase_invoice.py | 50 +++++++---- .../purchase_invoice_dashboard.py | 2 + .../purchase_invoice/test_purchase_invoice.py | 41 +++++---- .../purchase_invoice_advance.py | 3 +- .../purchase_invoice_item.py | 3 +- .../purchase_taxes_and_charges.py | 3 +- .../purchase_taxes_and_charges_template.py | 8 +- ...est_purchase_taxes_and_charges_template.py | 3 +- .../salary_component_account.py | 2 + .../doctype/sales_invoice/sales_invoice.py | 74 ++++++++++------ .../sales_invoice/sales_invoice_dashboard.py | 2 + .../sales_invoice/test_sales_invoice.py | 85 ++++++++++++------- .../sales_invoice_advance.py | 3 +- .../sales_invoice_item/sales_invoice_item.py | 3 +- .../sales_invoice_payment.py | 2 + .../sales_invoice_timesheet.py | 2 + .../sales_partner_item/sales_partner_item.py | 1 + .../sales_taxes_and_charges.py | 3 +- .../sales_taxes_and_charges_template.py | 12 ++- .../test_sales_taxes_and_charges_template.py | 3 +- .../doctype/share_balance/share_balance.py | 2 + .../doctype/share_transfer/share_transfer.py | 6 +- .../share_transfer/test_share_transfer.py | 4 +- .../accounts/doctype/share_type/share_type.py | 2 + .../doctype/share_type/test_share_type.py | 4 +- .../doctype/shareholder/shareholder.py | 7 +- .../doctype/shareholder/test_shareholder.py | 4 +- .../doctype/shipping_rule/shipping_rule.py | 8 +- .../shipping_rule/test_shipping_rule.py | 10 ++- .../shipping_rule_condition.py | 3 +- .../shipping_rule_country.py | 2 + .../south_africa_vat_account.py | 1 + .../doctype/subscription/subscription.py | 22 ++++- .../doctype/subscription/test_subscription.py | 15 +++- .../subscription_invoice.py | 2 + .../test_subscription_invoice.py | 1 + .../subscription_plan/subscription_plan.py | 5 +- .../test_subscription_plan.py | 1 + .../subscription_plan_detail.py | 2 + .../subscription_settings.py | 2 + .../test_subscription_settings.py | 1 + .../supplier_group_item.py | 1 + .../doctype/supplier_item/supplier_item.py | 1 + .../doctype/tax_category/tax_category.py | 2 + .../doctype/tax_category/test_tax_category.py | 4 +- erpnext/accounts/doctype/tax_rule/tax_rule.py | 14 +-- .../doctype/tax_rule/test_tax_rule.py | 14 ++- .../tax_withholding_account.py | 2 + .../tax_withholding_category.py | 5 +- .../test_tax_withholding_category.py | 4 +- .../tax_withholding_rate.py | 2 + .../doctype/territory_item/territory_item.py | 1 + erpnext/accounts/general_ledger.py | 12 ++- .../notification_for_new_fiscal_year.py | 1 + erpnext/accounts/party.py | 37 +++++--- .../report/account_balance/account_balance.py | 3 + .../account_balance/test_account_balance.py | 7 +- .../accounts_payable/accounts_payable.py | 3 + .../accounts_payable_summary.py | 8 +- .../accounts_receivable.py | 15 +++- .../test_accounts_receivable.py | 12 ++- .../accounts_receivable_summary.py | 7 +- .../asset_depreciation_ledger.py | 8 +- .../asset_depreciations_and_balances.py | 3 +- .../report/balance_sheet/balance_sheet.py | 13 ++- .../bank_clearance_summary.py | 4 +- .../bank_reconciliation_statement.py | 4 +- .../billed_items_to_be_received.py | 2 + .../budget_variance_report.py | 3 +- .../accounts/report/cash_flow/cash_flow.py | 15 +++- .../report/cash_flow/custom_cash_flow.py | 8 +- .../consolidated_financial_statement.py | 39 +++++++-- .../customer_ledger_summary.py | 5 +- .../delivered_items_to_be_billed.py | 3 + .../dimension_wise_accounts_balance_report.py | 13 ++- .../accounts/report/financial_statements.py | 21 +++-- .../report/general_ledger/general_ledger.py | 24 ++++-- .../gross_and_net_profit_report.py | 8 +- .../report/gross_profit/gross_profit.py | 6 +- .../inactive_sales_items.py | 4 +- .../item_wise_purchase_register.py | 18 +++- .../item_wise_sales_register.py | 13 ++- erpnext/accounts/report/non_billed_report.py | 5 +- .../payment_period_based_on_invoice_date.py | 4 +- .../report/pos_register/pos_register.py | 3 + .../profit_and_loss_statement.py | 11 ++- .../profitability_analysis.py | 9 +- .../purchase_invoice_trends.py | 5 +- .../purchase_register/purchase_register.py | 10 ++- .../received_items_to_be_billed.py | 3 + .../sales_invoice_trends.py | 5 +- .../sales_payment_summary.py | 1 + .../test_sales_payment_summary.py | 8 +- .../report/sales_register/sales_register.py | 12 ++- .../report/share_balance/share_balance.py | 4 +- .../report/share_ledger/share_ledger.py | 6 +- .../supplier_ledger_summary.py | 7 +- .../tds_computation_summary.py | 9 +- .../tds_payable_monthly.py | 2 + .../report/trial_balance/trial_balance.py | 19 +++-- .../trial_balance_for_party.py | 5 +- .../unpaid_expense_claim.py | 2 + erpnext/accounts/report/utils.py | 6 +- erpnext/accounts/test/test_utils.py | 5 +- erpnext/accounts/utils.py | 20 +++-- .../agriculture_analysis_criteria.py | 2 + .../test_agriculture_analysis_criteria.py | 4 +- .../agriculture_task/agriculture_task.py | 2 + .../agriculture_task/test_agriculture_task.py | 4 +- .../doctype/crop/crop_dashboard.py | 2 + erpnext/agriculture/doctype/crop/test_crop.py | 3 +- .../detected_disease/detected_disease.py | 2 + .../agriculture/doctype/disease/disease.py | 2 + .../doctype/disease/test_disease.py | 4 +- .../doctype/fertilizer/fertilizer.py | 2 + .../doctype/fertilizer/test_fertilizer.py | 4 +- .../fertilizer_content/fertilizer_content.py | 2 + .../linked_location/linked_location.py | 2 + .../linked_plant_analysis.py | 2 + .../linked_soil_analysis.py | 2 + .../linked_soil_texture.py | 2 + .../doctype/plant_analysis/plant_analysis.py | 4 +- .../plant_analysis/test_plant_analysis.py | 4 +- .../plant_analysis_criteria.py | 2 + .../doctype/soil_analysis/soil_analysis.py | 2 + .../soil_analysis/test_soil_analysis.py | 4 +- .../soil_analysis_criteria.py | 2 + .../doctype/soil_texture/soil_texture.py | 4 +- .../doctype/soil_texture/test_soil_texture.py | 4 +- .../soil_texture_criteria.py | 2 + .../water_analysis/test_water_analysis.py | 4 +- .../doctype/water_analysis/water_analysis.py | 2 + .../water_analysis_criteria.py | 2 + .../doctype/weather/test_weather.py | 4 +- .../agriculture/doctype/weather/weather.py | 2 + .../weather_parameter/weather_parameter.py | 2 + erpnext/agriculture/setup.py | 3 + erpnext/assets/dashboard_fixtures.py | 7 +- erpnext/assets/doctype/asset/asset.py | 34 ++++++-- .../assets/doctype/asset/asset_dashboard.py | 1 + erpnext/assets/doctype/asset/depreciation.py | 9 +- erpnext/assets/doctype/asset/test_asset.py | 19 +++-- .../doctype/asset_category/asset_category.py | 4 +- .../asset_category/test_asset_category.py | 4 +- .../asset_category_account.py | 2 + .../asset_finance_book/asset_finance_book.py | 2 + .../asset_maintenance/asset_maintenance.py | 6 +- .../test_asset_maintenance.py | 9 +- .../asset_maintenance_log.py | 7 +- .../test_asset_maintenance_log.py | 1 + .../asset_maintenance_task.py | 2 + .../asset_maintenance_team.py | 2 + .../test_asset_maintenance_team.py | 1 + .../doctype/asset_movement/asset_movement.py | 2 + .../asset_movement/test_asset_movement.py | 11 ++- .../asset_movement_item.py | 2 + .../doctype/asset_repair/asset_repair.py | 5 +- .../doctype/asset_repair/test_asset_repair.py | 16 +++- .../asset_repair_consumed_item.py | 1 + .../asset_value_adjustment.py | 11 ++- .../test_asset_value_adjustment.py | 11 ++- .../depreciation_schedule.py | 2 + .../linked_location/linked_location.py | 2 + .../maintenance_team_member.py | 2 + .../test_maintenance_team_member.py | 1 + .../fixed_asset_register.py | 11 ++- .../buying_settings/buying_settings.py | 3 +- .../buying_settings/test_buying_settings.py | 1 + .../doctype/purchase_order/purchase_order.py | 33 ++++--- .../purchase_order_dashboard.py | 2 + .../purchase_order/test_purchase_order.py | 54 ++++++++---- .../purchase_order_item.py | 3 +- .../purchase_order_item_supplied.py | 3 +- .../purchase_receipt_item_supplied.py | 3 +- .../request_for_quotation.py | 21 +++-- .../request_for_quotation_dashboard.py | 2 + .../test_request_for_quotation.py | 12 ++- .../request_for_quotation_item.py | 2 + .../request_for_quotation_supplier.py | 2 + erpnext/buying/doctype/supplier/supplier.py | 18 +++- .../buying/doctype/supplier/test_supplier.py | 6 +- .../supplier_item_group.py | 2 + .../test_supplier_item_group.py | 1 + .../supplier_quotation/supplier_quotation.py | 5 +- .../supplier_quotation_dashboard.py | 2 + .../test_supplier_quotation.py | 3 + .../supplier_quotation_item.py | 3 +- .../supplier_scorecard/supplier_scorecard.py | 16 ++-- .../supplier_scorecard_dashboard.py | 2 + .../test_supplier_scorecard.py | 4 +- .../supplier_scorecard_criteria.py | 5 +- .../test_supplier_scorecard_criteria.py | 4 +- .../supplier_scorecard_period.py | 9 +- .../test_supplier_scorecard_period.py | 1 + .../supplier_scorecard_scoring_criteria.py | 2 + .../supplier_scorecard_scoring_standing.py | 2 + .../supplier_scorecard_scoring_variable.py | 2 + .../supplier_scorecard_standing.py | 2 + .../test_supplier_scorecard_standing.py | 1 + .../supplier_scorecard_variable.py | 9 +- .../test_supplier_scorecard_variable.py | 7 +- .../procurement_tracker.py | 2 + .../test_procurement_tracker.py | 8 +- .../purchase_analytics/purchase_analytics.py | 2 + .../purchase_order_analysis.py | 7 +- .../purchase_order_trends.py | 5 +- .../requested_items_to_order_and_receive.py | 7 +- .../subcontract_order_summary.py | 2 + .../subcontracted_item_to_be_received.py | 2 + .../test_subcontracted_item_to_be_received.py | 15 +++- ...tracted_raw_materials_to_be_transferred.py | 2 + ...tracted_raw_materials_to_be_transferred.py | 14 ++- .../supplier_quotation_comparison.py | 8 +- erpnext/buying/utils.py | 10 ++- erpnext/commands/__init__.py | 6 +- .../communication_medium.py | 2 + .../communication_medium_timeslot.py | 2 + erpnext/config/education.py | 2 + erpnext/config/projects.py | 2 + erpnext/controllers/accounts_controller.py | 74 ++++++++++++---- erpnext/controllers/buying_controller.py | 26 +++--- erpnext/controllers/item_variant.py | 7 +- erpnext/controllers/print_settings.py | 2 + erpnext/controllers/queries.py | 21 +++-- .../controllers/sales_and_purchase_return.py | 9 +- erpnext/controllers/selling_controller.py | 15 ++-- erpnext/controllers/status_updater.py | 4 +- erpnext/controllers/stock_controller.py | 6 +- erpnext/controllers/subcontracting.py | 9 +- erpnext/controllers/taxes_and_totals.py | 18 ++-- .../controllers/tests/test_item_variant.py | 11 ++- erpnext/controllers/tests/test_mapper.py | 9 +- .../controllers/tests/test_qty_based_taxes.py | 7 +- erpnext/controllers/trends.py | 4 +- .../controllers/website_list_for_contact.py | 3 + .../crm/doctype/appointment/appointment.py | 2 +- .../doctype/appointment/test_appointment.py | 5 +- .../appointment_booking_settings.py | 4 +- .../test_appointment_booking_settings.py | 1 + .../appointment_booking_slots.py | 2 + .../availability_of_slots.py | 2 + .../campaign_email_schedule.py | 2 + erpnext/crm/doctype/contract/test_contract.py | 1 + .../contract_fulfilment_checklist.py | 2 + .../test_contract_fulfilment_checklist.py | 4 +- .../contract_template/contract_template.py | 5 +- .../test_contract_template.py | 4 +- .../contract_template_fulfilment_terms.py | 2 + .../doctype/email_campaign/email_campaign.py | 6 +- .../email_campaign/test_email_campaign.py | 1 + erpnext/crm/doctype/lead/lead.py | 16 +++- erpnext/crm/doctype/lead/lead_dashboard.py | 2 + erpnext/crm/doctype/lead/test_lead.py | 3 +- .../crm/doctype/lead_source/lead_source.py | 2 + .../doctype/lead_source/test_lead_source.py | 1 + .../linkedin_settings/linkedin_settings.py | 4 +- .../test_linkedin_settings.py | 1 + .../lost_reason_detail/lost_reason_detail.py | 2 + .../doctype/market_segment/market_segment.py | 2 + .../market_segment/test_market_segment.py | 4 +- .../crm/doctype/opportunity/opportunity.py | 15 ++-- .../opportunity/opportunity_dashboard.py | 2 + .../doctype/opportunity/test_opportunity.py | 6 +- .../opportunity_item/opportunity_item.py | 2 + .../opportunity_lost_reason.py | 2 + .../opportunity_lost_reason_detail.py | 2 + .../opportunity_type/opportunity_type.py | 2 + .../opportunity_type/test_opportunity_type.py | 4 +- .../crm/doctype/sales_stage/sales_stage.py | 2 + .../doctype/sales_stage/test_sales_stage.py | 4 +- .../social_media_post/social_media_post.py | 7 +- .../test_social_media_post.py | 1 + .../twitter_settings/test_twitter_settings.py | 1 + .../twitter_settings/twitter_settings.py | 10 ++- erpnext/crm/doctype/utils.py | 4 +- .../campaign_efficiency.py | 2 + .../first_response_time_for_opportunity.py | 2 + .../lead_conversion_time.py | 2 + .../crm/report/lead_details/lead_details.py | 4 +- .../lead_owner_efficiency.py | 3 + .../lost_opportunity/lost_opportunity.py | 4 +- .../prospects_engaged_but_not_converted.py | 2 + erpnext/demo/demo.py | 13 ++- erpnext/demo/setup/education.py | 10 ++- erpnext/demo/setup/healthcare.py | 10 ++- erpnext/demo/setup/manufacture.py | 11 ++- erpnext/demo/setup/retail.py | 11 ++- erpnext/demo/setup/setup_data.py | 17 ++-- erpnext/demo/user/accounts.py | 16 ++-- erpnext/demo/user/education.py | 16 +++- erpnext/demo/user/fixed_asset.py | 1 + erpnext/demo/user/hr.py | 24 ++++-- erpnext/demo/user/manufacturing.py | 18 ++-- erpnext/demo/user/projects.py | 7 +- erpnext/demo/user/purchase.py | 17 ++-- erpnext/demo/user/sales.py | 14 ++- erpnext/demo/user/stock.py | 24 ++++-- erpnext/education/__init__.py | 2 + erpnext/education/api.py | 9 +- .../doctype/academic_term/academic_term.py | 4 +- .../academic_term/academic_term_dashboard.py | 2 + .../academic_term/test_academic_term.py | 3 +- .../doctype/academic_year/academic_year.py | 4 +- .../academic_year/academic_year_dashboard.py | 2 + .../academic_year/test_academic_year.py | 3 +- erpnext/education/doctype/article/article.py | 2 + .../education/doctype/article/test_article.py | 4 +- .../assessment_criteria.py | 1 + .../test_assessment_criteria.py | 3 +- .../assessment_criteria_group.py | 2 + .../test_assessment_criteria_group.py | 3 +- .../assessment_group/assessment_group.py | 2 + .../assessment_group_dashboard.py | 2 + .../assessment_group/test_assessment_group.py | 3 +- .../assessment_plan/assessment_plan.py | 4 +- .../assessment_plan_dashboard.py | 2 + .../assessment_plan/test_assessment_plan.py | 3 +- .../assessment_plan_criteria.py | 2 + .../assessment_result/assessment_result.py | 8 +- .../assessment_result_dashboard.py | 2 + .../test_assessment_result.py | 4 +- .../assessment_result_detail.py | 2 + .../assessment_result_tool.py | 2 + .../test_assessment_result_tool.py | 4 +- .../content_activity/content_activity.py | 2 + .../content_question/content_question.py | 2 + .../content_question/test_content_question.py | 4 +- erpnext/education/doctype/course/course.py | 7 +- .../doctype/course/course_dashboard.py | 2 + .../education/doctype/course/test_course.py | 7 +- .../course_activity/course_activity.py | 2 + .../course_activity/test_course_activity.py | 4 +- .../course_assessment_criteria.py | 2 + .../doctype/course_content/course_content.py | 2 + .../course_content/test_course_content.py | 4 +- .../course_enrollment/course_enrollment.py | 5 +- .../course_enrollment_dashboard.py | 2 + .../test_course_enrollment.py | 8 +- .../course_schedule/course_schedule.py | 2 + .../course_schedule_dashboard.py | 2 + .../course_schedule/test_course_schedule.py | 9 +- .../course_scheduling_tool.py | 5 +- .../test_course_scheduling_tool.py | 4 +- .../doctype/course_topic/course_topic.py | 2 + .../doctype/course_topic/test_course_topic.py | 4 +- .../education_settings/education_settings.py | 1 + .../test_education_settings.py | 4 +- .../doctype/fee_category/fee_category.py | 2 + .../doctype/fee_category/test_fee_category.py | 3 +- .../doctype/fee_component/fee_component.py | 2 + .../doctype/fee_schedule/fee_schedule.py | 10 ++- .../fee_schedule/fee_schedule_dashboard.py | 1 + .../doctype/fee_schedule/test_fee_schedule.py | 1 + .../fee_schedule_program.py | 2 + .../fee_schedule_student_group.py | 2 + .../doctype/fee_structure/fee_structure.py | 1 + .../fee_structure/fee_structure_dashboard.py | 2 + .../fee_structure/test_fee_structure.py | 3 +- erpnext/education/doctype/fees/fees.py | 11 ++- erpnext/education/doctype/fees/test_fees.py | 4 +- .../doctype/grading_scale/grading_scale.py | 4 +- .../grading_scale/grading_scale_dashboard.py | 2 + .../grading_scale/test_grading_scale.py | 3 +- .../grading_scale_interval.py | 2 + .../education/doctype/guardian/guardian.py | 2 + .../doctype/guardian/test_guardian.py | 3 +- .../guardian_interest/guardian_interest.py | 2 + .../guardian_student/guardian_student.py | 2 + .../doctype/instructor/instructor.py | 2 + .../instructor/instructor_dashboard.py | 2 + .../doctype/instructor/test_instructor.py | 3 +- .../doctype/instructor_log/instructor_log.py | 2 + erpnext/education/doctype/options/options.py | 2 + erpnext/education/doctype/program/program.py | 2 + .../doctype/program/program_dashboard.py | 1 + .../education/doctype/program/test_program.py | 9 +- .../doctype/program_course/program_course.py | 2 + .../program_enrollment/program_enrollment.py | 7 +- .../program_enrollment_dashboard.py | 2 + .../test_program_enrollment.py | 9 +- .../program_enrollment_course.py | 2 + .../program_enrollment_fee.py | 2 + .../program_enrollment_tool.py | 5 +- .../test_program_enrollment_tool.py | 4 +- .../program_enrollment_tool_student.py | 2 + .../doctype/program_fee/program_fee.py | 2 + .../education/doctype/question/question.py | 2 + .../doctype/question/test_question.py | 4 +- erpnext/education/doctype/quiz/quiz.py | 5 +- erpnext/education/doctype/quiz/test_quiz.py | 4 +- .../doctype/quiz_activity/quiz_activity.py | 2 + .../quiz_activity/test_quiz_activity.py | 4 +- .../doctype/quiz_question/quiz_question.py | 2 + .../doctype/quiz_result/quiz_result.py | 2 + .../doctype/quiz_result/test_quiz_result.py | 4 +- erpnext/education/doctype/room/room.py | 2 + .../education/doctype/room/room_dashboard.py | 2 + erpnext/education/doctype/room/test_room.py | 3 +- .../doctype/school_house/school_house.py | 2 + .../doctype/school_house/test_school_house.py | 4 +- erpnext/education/doctype/student/student.py | 8 +- .../doctype/student/student_dashboard.py | 2 + .../education/doctype/student/test_student.py | 10 ++- .../student_admission/student_admission.py | 1 + .../test_student_admission.py | 3 +- .../student_admission_program.py | 2 + .../student_applicant/student_applicant.py | 4 +- .../test_student_applicant.py | 3 +- .../student_attendance/student_attendance.py | 7 +- .../student_attendance_dashboard.py | 2 + .../test_student_attendance.py | 3 +- .../student_attendance_tool.py | 2 + .../test_student_attendance_tool.py | 4 +- .../student_batch_name/student_batch_name.py | 2 + .../test_student_batch_name.py | 3 +- .../student_category/student_category.py | 2 + .../student_category_dashboard.py | 2 + .../student_category/test_student_category.py | 3 +- .../doctype/student_group/student_group.py | 7 +- .../student_group/student_group_dashboard.py | 2 + .../student_group/test_student_group.py | 5 +- .../student_group_creation_tool.py | 3 + .../test_student_group_creation_tool.py | 4 +- .../student_group_creation_tool_course.py | 2 + .../student_group_instructor.py | 2 + .../student_group_student.py | 2 + .../student_guardian/student_guardian.py | 2 + .../student_language/student_language.py | 2 + .../student_language/test_student_language.py | 3 +- .../student_leave_application.py | 12 ++- .../student_leave_application_dashboard.py | 1 + .../test_student_leave_application.py | 9 +- .../doctype/student_log/student_log.py | 2 + .../doctype/student_log/test_student_log.py | 3 +- .../student_report_generation_tool.py | 14 ++- .../test_student_report_generation_tool.py | 4 +- .../student_sibling/student_sibling.py | 2 + .../student_siblings/student_siblings.py | 2 + erpnext/education/doctype/topic/test_topic.py | 4 +- erpnext/education/doctype/topic/topic.py | 5 +- .../topic_content/test_topic_content.py | 4 +- .../doctype/topic_content/topic_content.py | 2 + .../absent_student_report.py | 5 +- .../assessment_plan_status.py | 4 +- .../course_wise_assessment_report.py | 5 +- .../final_assessment_grades.py | 10 ++- .../program_wise_fee_collection.py | 2 + .../student_and_guardian_contact_details.py | 1 + .../student_batch_wise_attendance.py | 5 +- .../student_monthly_attendance_sheet.py | 10 ++- erpnext/education/setup.py | 1 + erpnext/education/utils.py | 4 +- .../student_applicant/student_applicant.py | 1 + .../connectors/github_connection.py | 2 + .../connectors/shopify_connection.py | 24 ++++-- .../connectors/woocommerce_connection.py | 11 ++- .../issue_to_task/__init__.py | 2 + .../milestone_to_project/__init__.py | 1 + .../amazon_mws_settings/amazon_methods.py | 12 ++- .../amazon_mws_settings/amazon_mws_api.py | 15 ++-- .../amazon_mws_settings.py | 7 +- .../test_amazon_mws_settings.py | 1 + .../doctype/amazon_mws_settings/xml_utils.py | 2 +- .../exotel_settings/exotel_settings.py | 6 +- .../gocardless_mandate/gocardless_mandate.py | 2 + .../test_gocardless_mandate.py | 1 + .../doctype/gocardless_settings/__init__.py | 9 +- .../gocardless_settings.py | 8 +- .../test_gocardless_settings.py | 1 + .../doctype/mpesa_settings/mpesa_connector.py | 4 +- .../mpesa_settings/mpesa_custom_fields.py | 1 + .../doctype/mpesa_settings/mpesa_settings.py | 26 ++++-- .../mpesa_settings/test_mpesa_settings.py | 11 ++- .../doctype/plaid_settings/plaid_connector.py | 5 +- .../doctype/plaid_settings/plaid_settings.py | 7 +- .../plaid_settings/test_plaid_settings.py | 11 ++- .../quickbooks_migrator.py | 13 ++- .../test_quickbooks_migrator.py | 4 +- .../doctype/shopify_log/shopify_log.py | 6 +- .../doctype/shopify_log/test_shopify_log.py | 3 +- .../shopify_settings/shopify_settings.py | 10 ++- .../doctype/shopify_settings/sync_customer.py | 2 + .../doctype/shopify_settings/sync_product.py | 9 +- .../shopify_settings/test_shopify_settings.py | 12 ++- .../shopify_tax_account.py | 2 + .../shopify_webhook_detail.py | 2 + .../tally_migration/tally_migration.py | 13 +-- .../tally_migration/test_tally_migration.py | 4 +- .../taxjar_settings/taxjar_settings.py | 2 + .../taxjar_settings/test_taxjar_settings.py | 1 + .../test_woocommerce_settings.py | 1 + .../woocommerce_settings.py | 6 +- .../stripe_integration.py | 3 +- .../taxjar_integration.py | 6 +- erpnext/erpnext_integrations/utils.py | 8 +- erpnext/exceptions.py | 2 + .../department_wise_patient_appointments.py | 2 + .../doctype/antibiotic/antibiotic.py | 2 + .../doctype/antibiotic/test_antibiotic.py | 2 + .../appointment_type/appointment_type.py | 4 +- .../appointment_type_dashboard.py | 2 + .../appointment_type_service_item.py | 2 + .../healthcare/doctype/body_part/body_part.py | 2 + .../doctype/body_part/test_body_part.py | 1 + .../doctype/body_part_link/body_part_link.py | 2 + .../clinical_procedure/clinical_procedure.py | 9 +- .../test_clinical_procedure.py | 7 +- .../clinical_procedure_item.py | 2 + .../clinical_procedure_template.py | 6 +- .../clinical_procedure_template_dashboard.py | 2 + .../test_clinical_procedure_template.py | 2 + .../codification_table/codification_table.py | 2 + .../healthcare/doctype/complaint/complaint.py | 2 + .../doctype/complaint/test_complaint.py | 2 + .../descriptive_test_result.py | 2 + .../descriptive_test_template.py | 2 + .../healthcare/doctype/diagnosis/diagnosis.py | 2 + .../doctype/dosage_form/dosage_form.py | 2 + .../doctype/dosage_form/test_dosage_form.py | 1 + .../dosage_strength/dosage_strength.py | 2 + .../drug_prescription/drug_prescription.py | 2 + .../healthcare/doctype/exercise/exercise.py | 2 + .../exercise_difficulty_level.py | 2 + .../test_exercise_difficulty_level.py | 1 + .../doctype/exercise_type/exercise_type.py | 2 + .../exercise_type/test_exercise_type.py | 1 + .../exercise_type_step/exercise_type_step.py | 2 + .../doctype/fee_validity/fee_validity.py | 7 +- .../doctype/fee_validity/test_fee_validity.py | 12 ++- .../fee_validity_reference.py | 2 + erpnext/healthcare/doctype/healthcare.py | 1 + .../healthcare_practitioner.py | 14 ++- .../healthcare_practitioner_dashboard.py | 2 + .../test_healthcare_practitioner.py | 2 + .../healthcare_schedule_time_slot.py | 2 + .../healthcare_service_unit.py | 7 +- .../test_healthcare_service_unit.py | 1 + .../healthcare_service_unit_type.py | 2 + .../healthcare_service_unit_type_dashboard.py | 2 + .../test_healthcare_service_unit_type.py | 3 + .../healthcare_settings.py | 7 +- .../test_healthcare_settings.py | 2 + .../inpatient_medication_entry.py | 5 +- .../inpatient_medication_entry_dashboard.py | 2 + .../test_inpatient_medication_entry.py | 28 ++++-- .../inpatient_medication_entry_detail.py | 2 + .../inpatient_medication_order.py | 3 + .../test_inpatient_medication_order.py | 18 +++- .../inpatient_medication_order_entry.py | 2 + .../inpatient_occupancy.py | 2 + .../inpatient_record/inpatient_record.py | 10 ++- .../inpatient_record_dashboard.py | 2 + .../inpatient_record/test_inpatient_record.py | 11 ++- .../lab_prescription/lab_prescription.py | 2 + .../healthcare/doctype/lab_test/lab_test.py | 4 +- .../doctype/lab_test/test_lab_test.py | 15 +++- .../lab_test_group_template.py | 2 + .../lab_test_sample/lab_test_sample.py | 2 + .../lab_test_sample/test_lab_test_sample.py | 2 + .../lab_test_template/lab_test_template.py | 8 +- .../lab_test_template_dashboard.py | 2 + .../test_lab_test_template.py | 1 + .../doctype/lab_test_uom/lab_test_uom.py | 2 + .../doctype/lab_test_uom/test_lab_test_uom.py | 1 + .../doctype/medical_code/medical_code.py | 2 + .../doctype/medical_code/test_medical_code.py | 2 + .../medical_code_standard.py | 2 + .../test_medical_code_standard.py | 2 + .../medical_department/medical_department.py | 2 + .../test_medical_department.py | 1 + .../normal_test_result/normal_test_result.py | 2 + .../normal_test_template.py | 2 + .../healthcare/doctype/organism/organism.py | 2 + .../doctype/organism/test_organism.py | 2 + .../organism_test_item/organism_test_item.py | 2 + .../organism_test_result.py | 2 + erpnext/healthcare/doctype/patient/patient.py | 15 +++- .../doctype/patient/patient_dashboard.py | 2 + .../doctype/patient/test_patient.py | 3 + .../patient_appointment.py | 29 +++++-- .../patient_appointment_dashboard.py | 2 + .../test_patient_appointment.py | 43 ++++++++-- .../patient_assessment/patient_assessment.py | 2 + .../test_patient_assessment.py | 1 + .../patient_assessment_detail.py | 2 + .../patient_assessment_parameter.py | 2 + .../test_patient_assessment_parameter.py | 1 + .../patient_assessment_sheet.py | 2 + .../patient_assessment_template.py | 2 + .../test_patient_assessment_template.py | 1 + .../patient_encounter/patient_encounter.py | 3 +- .../patient_encounter_dashboard.py | 2 + .../test_patient_encounter.py | 2 + .../patient_encounter_diagnosis.py | 2 + .../patient_encounter_symptom.py | 2 + .../patient_history_custom_document_type.py | 2 + .../patient_history_settings.py | 8 +- .../test_patient_history_settings.py | 7 +- .../patient_history_standard_document_type.py | 2 + .../patient_medical_record.py | 2 + .../test_patient_medical_record.py | 11 ++- .../patient_relation/patient_relation.py | 2 + .../practitioner_schedule.py | 2 + .../test_practitioner_schedule.py | 2 + .../practitioner_service_unit_schedule.py | 2 + .../prescription_dosage.py | 2 + .../test_prescription_dosage.py | 2 + .../prescription_duration.py | 2 + .../test_prescription_duration.py | 2 + .../procedure_prescription.py | 2 + .../sample_collection/sample_collection.py | 4 +- .../doctype/sensitivity/sensitivity.py | 2 + .../doctype/sensitivity/test_sensitivity.py | 1 + .../sensitivity_test_result.py | 2 + .../doctype/therapy_plan/test_therapy_plan.py | 20 +++-- .../doctype/therapy_plan/therapy_plan.py | 2 + .../therapy_plan/therapy_plan_dashboard.py | 2 + .../therapy_plan_detail.py | 2 + .../test_therapy_plan_template.py | 1 + .../therapy_plan_template.py | 3 + .../therapy_plan_template_dashboard.py | 2 + .../therapy_plan_template_detail.py | 2 + .../therapy_session/test_therapy_session.py | 1 + .../therapy_session/therapy_session.py | 16 ++-- .../therapy_session_dashboard.py | 2 + .../doctype/therapy_type/test_therapy_type.py | 4 +- .../doctype/therapy_type/therapy_type.py | 7 +- .../test_treatment_plan_template.py | 1 + .../treatment_plan_template.py | 1 + .../treatment_plan_template_item.py | 1 + .../treatment_plan_template_practitioner.py | 1 + .../doctype/vital_signs/test_vital_signs.py | 1 + .../doctype/vital_signs/vital_signs.py | 4 +- .../page/patient_history/patient_history.py | 6 +- .../page/patient_progress/patient_progress.py | 8 +- .../inpatient_medication_orders.py | 7 +- .../test_inpatient_medication_orders.py | 28 ++++-- .../report/lab_test_report/lab_test_report.py | 4 +- .../patient_appointment_analytics.py | 9 +- erpnext/healthcare/setup.py | 4 +- erpnext/healthcare/utils.py | 14 ++- .../healthcare/web_form/lab_test/lab_test.py | 1 + .../patient_appointments.py | 1 + .../patient_registration.py | 1 + .../web_form/prescription/prescription.py | 1 + erpnext/hooks.py | 1 + .../hotels/doctype/hotel_room/hotel_room.py | 2 + .../doctype/hotel_room/test_hotel_room.py | 4 +- .../hotel_room_amenity/hotel_room_amenity.py | 2 + .../hotel_room_package/hotel_room_package.py | 2 + .../test_hotel_room_package.py | 4 +- .../hotel_room_pricing/hotel_room_pricing.py | 2 + .../test_hotel_room_pricing.py | 4 +- .../hotel_room_pricing_item.py | 2 + .../hotel_room_pricing_package.py | 2 + .../test_hotel_room_pricing_package.py | 4 +- .../hotel_room_reservation.py | 10 ++- .../test_hotel_room_reservation.py | 10 ++- .../hotel_room_reservation_item.py | 2 + .../hotel_room_type/hotel_room_type.py | 2 + .../hotel_room_type/test_hotel_room_type.py | 4 +- .../doctype/hotel_settings/hotel_settings.py | 2 + .../hotel_settings/test_hotel_settings.py | 4 +- .../hotel_room_occupancy.py | 2 + .../appointment_letter/appointment_letter.py | 2 + .../test_appointment_letter.py | 1 + .../appointment_letter_content.py | 2 + .../appointment_letter_template.py | 2 + .../test_appointment_letter_template.py | 1 + erpnext/hr/doctype/appraisal/appraisal.py | 9 +- .../hr/doctype/appraisal/test_appraisal.py | 3 +- .../doctype/appraisal_goal/appraisal_goal.py | 3 +- .../appraisal_template/appraisal_template.py | 5 +- .../appraisal_template_dashboard.py | 2 + .../test_appraisal_template.py | 3 +- .../appraisal_template_goal.py | 3 +- erpnext/hr/doctype/attendance/attendance.py | 7 +- .../attendance/attendance_dashboard.py | 2 + .../hr/doctype/attendance/test_attendance.py | 3 +- .../attendance_request/attendance_request.py | 7 +- .../attendance_request_dashboard.py | 1 + .../test_attendance_request.py | 5 +- erpnext/hr/doctype/branch/branch.py | 3 +- erpnext/hr/doctype/branch/test_branch.py | 2 +- .../compensatory_leave_request.py | 15 +++- .../test_compensatory_leave_request.py | 8 +- .../daily_work_summary/daily_work_summary.py | 8 +- .../test_daily_work_summary.py | 6 +- .../daily_work_summary_group.py | 5 +- .../daily_work_summary_group_user.py | 2 + erpnext/hr/doctype/department/department.py | 5 +- .../hr/doctype/department/test_department.py | 4 +- .../department_approver.py | 2 + erpnext/hr/doctype/designation/designation.py | 3 +- .../doctype/designation/test_designation.py | 2 +- .../designation_skill/designation_skill.py | 2 + erpnext/hr/doctype/driver/driver.py | 2 + erpnext/hr/doctype/driver/test_driver.py | 1 + .../driving_license_category.py | 2 + erpnext/hr/doctype/employee/employee.py | 18 ++-- .../hr/doctype/employee/employee_dashboard.py | 2 + .../hr/doctype/employee/employee_reminders.py | 4 +- erpnext/hr/doctype/employee/test_employee.py | 10 ++- .../employee/test_employee_reminders.py | 19 +++-- .../employee_advance/employee_advance.py | 6 +- .../employee_advance_dashboard.py | 2 + .../employee_advance/test_employee_advance.py | 12 ++- .../employee_attendance_tool.py | 4 +- .../employee_boarding_activity.py | 2 + .../employee_checkin/employee_checkin.py | 10 ++- .../employee_checkin/test_employee_checkin.py | 12 ++- .../employee_education/employee_education.py | 3 +- .../employee_external_work_history.py | 3 +- .../doctype/employee_grade/employee_grade.py | 2 + .../employee_grade_dashboard.py | 1 + .../employee_grade/test_employee_grade.py | 4 +- .../employee_grievance/employee_grievance.py | 1 + .../test_employee_grievance.py | 6 +- .../doctype/employee_group/employee_group.py | 2 + .../employee_group/test_employee_group.py | 6 +- .../employee_group_table.py | 2 + .../employee_health_insurance.py | 2 + .../test_employee_health_insurance.py | 4 +- .../employee_internal_work_history.py | 3 +- .../employee_onboarding.py | 5 +- .../test_employee_onboarding.py | 11 ++- .../employee_onboarding_activity.py | 2 + .../employee_onboarding_template.py | 2 + .../employee_onboarding_template_dashboard.py | 2 + .../test_employee_onboarding_template.py | 4 +- .../employee_promotion/employee_promotion.py | 3 + .../test_employee_promotion.py | 7 +- .../employee_property_history.py | 2 + .../employee_referral/employee_referral.py | 6 +- .../employee_referral_dashboard.py | 1 + .../test_employee_referral.py | 10 ++- .../employee_separation.py | 2 + .../test_employee_separation.py | 3 +- .../employee_separation_template.py | 2 + .../employee_separation_template_dashboard.py | 2 + .../test_employee_separation_template.py | 4 +- .../doctype/employee_skill/employee_skill.py | 2 + .../employee_skill_map/employee_skill_map.py | 2 + .../employee_training/employee_training.py | 2 + .../employee_transfer/employee_transfer.py | 3 + .../test_employee_transfer.py | 7 +- .../employee_transfer_property.py | 2 + .../test_employee_transfer_property.py | 4 +- .../employment_type/employment_type.py | 3 +- .../employment_type/test_employment_type.py | 2 +- .../hr/doctype/expense_claim/expense_claim.py | 18 ++-- .../expense_claim/expense_claim_dashboard.py | 2 + .../expense_claim/test_expense_claim.py | 8 +- .../expense_claim_account.py | 2 + .../expense_claim_advance.py | 2 + .../expense_claim_detail.py | 3 +- .../expense_claim_type/expense_claim_type.py | 2 + .../test_expense_claim_type.py | 3 +- .../expense_taxes_and_charges.py | 2 + .../doctype/grievance_type/grievance_type.py | 1 + .../grievance_type/test_grievance_type.py | 1 + erpnext/hr/doctype/holiday/holiday.py | 3 +- .../hr/doctype/holiday_list/holiday_list.py | 14 +-- .../holiday_list/holiday_list_dashboard.py | 1 + .../doctype/holiday_list/test_holiday_list.py | 5 +- erpnext/hr/doctype/hr_settings/hr_settings.py | 1 - .../doctype/hr_settings/test_hr_settings.py | 9 +- .../identification_document_type.py | 2 + .../test_identification_document_type.py | 4 +- erpnext/hr/doctype/interest/interest.py | 2 + erpnext/hr/doctype/interest/test_interest.py | 3 +- .../hr/doctype/job_applicant/job_applicant.py | 4 +- .../job_applicant/job_applicant_dashboard.py | 2 + .../job_applicant/test_job_applicant.py | 3 +- .../job_applicant_source.py | 2 + .../test_job_applicant_source.py | 1 + erpnext/hr/doctype/job_offer/job_offer.py | 6 +- .../hr/doctype/job_offer/test_job_offer.py | 8 +- .../doctype/job_offer_term/job_offer_term.py | 2 + erpnext/hr/doctype/job_opening/job_opening.py | 11 ++- .../job_opening/job_opening_dashboard.py | 2 + .../doctype/job_opening/test_job_opening.py | 3 +- .../leave_allocation/leave_allocation.py | 12 ++- .../leave_allocation_dashboard.py | 2 + .../leave_allocation/test_leave_allocation.py | 13 ++- .../leave_application/leave_application.py | 29 ++++++- .../test_leave_application.py | 20 +++-- .../leave_block_list/leave_block_list.py | 2 + .../leave_block_list_dashboard.py | 1 + .../leave_block_list/test_leave_block_list.py | 4 +- .../leave_block_list_allow.py | 3 +- .../leave_block_list_date.py | 3 +- .../leave_control_panel.py | 7 +- .../test_leave_control_panel.py | 4 +- .../leave_encashment/leave_encashment.py | 13 ++- .../leave_encashment/test_leave_encashment.py | 14 +-- .../leave_ledger_entry/leave_ledger_entry.py | 6 +- .../test_leave_ledger_entry.py | 1 + .../hr/doctype/leave_period/leave_period.py | 7 +- .../leave_period/leave_period_dashboard.py | 2 + .../doctype/leave_period/test_leave_period.py | 5 +- .../hr/doctype/leave_policy/leave_policy.py | 2 + .../leave_policy/leave_policy_dashboard.py | 2 + .../doctype/leave_policy/test_leave_policy.py | 4 +- .../leave_policy_assignment.py | 11 ++- .../leave_policy_assignment_dashboard.py | 2 + .../test_leave_policy_assignment.py | 13 ++- .../leave_policy_detail.py | 2 + .../test_leave_policy_detail.py | 4 +- erpnext/hr/doctype/leave_type/leave_type.py | 8 +- .../leave_type/leave_type_dashboard.py | 1 + erpnext/hr/doctype/offer_term/offer_term.py | 2 + .../hr/doctype/offer_term/test_offer_term.py | 3 +- .../purpose_of_travel/purpose_of_travel.py | 2 + .../test_purpose_of_travel.py | 4 +- .../shift_assignment/shift_assignment.py | 6 +- .../shift_assignment/test_shift_assignment.py | 5 +- .../hr/doctype/shift_request/shift_request.py | 3 + .../shift_request/shift_request_dashboard.py | 2 + .../shift_request/test_shift_request.py | 6 +- erpnext/hr/doctype/shift_type/shift_type.py | 15 +++- .../shift_type/shift_type_dashboard.py | 2 + .../hr/doctype/shift_type/test_shift_type.py | 4 +- erpnext/hr/doctype/skill/skill.py | 2 + .../hr/doctype/staffing_plan/staffing_plan.py | 6 +- .../staffing_plan/staffing_plan_dashboard.py | 2 + .../staffing_plan/test_staffing_plan.py | 12 ++- .../staffing_plan_detail.py | 2 + .../training_event/test_training_event.py | 7 +- .../doctype/training_event/training_event.py | 5 +- .../training_event_dashboard.py | 2 + .../training_event_employee.py | 2 + .../test_training_feedback.py | 11 ++- .../training_feedback/training_feedback.py | 4 +- .../training_program/test_training_program.py | 1 + .../training_program/training_program.py | 2 + .../training_program_dashboard.py | 2 + .../training_result/test_training_result.py | 3 +- .../training_result/training_result.py | 3 + .../training_result_employee.py | 2 + .../travel_itinerary/travel_itinerary.py | 2 + .../travel_request/test_travel_request.py | 4 +- .../doctype/travel_request/travel_request.py | 3 + .../travel_request_costing.py | 2 + .../test_upload_attendance.py | 8 +- .../upload_attendance/upload_attendance.py | 7 +- erpnext/hr/doctype/vehicle/test_vehicle.py | 6 +- erpnext/hr/doctype/vehicle/vehicle.py | 4 +- .../hr/doctype/vehicle/vehicle_dashboard.py | 2 + .../doctype/vehicle_log/test_vehicle_log.py | 7 +- erpnext/hr/doctype/vehicle_log/vehicle_log.py | 6 +- .../vehicle_service/vehicle_service.py | 2 + .../training_feedback/training_feedback.py | 1 + .../training_scheduled/training_scheduled.py | 1 + .../organizational_chart.py | 2 + erpnext/hr/page/team_updates/team_updates.py | 1 + .../daily_work_summary_replies.py | 5 +- .../employee_advance_summary.py | 4 +- .../employee_analytics/employee_analytics.py | 2 + .../employee_birthday/employee_birthday.py | 2 + .../employee_leave_balance.py | 13 ++- .../employee_leave_balance_summary.py | 10 ++- .../employees_working_on_a_holiday.py | 1 + .../monthly_attendance_sheet.py | 8 +- .../recruitment_analytics.py | 2 + .../vehicle_expenses/test_vehicle_expenses.py | 8 +- .../vehicle_expenses/vehicle_expenses.py | 5 +- erpnext/hr/utils.py | 25 +++++- .../job_application/job_application.py | 1 + erpnext/hub_node/__init__.py | 2 + erpnext/hub_node/api.py | 4 +- .../hub_tracked_item/hub_tracked_item.py | 2 + .../hub_tracked_item/test_hub_tracked_item.py | 4 +- erpnext/hub_node/doctype/hub_user/hub_user.py | 2 + .../hub_node/doctype/hub_users/hub_users.py | 2 + .../marketplace_settings.py | 14 ++- .../test_marketplace_settings.py | 4 +- erpnext/hub_node/legacy.py | 10 ++- .../top_10_pledged_loan_securities.py | 8 +- erpnext/loan_management/doctype/loan/loan.py | 20 +++-- .../doctype/loan/loan_dashboard.py | 2 + .../loan_management/doctype/loan/test_loan.py | 56 +++++++++--- .../loan_application/loan_application.py | 25 ++++-- .../loan_application_dashboard.py | 2 + .../loan_application/test_loan_application.py | 12 ++- .../loan_disbursement/loan_disbursement.py | 19 +++-- .../test_loan_disbursement.py | 42 +++++++-- .../loan_interest_accrual.py | 22 ++++- .../test_loan_interest_accrual.py | 39 +++++++-- .../doctype/loan_repayment/loan_repayment.py | 35 ++++++-- .../loan_repayment/test_loan_repayment.py | 1 + .../loan_repayment_detail.py | 2 + .../doctype/loan_security/loan_security.py | 2 + .../loan_security/loan_security_dashboard.py | 2 + .../loan_security/test_loan_security.py | 1 + .../loan_security_pledge.py | 13 ++- .../test_loan_security_pledge.py | 1 + .../loan_security_price.py | 11 ++- .../test_loan_security_price.py | 1 + .../loan_security_shortfall.py | 9 +- .../test_loan_security_shortfall.py | 1 + .../loan_security_type/loan_security_type.py | 2 + .../loan_security_type_dashboard.py | 2 + .../test_loan_security_type.py | 1 + .../loan_security_unpledge.py | 16 +++- .../test_loan_security_unpledge.py | 1 + .../doctype/loan_type/loan_type.py | 2 + .../doctype/loan_type/loan_type_dashboard.py | 2 + .../doctype/loan_type/test_loan_type.py | 1 + .../doctype/loan_write_off/loan_write_off.py | 10 ++- .../loan_write_off/test_loan_write_off.py | 1 + .../loan_management/doctype/pledge/pledge.py | 2 + .../doctype/pledge/test_pledge.py | 1 + .../process_loan_interest_accrual.py | 11 ++- ...process_loan_interest_accrual_dashboard.py | 2 + .../test_process_loan_interest_accrual.py | 1 + .../process_loan_security_shortfall.py | 9 +- ...ocess_loan_security_shortfall_dashboard.py | 2 + .../test_process_loan_security_shortfall.py | 1 + .../proposed_pledge/proposed_pledge.py | 2 + .../repayment_schedule/repayment_schedule.py | 2 + .../salary_slip_loan/salary_slip_loan.py | 2 + .../sanctioned_loan_amount.py | 2 + .../test_sanctioned_loan_amount.py | 1 + .../doctype/unpledge/unpledge.py | 2 + .../applicant_wise_loan_security_exposure.py | 7 +- .../loan_interest_report.py | 11 ++- .../loan_repayment_and_closure.py | 2 + .../loan_security_exposure.py | 11 ++- .../loan_security_status.py | 2 + .../maintenance_schedule.py | 11 +-- .../test_maintenance_schedule.py | 10 ++- .../maintenance_schedule_detail.py | 2 + .../maintenance_schedule_item.py | 2 + .../maintenance_visit/maintenance_visit.py | 2 + .../test_maintenance_visit.py | 3 +- .../maintenance_visit_purpose.py | 2 + erpnext/manufacturing/dashboard_fixtures.py | 9 +- .../doctype/blanket_order/blanket_order.py | 4 +- .../blanket_order/blanket_order_dashboard.py | 2 + .../blanket_order/test_blanket_order.py | 6 +- .../blanket_order_item/blanket_order_item.py | 2 + erpnext/manufacturing/doctype/bom/bom.py | 24 +++--- .../doctype/bom/bom_dashboard.py | 2 + erpnext/manufacturing/doctype/bom/test_bom.py | 12 ++- .../bom_explosion_item/bom_explosion_item.py | 3 +- .../doctype/bom_item/bom_item.py | 3 +- .../doctype/bom_operation/bom_operation.py | 3 +- .../doctype/bom_scrap_item/bom_scrap_item.py | 2 + .../bom_update_tool/bom_update_tool.py | 13 ++- .../bom_update_tool/test_bom_update_tool.py | 7 +- .../bom_website_item/bom_website_item.py | 2 + .../bom_website_operation.py | 2 + .../doctype/downtime_entry/downtime_entry.py | 4 +- .../downtime_entry/test_downtime_entry.py | 1 + .../doctype/job_card/job_card.py | 27 ++++-- .../doctype/job_card/job_card_dashboard.py | 2 + .../doctype/job_card/test_job_card.py | 7 +- .../doctype/job_card_item/job_card_item.py | 2 + .../job_card_operation/job_card_operation.py | 2 + .../job_card_time_log/job_card_time_log.py | 2 + .../manufacturing_settings.py | 4 +- .../test_manufacturing_settings.py | 1 + .../material_request_plan_item.py | 2 + .../test_material_request_plan_item.py | 1 + .../doctype/operation/operation.py | 1 + .../doctype/operation/operation_dashboard.py | 2 + .../doctype/operation/test_operation.py | 3 +- .../production_plan/production_plan.py | 31 +++++-- .../production_plan_dashboard.py | 2 + .../production_plan/test_production_plan.py | 22 +++-- .../production_plan_item.py | 3 +- .../production_plan_item_reference.py | 2 + .../production_plan_material_request.py | 2 + ...duction_plan_material_request_warehouse.py | 2 + ...duction_plan_material_request_warehouse.py | 1 + .../production_plan_sales_order.py | 3 +- .../production_plan_sub_assembly_item.py | 2 + .../manufacturing/doctype/routing/routing.py | 4 +- .../doctype/routing/routing_dashboard.py | 2 + .../doctype/routing/test_routing.py | 7 +- .../doctype/sub_operation/sub_operation.py | 2 + .../sub_operation/test_sub_operation.py | 1 + .../doctype/work_order/test_work_order.py | 30 +++++-- .../doctype/work_order/work_order.py | 44 +++++++--- .../work_order/work_order_dashboard.py | 2 + .../work_order_item/work_order_item.py | 2 + .../work_order_operation.py | 2 + .../doctype/workstation/test_workstation.py | 14 ++- .../doctype/workstation/workstation.py | 19 ++++- .../workstation/workstation_dashboard.py | 2 + .../workstation_working_hour.py | 2 + .../material_request_receipt_notification.py | 1 + .../report/bom_explorer/bom_explorer.py | 5 +- .../bom_operations_time.py | 2 + .../bom_stock_calculated.py | 2 + .../bom_stock_report/bom_stock_report.py | 2 + .../bom_variance_report.py | 2 + .../cost_of_poor_quality_report.py | 2 + .../downtime_analysis/downtime_analysis.py | 4 +- .../exponential_smoothing_forecasting.py | 8 +- .../job_card_summary/job_card_summary.py | 7 +- .../production_analytics.py | 5 +- .../production_plan_summary.py | 2 + .../production_planning_report.py | 2 + .../quality_inspection_summary.py | 2 + .../work_order_stock_report.py | 4 +- .../work_order_summary/work_order_summary.py | 7 +- .../certification_application.py | 2 + .../test_certification_application.py | 4 +- .../certified_consultant.py | 2 + .../test_certified_consultant.py | 4 +- erpnext/non_profit/doctype/chapter/chapter.py | 2 + .../doctype/chapter/test_chapter.py | 1 + .../doctype/chapter_member/chapter_member.py | 2 + .../non_profit/doctype/donation/donation.py | 10 ++- .../doctype/donation/donation_dashboard.py | 2 + .../doctype/donation/test_donation.py | 5 +- erpnext/non_profit/doctype/donor/donor.py | 4 +- .../non_profit/doctype/donor/test_donor.py | 1 + .../doctype/donor_type/donor_type.py | 2 + .../doctype/donor_type/test_donor_type.py | 2 +- .../grant_application/grant_application.py | 4 +- .../test_grant_application.py | 1 + erpnext/non_profit/doctype/member/member.py | 7 +- .../doctype/member/member_dashboard.py | 2 + .../non_profit/doctype/member/test_member.py | 1 + .../doctype/membership/membership.py | 16 ++-- .../doctype/membership/test_membership.py | 6 +- .../membership_type/membership_type.py | 4 +- .../membership_type/test_membership_type.py | 1 + .../non_profit_settings.py | 2 + .../test_non_profit_settings.py | 1 + .../doctype/volunteer/test_volunteer.py | 1 + .../non_profit/doctype/volunteer/volunteer.py | 4 +- .../volunteer_skill/volunteer_skill.py | 2 + .../volunteer_type/test_volunteer_type.py | 1 + .../doctype/volunteer_type/volunteer_type.py | 2 + .../expiring_memberships.py | 4 +- .../certification_application.py | 1 + .../certification_application_usd.py | 1 + .../grant_application/grant_application.py | 1 + .../v10_0/add_default_cash_flow_mappers.py | 1 + erpnext/patches/v10_0/delete_hub_documents.py | 1 + ...ier_des_ecritures_comptables_for_france.py | 3 + ...ry_settings_to_daily_work_summary_group.py | 1 + .../v10_0/rename_offer_letter_to_job_offer.py | 2 + .../rename_price_to_rate_in_pricing_rule.py | 2 + .../v10_0/set_currency_in_pricing_rule.py | 2 + .../v10_0/update_translatable_fields.py | 1 + .../transfer_subscription_to_auto_repeat.py | 1 + ..._default_dispatch_notification_template.py | 1 + .../add_default_email_template_for_leave.py | 6 +- .../add_expense_claim_default_account.py | 2 + .../add_healthcare_service_unit_tree_root.py | 2 + .../v11_0/add_index_on_nestedset_doctypes.py | 2 + .../patches/v11_0/add_item_group_defaults.py | 2 + erpnext/patches/v11_0/add_market_segments.py | 2 + .../v11_0/add_permissions_in_gst_settings.py | 2 + erpnext/patches/v11_0/add_sales_stages.py | 3 + ...eck_buying_selling_in_currency_exchange.py | 2 + .../v11_0/create_default_success_action.py | 3 + ...ate_department_records_for_each_company.py | 2 + .../create_salary_structure_assignments.py | 10 ++- .../v11_0/drop_column_max_days_allowed.py | 2 + .../v11_0/ewaybill_fields_gst_india.py | 3 + erpnext/patches/v11_0/hr_ux_cleanups.py | 2 + .../v11_0/inter_state_field_for_gst.py | 5 +- ..._asset_finance_book_against_old_entries.py | 2 + .../v11_0/make_italian_localization_fields.py | 7 +- erpnext/patches/v11_0/make_job_card.py | 3 + .../v11_0/make_location_from_warehouse.py | 2 + .../v11_0/make_quality_inspection_template.py | 2 + ...efaults_to_child_table_for_multicompany.py | 2 + .../move_leave_approvers_from_employee.py | 2 + .../patches/v11_0/rebuild_tree_for_company.py | 2 + .../redesign_healthcare_billing_work_flow.py | 4 +- .../patches/v11_0/refactor_erpnext_shopify.py | 2 + ...odes_field_from_copy_fields_to_variants.py | 1 + .../v11_0/remove_modules_setup_page.py | 2 + ...onal_salary_component_additional_salary.py | 1 + .../v11_0/rename_asset_adjustment_doctype.py | 1 + erpnext/patches/v11_0/rename_bom_wo_fields.py | 2 + .../rename_duplicate_item_code_values.py | 1 + .../v11_0/rename_field_max_days_allowed.py | 2 + .../patches/v11_0/rename_health_insurance.py | 2 + .../rename_healthcare_doctype_and_fields.py | 3 +- .../patches/v11_0/rename_healthcare_fields.py | 3 +- .../rename_members_with_naming_series.py | 2 + .../rename_overproduction_percent_field.py | 4 +- .../rename_production_order_to_work_order.py | 2 + .../rename_supplier_type_to_supplier_group.py | 4 +- .../renamed_from_to_fields_in_project.py | 2 + .../reset_publish_in_hub_for_all_items.py | 2 + .../v11_0/set_default_email_template_in_hr.py | 4 +- .../v11_0/set_department_for_doctypes.py | 1 + .../patches/v11_0/set_missing_gst_hsn_code.py | 3 + .../v11_0/set_salary_component_properties.py | 2 + ...pdate_field_and_value_in_workflow_state.py | 2 + .../set_user_permissions_for_department.py | 2 + ...ip_user_permission_check_for_department.py | 1 + erpnext/patches/v11_0/uom_conversion_data.py | 6 +- .../update_account_type_in_party_type.py | 2 + .../update_allow_transfer_for_manufacture.py | 2 + ...e_backflush_subcontract_rm_based_on_bom.py | 2 + .../v11_0/update_brand_in_item_price.py | 2 + .../v11_0/update_delivery_trip_status.py | 2 + .../v11_0/update_department_lft_rgt.py | 1 + erpnext/patches/v11_0/update_hub_url.py | 2 + .../v11_0/update_sales_partner_type.py | 2 + .../patches/v11_0/update_total_qty_field.py | 2 + erpnext/patches/v11_1/delete_bom_browser.py | 2 + .../patches/v11_1/delete_scheduling_tool.py | 2 + .../patches/v11_1/make_job_card_time_logs.py | 2 + .../move_customer_lead_to_dynamic_column.py | 2 + .../patches/v11_1/rename_depends_on_lwp.py | 2 + .../v11_1/renamed_delayed_item_report.py | 2 + ...t_default_action_for_quality_inspection.py | 2 + .../v11_1/set_missing_opportunity_from.py | 2 + .../v11_1/set_missing_title_for_quotation.py | 1 + .../v11_1/set_salary_details_submittable.py | 2 + ...s_for_material_request_type_manufacture.py | 2 + erpnext/patches/v11_1/set_variant_based_on.py | 2 + erpnext/patches/v11_1/setup_guardian_role.py | 2 + .../v11_1/update_bank_transaction_status.py | 2 + ...pdate_default_supplier_in_item_defaults.py | 2 + .../v11_1/woocommerce_set_creation_user.py | 2 + .../add_company_link_to_einvoice_settings.py | 2 + ...default_buying_selling_terms_in_company.py | 1 + ...ocument_type_field_for_italy_einvoicing.py | 4 +- .../v12_0/add_einvoice_status_field.py | 3 + ...add_einvoice_summary_report_permissions.py | 2 + .../v12_0/add_eway_bill_in_delivery_note.py | 1 + .../v12_0/add_ewaybill_validity_field.py | 2 + .../add_export_type_field_in_party_master.py | 3 + .../add_gst_category_in_delivery_note.py | 2 + .../add_permission_in_lower_deduction.py | 1 + .../v12_0/add_state_code_for_ladakh.py | 2 + .../v12_0/add_taxjar_integration_field.py | 1 + .../add_variant_of_in_item_attribute_table.py | 1 + ...counting_dimensions_in_missing_doctypes.py | 2 + .../create_default_energy_point_rules.py | 2 + .../create_irs_1099_field_united_states.py | 3 + .../create_itc_reversal_custom_fields.py | 3 + .../v12_0/create_taxable_value_field.py | 2 + .../v12_0/delete_priority_property_setter.py | 1 + .../fix_percent_complete_for_projects.py | 1 + .../v12_0/fix_quotation_expired_status.py | 1 + .../v12_0/generate_leave_ledger_entries.py | 2 + .../patches/v12_0/make_item_manufacturer.py | 2 + .../move_bank_account_swift_number_to_bank.py | 2 + ...e_credit_limit_to_customer_credit_limit.py | 2 + ...ve_due_advance_amount_to_pending_amount.py | 2 + .../move_item_tax_to_item_tax_template.py | 6 +- .../v12_0/move_plaid_settings_to_doctype.py | 1 + ...arget_distribution_from_parent_to_child.py | 2 + .../v12_0/recalculate_requested_qty_in_bin.py | 5 +- .../remove_bank_remittance_custom_fields.py | 3 + .../remove_denied_leaves_from_leave_ledger.py | 2 + .../remove_duplicate_leave_ledger_entries.py | 2 + .../remove_patient_medical_record_page.py | 2 + .../v12_0/rename_account_type_doctype.py | 2 + ..._account_field_in_journal_entry_account.py | 2 + .../v12_0/rename_bank_reconciliation.py | 2 + .../rename_bank_reconciliation_fields.py | 1 + .../v12_0/rename_lost_reason_detail.py | 2 + .../v12_0/rename_mws_settings_fields.py | 1 + .../v12_0/rename_pos_closing_doctype.py | 2 + .../rename_pricing_rule_child_doctypes.py | 1 + .../patches/v12_0/rename_tolerance_fields.py | 1 + ...counting_with_accounts_in_home_settings.py | 1 + ...ock_ledger_entries_for_target_warehouse.py | 2 + ...anket_order_in_sales_and_purchase_order.py | 1 + ...eferred_accounting_in_accounts_settings.py | 2 + ..._center_in_child_table_of_expense_claim.py | 2 + .../set_cwip_and_delete_asset_settings.py | 1 + .../v12_0/set_default_homepage_type.py | 1 + .../v12_0/set_default_payroll_based_on.py | 2 + .../v12_0/set_default_shopify_app_type.py | 2 + ...se_account_in_landed_cost_voucher_taxes.py | 2 + erpnext/patches/v12_0/set_gst_category.py | 2 + ...ian_import_supplier_invoice_permissions.py | 3 + erpnext/patches/v12_0/set_multi_uom_in_rfq.py | 3 + .../patches/v12_0/set_payment_entry_status.py | 1 + .../v12_0/set_permission_einvoicing.py | 4 +- .../patches/v12_0/set_priority_for_support.py | 1 + ...qty_field_in_sales_order_for_work_order.py | 2 + .../set_production_capacity_in_workstation.py | 2 + .../set_published_in_hub_tracked_item.py | 2 + ...t_purchase_receipt_delivery_note_detail.py | 5 +- erpnext/patches/v12_0/set_quotation_status.py | 2 + ...ty_in_material_request_as_per_stock_uom.py | 2 + erpnext/patches/v12_0/set_serial_no_status.py | 2 + erpnext/patches/v12_0/set_task_status.py | 1 + .../v12_0/set_updated_purpose_in_pick_list.py | 1 + ...t_valid_till_date_in_supplier_quotation.py | 2 + .../patches/v12_0/setup_einvoice_fields.py | 3 + .../show_einvoice_irn_cancelled_field.py | 2 + .../patches/v12_0/stock_entry_enhancements.py | 2 + .../patches/v12_0/unhide_cost_center_field.py | 2 + ...er_supplier_based_on_type_of_item_price.py | 1 + .../update_address_template_for_india.py | 3 + ...te_appointment_reminder_scheduler_entry.py | 1 + erpnext/patches/v12_0/update_bom_in_so_mr.py | 2 + .../patches/v12_0/update_due_date_in_gle.py | 2 + ...e_end_date_and_status_in_email_campaign.py | 2 + .../v12_0/update_ewaybill_field_position.py | 3 + erpnext/patches/v12_0/update_gst_category.py | 2 + .../update_healthcare_refactored_changes.py | 3 +- .../v12_0/update_is_cancelled_field.py | 2 + .../v12_0/update_item_tax_template_company.py | 2 + ...r_fields_in_acc_dimension_custom_fields.py | 7 +- .../update_price_list_currency_in_bom.py | 5 +- .../v12_0/update_price_or_product_discount.py | 2 + .../v12_0/update_pricing_rule_fields.py | 1 + .../update_state_code_for_daman_and_diu.py | 2 + .../v12_0/update_uom_conversion_factor.py | 6 +- .../v12_0/update_vehicle_no_reqd_condition.py | 1 + .../add_custom_field_for_south_africa.py | 5 +- .../add_missing_fg_item_for_stock_entry.py | 6 +- .../add_naming_series_to_old_projects.py | 7 +- .../patches/v13_0/add_po_to_global_search.py | 1 + .../v13_0/add_standard_navbar_items.py | 2 + ...r_rejected_quantity_in_purchase_invoice.py | 2 + .../v13_0/change_default_pos_print_format.py | 2 + .../v13_0/check_is_income_tax_component.py | 5 +- .../convert_qi_parameter_to_link_field.py | 2 + ...are_custom_fields_in_stock_entry_detail.py | 2 + ..._based_on_employee_current_leave_policy.py | 1 + .../v13_0/create_uae_pos_invoice_fields.py | 2 + ...delete_old_bank_reconciliation_doctypes.py | 1 + .../v13_0/delete_old_purchase_reports.py | 2 + .../patches/v13_0/delete_old_sales_reports.py | 2 + .../patches/v13_0/delete_orphaned_tables.py | 1 + .../delete_report_requested_items_to_order.py | 1 + .../v13_0/drop_razorpay_payload_column.py | 2 + .../fix_non_unique_represents_company.py | 1 + .../v13_0/germany_make_custom_fields.py | 1 + .../healthcare_lab_module_rename_doctypes.py | 1 + .../item_reposting_for_incorrect_sl_and_gl.py | 6 +- .../loyalty_points_entry_for_pos_invoice.py | 1 + .../v13_0/make_non_standard_user_type.py | 3 + .../v13_0/move_branch_code_to_bank_account.py | 1 + ...rts_and_notification_from_hr_to_payroll.py | 1 + ...oll_setting_separately_from_hr_settings.py | 1 + ..._from_payroll_period_to_income_tax_slab.py | 1 + ...itional_salary_encashment_and_incentive.py | 1 + .../v13_0/print_uom_after_quantity_patch.py | 2 + ...tribute_field_from_item_variant_setting.py | 1 + .../rename_discharge_date_in_ip_record.py | 2 + ...ame_discharge_ordered_date_in_ip_record.py | 2 + .../v13_0/rename_issue_doctype_fields.py | 2 + .../rename_issue_status_hold_to_on_hold.py | 2 + ...bership_settings_to_non_profit_settings.py | 2 + .../rename_stop_to_send_birthday_reminders.py | 1 + ...eplace_pos_page_with_point_of_sale_page.py | 2 + .../v13_0/replace_pos_payment_mode_table.py | 1 + ...e_date_for_intracompany_payment_entries.py | 1 + erpnext/patches/v13_0/set_app_name.py | 1 + ...et_company_field_in_healthcare_doctypes.py | 2 + .../set_company_in_leave_ledger_entry.py | 1 + ..._operation_time_based_on_operating_cost.py | 1 + ...ment_channel_in_payment_gateway_account.py | 2 + .../v13_0/set_pos_closing_as_failed.py | 2 + .../v13_0/set_training_event_attendance.py | 2 + erpnext/patches/v13_0/set_youtube_video_id.py | 3 + ..._custom_roles_for_some_regional_reports.py | 3 + ...fields_for_80g_certificate_and_donation.py | 2 + .../setup_gratuity_rule_for_india_and_uae.py | 2 + ..._history_settings_for_standard_doctypes.py | 3 + erpnext/patches/v13_0/setup_uae_vat_fields.py | 2 + .../patches/v13_0/stock_entry_enhancements.py | 2 + .../update_actual_start_and_end_date_in_wo.py | 1 + ...update_amt_in_work_order_required_items.py | 1 + .../v13_0/update_custom_fields_for_shopify.py | 7 +- .../patches/v13_0/update_deferred_settings.py | 2 + .../v13_0/update_export_type_for_gst.py | 1 + .../patches/v13_0/update_job_card_details.py | 2 + erpnext/patches/v13_0/update_level_in_bom.py | 2 + .../v13_0/update_member_email_address.py | 2 + erpnext/patches/v13_0/update_old_loans.py | 15 +++- .../v13_0/update_payment_terms_outstanding.py | 2 + .../update_pos_closing_entry_in_merge_log.py | 2 + .../v13_0/update_project_template_tasks.py | 2 + ...date_reason_for_resignation_in_employee.py | 2 + .../v13_0/update_recipient_email_digest.py | 2 + .../v13_0/update_returned_qty_in_pr_dn.py | 2 + .../patches/v13_0/update_shipment_status.py | 1 + .../patches/v13_0/update_sla_enhancements.py | 1 + ...start_end_date_for_old_shift_assignment.py | 1 + erpnext/patches/v13_0/update_subscription.py | 2 + ...date_subscription_status_in_memberships.py | 1 + .../patches/v13_0/update_tds_check_field.py | 1 + .../patches/v13_0/update_timesheet_changes.py | 2 + .../updates_for_multi_currency_payroll.py | 1 + .../v13_0/validate_options_for_data_field.py | 2 + erpnext/patches/v4_2/repost_reserved_qty.py | 5 +- .../v4_2/update_requested_and_ordered_qty.py | 4 +- ...e_item_description_based_on_item_master.py | 2 + ...oles_from_gst_report_non_indian_account.py | 2 + erpnext/patches/v8_1/setup_gst_india.py | 2 + .../patches/v8_7/sync_india_custom_fields.py | 5 +- .../additional_salary/additional_salary.py | 7 +- .../test_additional_salary.py | 13 ++- .../employee_benefit_application.py | 21 ++++- .../test_employee_benefit_application.py | 2 + .../employee_benefit_application_detail.py | 2 + .../employee_benefit_claim.py | 13 ++- .../test_employee_benefit_claim.py | 2 + .../employee_incentive/employee_incentive.py | 3 + .../test_employee_incentive.py | 4 +- .../employee_other_income.py | 2 + .../test_employee_other_income.py | 1 + .../employee_tax_exemption_category.py | 2 + .../test_employee_tax_exemption_category.py | 4 +- .../employee_tax_exemption_declaration.py | 16 +++- ...test_employee_tax_exemption_declaration.py | 6 +- ...oyee_tax_exemption_declaration_category.py | 2 + ...employee_tax_exemption_proof_submission.py | 14 ++- ...employee_tax_exemption_proof_submission.py | 10 ++- ...e_tax_exemption_proof_submission_detail.py | 2 + .../employee_tax_exemption_sub_category.py | 4 +- ...est_employee_tax_exemption_sub_category.py | 4 +- erpnext/payroll/doctype/gratuity/gratuity.py | 6 +- .../doctype/gratuity/gratuity_dashboard.py | 2 + .../payroll/doctype/gratuity/test_gratuity.py | 15 ++-- .../gratuity_applicable_component.py | 2 + .../doctype/gratuity_rule/gratuity_rule.py | 4 +- .../gratuity_rule/gratuity_rule_dashboard.py | 2 + .../gratuity_rule/test_gratuity_rule.py | 1 + .../gratuity_rule_slab/gratuity_rule_slab.py | 2 + .../income_tax_slab/income_tax_slab.py | 5 +- .../income_tax_slab/test_income_tax_slab.py | 1 + .../income_tax_slab_other_charges.py | 2 + .../payroll_employee_detail.py | 2 + .../doctype/payroll_entry/payroll_entry.py | 28 ++++-- .../payroll_entry/payroll_entry_dashboard.py | 2 + .../payroll_entry/test_payroll_entry.py | 34 ++++++-- .../doctype/payroll_period/payroll_period.py | 5 +- .../payroll_period_dashboard.py | 2 + .../payroll_period/test_payroll_period.py | 4 +- .../payroll_period_date.py | 2 + .../payroll_settings/payroll_settings.py | 6 +- .../payroll_settings/test_payroll_settings.py | 1 + .../retention_bonus/retention_bonus.py | 6 +- .../retention_bonus/test_retention_bonus.py | 4 +- .../salary_component/salary_component.py | 2 + .../salary_component/test_salary_component.py | 3 +- .../doctype/salary_detail/salary_detail.py | 2 + .../doctype/salary_slip/salary_slip.py | 55 ++++++++---- .../doctype/salary_slip/test_salary_slip.py | 49 ++++++++--- .../salary_slip_leave/salary_slip_leave.py | 2 + .../salary_slip_timesheet.py | 2 + .../salary_structure/salary_structure.py | 9 +- .../salary_structure_dashboard.py | 2 + .../salary_structure/test_salary_structure.py | 23 +++-- .../salary_structure_assignment.py | 4 +- .../test_salary_structure_assignment.py | 4 +- .../taxable_salary_slab.py | 2 + .../retention_bonus/retention_bonus.py | 1 + .../report/bank_remittance/bank_remittance.py | 7 +- .../income_tax_deductions.py | 6 +- .../salary_payments_based_on_payment_mode.py | 10 ++- .../salary_payments_via_ecs.py | 6 +- .../report/salary_register/salary_register.py | 8 +- erpnext/portal/doctype/homepage/homepage.py | 2 + .../portal/doctype/homepage/test_homepage.py | 4 +- .../homepage_featured_product.py | 2 + .../homepage_section/homepage_section.py | 2 + .../homepage_section/test_homepage_section.py | 4 +- .../homepage_section_card.py | 2 + .../products_settings/products_settings.py | 4 +- .../test_products_settings.py | 4 +- .../website_attribute/website_attribute.py | 2 + .../website_filter_field.py | 2 + .../item_variants_cache.py | 1 + .../test_product_configurator.py | 7 +- erpnext/portal/product_configurator/utils.py | 4 +- erpnext/portal/utils.py | 9 +- .../doctype/activity_cost/activity_cost.py | 2 + .../activity_cost/test_activity_cost.py | 4 +- .../doctype/activity_type/activity_type.py | 2 + .../activity_type/test_activity_type.py | 2 +- .../doctype/dependent_task/dependent_task.py | 2 + erpnext/projects/doctype/project/project.py | 24 ++++-- .../doctype/project/project_dashboard.py | 2 + .../projects/doctype/project/test_project.py | 5 +- .../project_template/project_template.py | 4 +- .../project_template_dashboard.py | 1 + .../project_template/test_project_template.py | 5 +- .../project_template_task.py | 2 + .../doctype/project_type/project_type.py | 4 +- .../doctype/project_type/test_project_type.py | 1 + .../doctype/project_update/project_update.py | 2 + .../project_update/test_project_update.py | 4 +- .../doctype/project_user/project_user.py | 2 + .../projects_settings/projects_settings.py | 2 + .../test_projects_settings.py | 4 +- erpnext/projects/doctype/task/task.py | 2 +- erpnext/projects/doctype/task/test_task.py | 7 +- .../task_depends_on/task_depends_on.py | 2 + .../projects/doctype/task_type/task_type.py | 2 + .../doctype/task_type/test_task_type.py | 4 +- .../doctype/timesheet/test_timesheet.py | 26 ++++-- .../projects/doctype/timesheet/timesheet.py | 31 +++++-- .../doctype/timesheet/timesheet_dashboard.py | 2 + .../timesheet_detail/timesheet_detail.py | 2 + erpnext/projects/report/billing_summary.py | 4 +- .../daily_timesheet_summary.py | 2 + .../delayed_tasks_summary.py | 2 + .../test_delayed_tasks_summary.py | 6 +- .../employee_billing_summary.py | 3 + ...ee_hours_utilization_based_on_timesheet.py | 2 + .../test_employee_util.py | 9 +- .../project_billing_summary.py | 3 + .../project_profitability.py | 2 + .../test_project_profitability.py | 11 ++- .../report/project_summary/project_summary.py | 2 + .../project_wise_stock_tracking.py | 1 + erpnext/projects/utils.py | 2 + erpnext/projects/web_form/tasks/tasks.py | 1 + .../non_conformance/non_conformance.py | 2 + .../non_conformance/test_non_conformance.py | 1 + .../doctype/quality_action/quality_action.py | 2 + .../quality_action/test_quality_action.py | 4 +- .../quality_action_resolution.py | 2 + .../quality_feedback/quality_feedback.py | 2 + .../quality_feedback/test_quality_feedback.py | 3 +- .../quality_feedback_parameter.py | 2 + .../quality_feedback_template.py | 2 + .../test_quality_feedback_template.py | 4 +- .../quality_feedback_template_parameter.py | 2 + .../doctype/quality_goal/quality_goal.py | 3 +- .../doctype/quality_goal/test_quality_goal.py | 9 +- .../quality_goal_objective.py | 2 + .../quality_meeting/quality_meeting.py | 2 + .../quality_meeting/test_quality_meeting.py | 4 +- .../quality_meeting_agenda.py | 2 + .../test_quality_meeting_agenda.py | 1 + .../quality_meeting_minutes.py | 2 + .../quality_procedure/quality_procedure.py | 4 +- .../test_quality_procedure.py | 4 +- .../quality_procedure_process.py | 2 + .../doctype/quality_review/quality_review.py | 2 + .../quality_review/test_quality_review.py | 4 +- .../quality_review_objective.py | 2 + erpnext/regional/__init__.py | 3 + erpnext/regional/address_template/setup.py | 2 + .../test_regional_address_template.py | 6 +- .../doctype/datev_settings/datev_settings.py | 2 + .../datev_settings/test_datev_settings.py | 1 + .../e_invoice_request_log.py | 2 + .../test_e_invoice_request_log.py | 1 + .../e_invoice_settings/e_invoice_settings.py | 1 + .../test_e_invoice_settings.py | 1 + .../doctype/e_invoice_user/e_invoice_user.py | 2 + .../doctype/gst_hsn_code/gst_hsn_code.py | 2 + .../doctype/gst_hsn_code/test_gst_hsn_code.py | 4 +- .../doctype/gst_settings/gst_settings.py | 10 ++- .../doctype/gst_settings/test_gst_settings.py | 4 +- .../doctype/gstr_3b_report/gstr_3b_report.py | 10 ++- .../gstr_3b_report/test_gstr_3b_report.py | 8 +- .../import_supplier_invoice.py | 16 ++-- .../test_import_supplier_invoice.py | 1 + .../lower_deduction_certificate.py | 5 +- .../test_lower_deduction_certificate.py | 1 + .../south_africa_vat_settings.py | 1 + .../test_south_africa_vat_settings.py | 1 + .../tax_exemption_80g_certificate.py | 7 +- .../test_tax_exemption_80g_certificate.py | 13 ++- .../tax_exemption_80g_certificate_detail.py | 2 + .../uae_vat_account/uae_vat_account.py | 2 + .../uae_vat_settings/test_uae_vat_settings.py | 1 + .../uae_vat_settings/uae_vat_settings.py | 2 + erpnext/regional/france/setup.py | 1 + erpnext/regional/france/utils.py | 2 + erpnext/regional/germany/setup.py | 1 + .../regional/germany/utils/datev/datev_csv.py | 5 +- erpnext/regional/india/__init__.py | 1 + erpnext/regional/india/e_invoice/utils.py | 33 +++++-- erpnext/regional/india/setup.py | 11 ++- erpnext/regional/india/test_utils.py | 4 +- erpnext/regional/india/utils.py | 32 ++++--- erpnext/regional/italy/setup.py | 9 +- erpnext/regional/italy/utils.py | 8 +- erpnext/regional/report/datev/datev.py | 11 ++- erpnext/regional/report/datev/test_datev.py | 29 ++++--- .../e_invoice_summary/e_invoice_summary.py | 2 + .../electronic_invoice_register.py | 2 + .../regional/report/eway_bill/eway_bill.py | 5 +- .../fichier_des_ecritures_comptables_[fec].py | 7 +- .../gst_itemised_purchase_register.py | 5 +- .../gst_itemised_sales_register.py | 1 + .../gst_purchase_register.py | 1 + .../gst_sales_register/gst_sales_register.py | 1 + erpnext/regional/report/gstr_1/gstr_1.py | 11 ++- erpnext/regional/report/gstr_2/gstr_2.py | 6 +- .../hsn_wise_summary_of_outward_supplies.py | 11 ++- erpnext/regional/report/irs_1099/irs_1099.py | 6 +- .../professional_tax_deductions.py | 7 +- .../provident_fund_deductions.py | 4 +- .../report/uae_vat_201/test_uae_vat_201.py | 18 ++-- .../report/uae_vat_201/uae_vat_201.py | 2 + .../vat_audit_report/test_vat_audit_report.py | 8 +- .../vat_audit_report/vat_audit_report.py | 5 +- erpnext/regional/saudi_arabia/setup.py | 2 +- erpnext/regional/south_africa/setup.py | 1 + erpnext/regional/turkey/setup.py | 1 + .../regional/united_arab_emirates/setup.py | 7 +- .../regional/united_arab_emirates/utils.py | 7 +- erpnext/regional/united_states/setup.py | 2 + .../united_states/test_united_states.py | 5 +- .../doctype/restaurant/restaurant.py | 2 + .../restaurant/restaurant_dashboard.py | 2 + .../doctype/restaurant/test_restaurant.py | 3 +- .../restaurant_menu/restaurant_menu.py | 2 + .../restaurant_menu/test_restaurant_menu.py | 3 +- .../restaurant_menu_item.py | 2 + .../restaurant_order_entry.py | 9 +- .../restaurant_order_entry_item.py | 2 + .../restaurant_reservation.py | 5 +- .../test_restaurant_reservation.py | 4 +- .../restaurant_table/restaurant_table.py | 6 +- .../restaurant_table/test_restaurant_table.py | 3 +- erpnext/selling/doctype/campaign/campaign.py | 3 +- .../doctype/campaign/campaign_dashboard.py | 2 + .../selling/doctype/campaign/test_campaign.py | 2 +- erpnext/selling/doctype/customer/customer.py | 26 ++++-- .../selling/doctype/customer/test_customer.py | 12 +-- .../customer_credit_limit.py | 2 + .../doctype/industry_type/industry_type.py | 3 +- .../industry_type/test_industry_type.py | 2 +- .../installation_note/installation_note.py | 6 +- .../test_installation_note.py | 3 +- .../installation_note_item.py | 3 +- .../doctype/product_bundle/product_bundle.py | 7 +- .../product_bundle/test_product_bundle.py | 2 +- .../product_bundle_item.py | 2 + .../selling/doctype/quotation/quotation.py | 5 +- .../doctype/quotation/quotation_dashboard.py | 2 + .../doctype/quotation/test_quotation.py | 11 ++- .../doctype/quotation_item/quotation_item.py | 3 +- .../doctype/sales_order/sales_order.py | 30 ++++--- .../sales_order/sales_order_dashboard.py | 2 + .../doctype/sales_order/test_sales_order.py | 58 ++++++++----- .../sales_order_item/sales_order_item.py | 3 +- .../sales_partner_type/sales_partner_type.py | 2 + .../test_sales_partner_type.py | 1 + .../selling/doctype/sales_team/sales_team.py | 3 +- .../selling_settings/selling_settings.py | 5 +- .../selling_settings/test_selling_settings.py | 1 + .../selling/doctype/sms_center/sms_center.py | 9 +- .../page/point_of_sale/point_of_sale.py | 8 +- .../selling/page/sales_funnel/sales_funnel.py | 6 +- .../address_and_contacts.py | 6 +- .../available_stock_for_packing_items.py | 2 + .../customer_acquisition_and_loyalty.py | 3 + .../customer_credit_balance.py | 5 +- .../customer_wise_item_price.py | 3 +- .../inactive_customers/inactive_customers.py | 4 +- .../item_wise_sales_history.py | 2 + .../pending_so_items_for_purchase_request.py | 2 + ...t_pending_so_items_for_purchase_request.py | 10 ++- .../quotation_trends/quotation_trends.py | 5 +- .../report/sales_analytics/sales_analytics.py | 7 +- .../report/sales_analytics/test_analytics.py | 8 +- .../sales_order_analysis.py | 7 +- .../sales_order_trends/sales_order_trends.py | 5 +- .../sales_partner_commission_summary.py | 3 +- .../item_group_wise_sales_target_variance.py | 9 +- ...ner_target_variance_based_on_item_group.py | 7 +- .../sales_partner_transaction_summary.py | 3 +- .../sales_person_commission_summary.py | 3 +- ...son_target_variance_based_on_item_group.py | 7 +- .../sales_person_wise_transaction_summary.py | 5 +- ...ory_target_variance_based_on_item_group.py | 7 +- .../territory_wise_sales.py | 5 +- erpnext/setup/default_energy_point_rules.py | 1 + erpnext/setup/default_success_action.py | 1 + .../authorization_control.py | 7 +- .../authorization_rule/authorization_rule.py | 6 +- .../test_authorization_rule.py | 3 +- erpnext/setup/doctype/brand/brand.py | 4 +- erpnext/setup/doctype/brand/test_brand.py | 2 +- erpnext/setup/doctype/company/company.py | 21 +++-- .../doctype/company/company_dashboard.py | 2 + erpnext/setup/doctype/company/test_company.py | 10 ++- .../currency_exchange/currency_exchange.py | 4 +- .../test_currency_exchange.py | 9 +- .../doctype/customer_group/customer_group.py | 3 +- .../customer_group/test_customer_group.py | 1 + .../doctype/email_digest/email_digest.py | 25 ++++-- erpnext/setup/doctype/email_digest/quotes.py | 2 + .../doctype/email_digest/test_email_digest.py | 3 +- .../email_digest_recipient.py | 2 + .../global_defaults/global_defaults.py | 4 +- .../global_defaults/test_global_defaults.py | 4 +- .../setup/doctype/item_group/item_group.py | 18 ++-- .../doctype/item_group/test_item_group.py | 12 ++- .../doctype/naming_series/naming_series.py | 10 +-- .../setup/doctype/party_type/party_type.py | 2 + .../doctype/party_type/test_party_type.py | 3 +- .../doctype/print_heading/print_heading.py | 3 +- .../print_heading/test_print_heading.py | 2 +- .../quotation_lost_reason.py | 3 +- .../test_quotation_lost_reason.py | 2 +- .../quotation_lost_reason_detail.py | 2 + .../doctype/sales_partner/sales_partner.py | 4 +- .../sales_partner/test_sales_partner.py | 2 +- .../doctype/sales_person/sales_person.py | 3 + .../sales_person/sales_person_dashboard.py | 2 + .../doctype/sales_person/test_sales_person.py | 1 + .../doctype/supplier_group/supplier_group.py | 2 + .../supplier_group/test_supplier_group.py | 1 + .../doctype/target_detail/target_detail.py | 3 +- .../terms_and_conditions.py | 8 +- .../test_terms_and_conditions.py | 2 +- erpnext/setup/doctype/territory/territory.py | 5 +- .../setup/doctype/territory/test_territory.py | 2 +- .../test_transaction_deletion_record.py | 4 +- .../transaction_deletion_record.py | 6 +- .../transaction_deletion_record_item.py | 2 + erpnext/setup/doctype/uom/test_uom.py | 2 +- erpnext/setup/doctype/uom/uom.py | 3 +- .../test_uom_conversion_factor.py | 1 + .../uom_conversion_factor.py | 2 + .../website_item_group/website_item_group.py | 3 +- erpnext/setup/install.py | 14 +-- .../setup_wizard/data/dashboard_charts.py | 7 +- .../setup/setup_wizard/data/industry_type.py | 2 + .../setup_wizard/operations/company_setup.py | 6 +- .../operations/default_website.py | 3 +- .../setup_wizard/operations/defaults_setup.py | 2 + .../operations/install_fixtures.py | 10 ++- .../setup_wizard/operations/sample_data.py | 8 +- .../setup_wizard/operations/taxes_setup.py | 2 +- erpnext/setup/setup_wizard/setup_wizard.py | 5 +- erpnext/setup/setup_wizard/utils.py | 6 +- erpnext/setup/utils.py | 6 +- erpnext/shopping_cart/cart.py | 12 ++- .../shopping_cart_settings.py | 5 +- .../test_shopping_cart_settings.py | 10 ++- erpnext/shopping_cart/filters.py | 2 + erpnext/shopping_cart/product_info.py | 10 ++- erpnext/shopping_cart/product_query.py | 2 + erpnext/shopping_cart/search.py | 4 +- erpnext/shopping_cart/test_shopping_cart.py | 9 +- erpnext/shopping_cart/utils.py | 6 +- erpnext/startup/__init__.py | 1 - erpnext/startup/boot.py | 2 + erpnext/startup/filters.py | 1 + erpnext/startup/leaderboard.py | 4 +- erpnext/startup/notifications.py | 2 + erpnext/stock/__init__.py | 1 + erpnext/stock/dashboard/item_dashboard.py | 3 +- .../dashboard/warehouse_capacity_dashboard.py | 5 +- .../warehouse_wise_stock_value.py | 7 +- erpnext/stock/doctype/batch/batch.py | 9 +- erpnext/stock/doctype/batch/test_batch.py | 8 +- erpnext/stock/doctype/bin/bin.py | 4 +- erpnext/stock/doctype/bin/test_bin.py | 3 +- .../customs_tariff_number.py | 2 + .../test_customs_tariff_number.py | 4 +- .../doctype/delivery_note/delivery_note.py | 16 ++-- .../delivery_note/delivery_note_dashboard.py | 2 + .../delivery_note/test_delivery_note.py | 60 ++++++++----- .../delivery_note_item/delivery_note_item.py | 3 +- .../delivery_settings/delivery_settings.py | 2 + .../test_delivery_settings.py | 4 +- .../doctype/delivery_stop/delivery_stop.py | 2 + .../doctype/delivery_trip/delivery_trip.py | 2 +- .../delivery_trip/test_delivery_trip.py | 11 ++- erpnext/stock/doctype/item/item.py | 38 ++++++--- erpnext/stock/doctype/item/item_dashboard.py | 2 + erpnext/stock/doctype/item/test_item.py | 26 ++++-- .../item_alternative/item_alternative.py | 2 + .../item_alternative/test_item_alternative.py | 24 ++++-- .../doctype/item_attribute/item_attribute.py | 10 ++- .../item_attribute/test_item_attribute.py | 5 +- .../item_attribute_value.py | 2 + .../item_customer_detail.py | 3 +- .../doctype/item_default/item_default.py | 2 + .../item_manufacturer/item_manufacturer.py | 1 + .../test_item_manufacturer.py | 1 + .../stock/doctype/item_price/item_price.py | 1 + .../doctype/item_price/test_item_price.py | 5 +- .../item_quality_inspection_parameter.py | 3 +- .../doctype/item_reorder/item_reorder.py | 3 +- .../doctype/item_supplier/item_supplier.py | 3 +- erpnext/stock/doctype/item_tax/item_tax.py | 3 +- .../doctype/item_variant/item_variant.py | 2 + .../item_variant_attribute.py | 2 + .../item_variant_settings.py | 4 +- .../test_item_variant_settings.py | 1 + .../item_website_specification.py | 3 +- .../landed_cost_item/landed_cost_item.py | 3 +- .../landed_cost_purchase_receipt.py | 3 +- .../landed_cost_taxes_and_charges.py | 2 + .../landed_cost_voucher.py | 12 ++- .../test_landed_cost_voucher.py | 21 +++-- .../doctype/manufacturer/manufacturer.py | 7 +- .../doctype/manufacturer/test_manufacturer.py | 3 +- .../material_request/material_request.py | 15 ++-- .../material_request_dashboard.py | 1 + .../material_request/test_material_request.py | 16 +++- .../material_request_item.py | 3 +- .../stock/doctype/packed_item/packed_item.py | 9 +- .../doctype/packing_slip/test_packing_slip.py | 3 +- .../packing_slip_item/packing_slip_item.py | 3 +- erpnext/stock/doctype/pick_list/pick_list.py | 17 ++-- .../doctype/pick_list/pick_list_dashboard.py | 2 + .../stock/doctype/pick_list/test_pick_list.py | 12 ++- .../doctype/pick_list_item/pick_list_item.py | 2 + .../stock/doctype/price_list/price_list.py | 10 ++- .../doctype/price_list/test_price_list.py | 1 + .../price_list_country/price_list_country.py | 2 + .../purchase_receipt/purchase_receipt.py | 17 ++-- .../purchase_receipt_dashboard.py | 2 + .../purchase_receipt/test_purchase_receipt.py | 82 ++++++++++++------ .../purchase_receipt_item.py | 3 +- .../doctype/putaway_rule/putaway_rule.py | 12 ++- .../doctype/putaway_rule/test_putaway_rule.py | 14 +-- .../quality_inspection/quality_inspection.py | 12 ++- .../quality_inspection_parameter.py | 2 + .../test_quality_inspection_parameter.py | 1 + .../quality_inspection_parameter_group.py | 2 + ...test_quality_inspection_parameter_group.py | 1 + .../quality_inspection_reading.py | 3 +- .../quality_inspection_template.py | 2 + .../test_quality_inspection_template.py | 1 + .../quick_stock_balance.py | 3 + .../repost_item_valuation.py | 20 +++-- .../test_repost_item_valuation.py | 1 + erpnext/stock/doctype/serial_no/serial_no.py | 15 ++-- .../stock/doctype/serial_no/test_serial_no.py | 10 ++- erpnext/stock/doctype/shipment/shipment.py | 7 +- .../stock/doctype/shipment/test_shipment.py | 5 +- .../shipment_delivery_note.py | 2 + .../shipment_parcel/shipment_parcel.py | 2 + .../shipment_parcel_template.py | 2 + .../test_shipment_parcel_template.py | 1 + .../stock/doctype/stock_entry/stock_entry.py | 43 ++++++---- .../doctype/stock_entry/stock_entry_utils.py | 7 +- .../doctype/stock_entry/test_stock_entry.py | 41 ++++++--- .../stock_entry_detail/stock_entry_detail.py | 3 +- .../stock_entry_type/stock_entry_type.py | 2 + .../stock_entry_type/test_stock_entry_type.py | 4 +- .../stock_ledger_entry/stock_ledger_entry.py | 14 +-- .../test_stock_ledger_entry.py | 24 ++++-- .../stock_reconciliation.py | 23 +++-- .../test_stock_reconciliation.py | 25 ++++-- .../stock_reconciliation_item.py | 2 + .../doctype/stock_settings/stock_settings.py | 6 +- .../stock_settings/test_stock_settings.py | 4 +- .../doctype/uom_category/test_uom_category.py | 1 + .../doctype/uom_category/uom_category.py | 2 + .../uom_conversion_detail.py | 3 +- .../variant_field/test_variant_field.py | 1 + .../doctype/variant_field/variant_field.py | 2 + .../stock/doctype/warehouse/test_warehouse.py | 6 +- erpnext/stock/doctype/warehouse/warehouse.py | 13 ++- .../warehouse_type/test_warehouse_type.py | 1 + .../doctype/warehouse_type/warehouse_type.py | 2 + erpnext/stock/get_item_details.py | 26 +++--- erpnext/stock/reorder_item.py | 10 ++- .../batch_item_expiry_status.py | 4 +- erpnext/stock/report/bom_search/bom_search.py | 5 +- .../cogs_by_item_group/cogs_by_item_group.py | 3 +- .../delayed_item_report.py | 2 + .../delayed_order_report.py | 3 + .../delivery_note_trends.py | 5 +- ...incorrect_balance_qty_after_transaction.py | 3 +- .../incorrect_serial_no_valuation.py | 5 +- .../incorrect_stock_value_report.py | 9 +- .../item_price_stock/item_price_stock.py | 2 + .../stock/report/item_prices/item_prices.py | 4 +- .../item_shortage_report.py | 2 + .../item_variant_details.py | 2 + .../itemwise_recommended_reorder_level.py | 3 +- .../process_loss_report.py | 3 +- .../product_bundle_balance.py | 4 +- .../purchase_receipt_trends.py | 5 +- .../serial_no_ledger/serial_no_ledger.py | 5 +- .../stock/report/stock_ageing/stock_ageing.py | 8 +- .../report/stock_analytics/stock_analytics.py | 9 +- .../stock_analytics/test_stock_analytics.py | 2 +- .../stock_and_account_value_comparison.py | 9 +- .../report/stock_balance/stock_balance.py | 15 ++-- .../stock/report/stock_ledger/stock_ledger.py | 9 +- .../stock_projected_qty.py | 8 +- .../stock_qty_vs_serial_no_count.py | 2 + .../supplier_wise_sales_analytics.py | 2 + .../total_stock_summary.py | 2 + ...rehouse_wise_item_balance_age_and_value.py | 18 ++-- erpnext/stock/stock_balance.py | 9 +- erpnext/stock/stock_ledger.py | 21 +++-- erpnext/stock/utils.py | 10 ++- erpnext/support/__init__.py | 1 + erpnext/support/doctype/issue/issue.py | 28 ++++-- erpnext/support/doctype/issue/test_issue.py | 11 ++- .../doctype/issue_priority/issue_priority.py | 2 + .../issue_priority/test_issue_priority.py | 4 +- .../support/doctype/issue_type/issue_type.py | 2 + .../doctype/issue_type/test_issue_type.py | 4 +- .../pause_sla_on_status.py | 2 + .../doctype/service_day/service_day.py | 2 + .../service_level_agreement.py | 5 +- .../service_level_agreement_dashboard.py | 1 + .../test_service_level_agreement.py | 5 +- .../service_level_priority.py | 2 + .../support_search_source.py | 2 + .../support_settings/support_settings.py | 2 + .../support_settings/test_support_settings.py | 1 + .../warranty_claim/test_warranty_claim.py | 3 +- .../doctype/warranty_claim/warranty_claim.py | 8 +- .../first_response_time_for_issues.py | 2 + .../report/issue_analytics/issue_analytics.py | 12 ++- .../issue_analytics/test_issue_analytics.py | 13 ++- .../report/issue_summary/issue_summary.py | 7 +- .../support_hour_distribution.py | 3 +- erpnext/support/web_form/issues/issues.py | 1 + .../telephony/doctype/call_log/call_log.py | 5 +- .../doctype/call_log/test_call_log.py | 1 + .../incoming_call_handling_schedule.py | 2 + .../incoming_call_settings.py | 7 +- .../test_incoming_call_settings.py | 1 + .../test_voice_call_settings.py | 1 + .../voice_call_settings.py | 2 + erpnext/templates/pages/cart.py | 2 + erpnext/templates/pages/courses.py | 2 +- erpnext/templates/pages/help.py | 5 +- erpnext/templates/pages/home.py | 1 + .../pages/integrations/gocardless_checkout.py | 13 ++- .../integrations/gocardless_confirmation.py | 7 +- .../templates/pages/material_request_info.py | 3 +- .../pages/non_profit/join_chapter.py | 2 + .../pages/non_profit/leave_chapter.py | 2 + erpnext/templates/pages/order.py | 12 ++- erpnext/templates/pages/partners.py | 1 + erpnext/templates/pages/product_search.py | 4 +- erpnext/templates/pages/projects.py | 5 +- .../pages/regional/india/update_gstin.py | 2 + erpnext/templates/pages/rfq.py | 3 + erpnext/templates/pages/search_help.py | 11 ++- erpnext/templates/pages/task_info.py | 3 +- erpnext/templates/pages/timelog_info.py | 3 +- erpnext/tests/test_init.py | 4 +- erpnext/tests/test_notifications.py | 4 +- erpnext/tests/test_regional.py | 8 +- erpnext/tests/test_search.py | 3 + erpnext/tests/test_subcontracting.py | 26 ++++-- erpnext/tests/test_woocommerce.py | 11 ++- erpnext/tests/ui_test_helpers.py | 1 + erpnext/tests/utils.py | 1 + erpnext/utilities/__init__.py | 5 +- erpnext/utilities/activation.py | 5 +- erpnext/utilities/bot.py | 4 +- .../doctype/rename_tool/rename_tool.py | 3 +- erpnext/utilities/doctype/sms_log/sms_log.py | 3 +- .../utilities/doctype/sms_log/test_sms_log.py | 3 +- erpnext/utilities/doctype/video/test_video.py | 1 + erpnext/utilities/doctype/video/video.py | 11 ++- .../video_settings/test_video_settings.py | 1 + .../doctype/video_settings/video_settings.py | 4 +- erpnext/utilities/hierarchy_chart.py | 2 + erpnext/utilities/product.py | 4 +- .../youtube_interactions.py | 2 + erpnext/utilities/transaction_base.py | 16 +++- .../utilities/web_form/addresses/addresses.py | 1 + erpnext/www/all-products/index.py | 11 ++- erpnext/www/book_appointment/index.py | 4 +- erpnext/www/book_appointment/verify/index.py | 3 +- erpnext/www/lms/content.py | 4 +- erpnext/www/lms/course.py | 4 +- erpnext/www/lms/index.py | 4 +- erpnext/www/lms/profile.py | 4 +- erpnext/www/lms/program.py | 4 +- erpnext/www/lms/topic.py | 4 +- erpnext/www/payment_setup_certification.py | 1 + erpnext/www/support/index.py | 2 + setup.py | 7 +- 2075 files changed, 8251 insertions(+), 2553 deletions(-) diff --git a/.github/helper/documentation.py b/.github/helper/documentation.py index b4a4ba1bbddb..1514955b306c 100644 --- a/.github/helper/documentation.py +++ b/.github/helper/documentation.py @@ -1,7 +1,7 @@ import sys -import requests from urllib.parse import urlparse +import requests docs_repos = [ "frappe_docs", diff --git a/.github/helper/semgrep_rules/frappe_correctness.py b/.github/helper/semgrep_rules/frappe_correctness.py index 745e6463b8ab..1cb2b3c45c5f 100644 --- a/.github/helper/semgrep_rules/frappe_correctness.py +++ b/.github/helper/semgrep_rules/frappe_correctness.py @@ -1,6 +1,5 @@ import frappe from frappe import _, flt - from frappe.model.document import Document diff --git a/.github/helper/semgrep_rules/report.py b/.github/helper/semgrep_rules/report.py index ff278408e181..e3a265e407bf 100644 --- a/.github/helper/semgrep_rules/report.py +++ b/.github/helper/semgrep_rules/report.py @@ -1,6 +1,5 @@ from frappe import _ - # ruleid: frappe-missing-translate-function-in-report-python {"label": "Field Label"} diff --git a/.github/helper/semgrep_rules/ux.py b/.github/helper/semgrep_rules/ux.py index a00d3cd8aef5..fa97c1e9f08e 100644 --- a/.github/helper/semgrep_rules/ux.py +++ b/.github/helper/semgrep_rules/ux.py @@ -1,6 +1,5 @@ import frappe -from frappe import msgprint, throw, _ - +from frappe import _, msgprint, throw # ruleid: frappe-missing-translate-function-python throw("Error Occured") diff --git a/erpnext/__init__.py b/erpnext/__init__.py index a988d7217db3..b123f92706bc 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -1,10 +1,13 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + import inspect + import frappe -from erpnext.hooks import regional_overrides from frappe.utils import getdate +from erpnext.hooks import regional_overrides + __version__ = '13.2.0' def get_default_company(user=None): diff --git a/erpnext/accounts/custom/address.py b/erpnext/accounts/custom/address.py index 628b71347231..a6d08d8ff610 100644 --- a/erpnext/accounts/custom/address.py +++ b/erpnext/accounts/custom/address.py @@ -1,7 +1,11 @@ import frappe from frappe import _ -from frappe.contacts.doctype.address.address import Address -from frappe.contacts.doctype.address.address import get_address_templates, get_address_display +from frappe.contacts.doctype.address.address import ( + Address, + get_address_display, + get_address_templates, +) + class ERPNextAddress(Address): def validate(self): diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index 85f54f98ba8a..e2e333ae1f71 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -2,14 +2,27 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ -from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate, get_link_to_form -from erpnext.accounts.report.general_ledger.general_ledger import execute +from frappe.utils import ( + add_to_date, + date_diff, + formatdate, + get_last_day, + get_link_to_form, + getdate, + nowdate, +) from frappe.utils.dashboard import cache_source from frappe.utils.dateutils import get_from_date_from_timespan, get_period_ending from frappe.utils.nestedset import get_descendants_of +from erpnext.accounts.report.general_ledger.general_ledger import execute + + @frappe.whitelist() @cache_source def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None, diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py index 173b1eee9a5c..612f962c627c 100644 --- a/erpnext/accounts/deferred_revenue.py +++ b/erpnext/accounts/deferred_revenue.py @@ -2,11 +2,27 @@ import frappe from frappe import _ -from frappe.utils import date_diff, add_months, today, getdate, add_days, flt, get_last_day, get_first_day, cint, get_link_to_form, rounded -from erpnext.accounts.utils import get_account_currency from frappe.email import sendmail_to_system_managers +from frappe.utils import ( + add_days, + add_months, + cint, + date_diff, + flt, + get_first_day, + get_last_day, + get_link_to_form, + getdate, + rounded, + today, +) from frappe.utils.background_jobs import enqueue -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) +from erpnext.accounts.utils import get_account_currency + def validate_service_stop_date(doc): ''' Validates service_stop_date for Purchase Invoice and Sales Invoice ''' diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index f763df0852b1..f6198eb23baa 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe import _, throw from frappe.utils import cint, cstr -from frappe import throw, _ from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_of + class RootNotEditable(frappe.ValidationError): pass class BalanceMismatchError(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index 927adc7086cd..d6ccd1693622 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals +import json +import os -import frappe, os, json +import frappe from frappe.utils import cstr -from unidecode import unidecode -from six import iteritems from frappe.utils.nestedset import rebuild_tree +from six import iteritems +from unidecode import unidecode + def create_charts(company, chart_template=None, existing_company=None, custom_chart=None): chart = custom_chart or get_chart(chart_template, existing_company) @@ -91,11 +94,14 @@ def get_chart(chart_template, existing_company=None): return get_account_tree_from_existing_company(existing_company) elif chart_template == "Standard": - from erpnext.accounts.doctype.account.chart_of_accounts.verified import standard_chart_of_accounts + from erpnext.accounts.doctype.account.chart_of_accounts.verified import ( + standard_chart_of_accounts, + ) return standard_chart_of_accounts.get() elif chart_template == "Standard with Numbers": - from erpnext.accounts.doctype.account.chart_of_accounts.verified \ - import standard_chart_of_accounts_with_account_number + from erpnext.accounts.doctype.account.chart_of_accounts.verified import ( + standard_chart_of_accounts_with_account_number, + ) return standard_chart_of_accounts_with_account_number.get() else: folders = ("verified",) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py b/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py index eb3e7ffd906d..72223573a235 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py @@ -6,12 +6,13 @@ """ from __future__ import print_function, unicode_literals -import os, json import ast +import json +import os from xml.etree import ElementTree as ET -from frappe.utils.csvutils import read_csv_content -import frappe +import frappe +from frappe.utils.csvutils import read_csv_content from six import iteritems path = "/Users/nabinhait/projects/odoo/addons" diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py index 161e52a67d0c..f058afba6a71 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get(): return { _("Application of Funds (Assets)"): { diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py index acb11e557a58..9f3395203567 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get(): return { _("Application of Funds (Assets)"): { diff --git a/erpnext/accounts/doctype/account/test_account.py b/erpnext/accounts/doctype/account/test_account.py index 533eda31d586..0c3b33e0b9ec 100644 --- a/erpnext/accounts/doctype/account/test_account.py +++ b/erpnext/accounts/doctype/account/test_account.py @@ -2,10 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe -from erpnext.stock import get_warehouse_account, get_company_default_inventory_account -from erpnext.accounts.doctype.account.account import update_account_number, merge_account + +from erpnext.accounts.doctype.account.account import merge_account, update_account_number +from erpnext.stock import get_company_default_inventory_account, get_warehouse_account + class TestAccount(unittest.TestCase): def test_rename_account(self): diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py index 4e68d8408b7f..dbc2167c355c 100644 --- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py @@ -3,15 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe import _ + import json -from frappe.model.document import Document + +import frappe +from frappe import _, scrub from frappe.custom.doctype.custom_field.custom_field import create_custom_field -from frappe import scrub +from frappe.model import core_doctypes_list +from frappe.model.document import Document from frappe.utils import cstr from frappe.utils.background_jobs import enqueue -from frappe.model import core_doctypes_list + class AccountingDimension(Document): def before_insert(self): diff --git a/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py index 4f3ee7643ab1..3769fc12707e 100644 --- a/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py @@ -3,10 +3,12 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice + +import frappe + from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice test_dependencies = ['Cost Center', 'Location', 'Warehouse', 'Department'] diff --git a/erpnext/accounts/doctype/accounting_dimension_detail/accounting_dimension_detail.py b/erpnext/accounts/doctype/accounting_dimension_detail/accounting_dimension_detail.py index 17cf549fc45b..c116f164536a 100644 --- a/erpnext/accounts/doctype/accounting_dimension_detail/accounting_dimension_detail.py +++ b/erpnext/accounts/doctype/accounting_dimension_detail/accounting_dimension_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AccountingDimensionDetail(Document): pass diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py index 6aef9caa7472..cb8c7d1c984c 100644 --- a/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py +++ b/erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, scrub from frappe.model.document import Document + class AccountingDimensionFilter(Document): def validate(self): self.validate_applicable_accounts() diff --git a/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py b/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py index 7f6254f99f5c..9968f6899164 100644 --- a/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py +++ b/erpnext/accounts/doctype/accounting_dimension_filter/test_accounting_dimension_filter.py @@ -3,10 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + +from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import ( + create_dimension, + disable_dimension, +) from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import create_dimension, disable_dimension from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError test_dependencies = ['Location', 'Cost Center', 'Department'] diff --git a/erpnext/accounts/doctype/accounting_period/accounting_period.py b/erpnext/accounts/doctype/accounting_period/accounting_period.py index 739d8f6bc63e..67d1a8a09bd0 100644 --- a/erpnext/accounts/doctype/accounting_period/accounting_period.py +++ b/erpnext/accounts/doctype/accounting_period/accounting_period.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class OverlapError(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/accounting_period/test_accounting_period.py b/erpnext/accounts/doctype/accounting_period/test_accounting_period.py index dc472c7695d2..5885b58e4818 100644 --- a/erpnext/accounts/doctype/accounting_period/test_accounting_period.py +++ b/erpnext/accounts/doctype/accounting_period/test_accounting_period.py @@ -3,12 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, add_months -from erpnext.accounts.general_ledger import ClosedAccountingPeriod + +import frappe +from frappe.utils import add_months, nowdate + from erpnext.accounts.doctype.accounting_period.accounting_period import OverlapError from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.accounts.general_ledger import ClosedAccountingPeriod test_dependencies = ['Item'] diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 62c97f24d5f6..f54473351a2f 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -4,11 +4,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cint -from frappe.model.document import Document from frappe.custom.doctype.property_setter.property_setter import make_property_setter +from frappe.model.document import Document +from frappe.utils import cint class AccountsSettings(Document): diff --git a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py index 014cf45e5184..c1c156fa65e7 100644 --- a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import unittest import frappe diff --git a/erpnext/accounts/doctype/advance_taxes_and_charges/advance_taxes_and_charges.py b/erpnext/accounts/doctype/advance_taxes_and_charges/advance_taxes_and_charges.py index 597d2ccc6251..0c98f2487462 100644 --- a/erpnext/accounts/doctype/advance_taxes_and_charges/advance_taxes_and_charges.py +++ b/erpnext/accounts/doctype/advance_taxes_and_charges/advance_taxes_and_charges.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AdvanceTaxesandCharges(Document): pass diff --git a/erpnext/accounts/doctype/allowed_dimension/allowed_dimension.py b/erpnext/accounts/doctype/allowed_dimension/allowed_dimension.py index c2afc1a26216..b5e7ad3fbe24 100644 --- a/erpnext/accounts/doctype/allowed_dimension/allowed_dimension.py +++ b/erpnext/accounts/doctype/allowed_dimension/allowed_dimension.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AllowedDimension(Document): pass diff --git a/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py index a3e4bbcd0942..3e84c3071b02 100644 --- a/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py +++ b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class AllowedToTransactWith(Document): pass diff --git a/erpnext/accounts/doctype/applicable_on_account/applicable_on_account.py b/erpnext/accounts/doctype/applicable_on_account/applicable_on_account.py index 0fccaf302fbd..91331fadd51a 100644 --- a/erpnext/accounts/doctype/applicable_on_account/applicable_on_account.py +++ b/erpnext/accounts/doctype/applicable_on_account/applicable_on_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ApplicableOnAccount(Document): pass diff --git a/erpnext/accounts/doctype/bank/bank.py b/erpnext/accounts/doctype/bank/bank.py index 99fa21c8f9ab..1f029eb81060 100644 --- a/erpnext/accounts/doctype/bank/bank.py +++ b/erpnext/accounts/doctype/bank/bank.py @@ -3,9 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.model.document import Document -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address + class Bank(Document): def onload(self): diff --git a/erpnext/accounts/doctype/bank/test_bank.py b/erpnext/accounts/doctype/bank/test_bank.py index d8741f24c542..4d76f77bf523 100644 --- a/erpnext/accounts/doctype/bank/test_bank.py +++ b/erpnext/accounts/doctype/bank/test_bank.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestBank(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_account/bank_account.py b/erpnext/accounts/doctype/bank_account/bank_account.py index 3e08c2812eff..703f55de8074 100644 --- a/erpnext/accounts/doctype/bank_account/bank_account.py +++ b/erpnext/accounts/doctype/bank_account/bank_account.py @@ -3,10 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.model.document import Document -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address + class BankAccount(Document): def onload(self): diff --git a/erpnext/accounts/doctype/bank_account/test_bank_account.py b/erpnext/accounts/doctype/bank_account/test_bank_account.py index ed34d17ee749..866964bab94e 100644 --- a/erpnext/accounts/doctype/bank_account/test_bank_account.py +++ b/erpnext/accounts/doctype/bank_account/test_bank_account.py @@ -3,11 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe -from frappe import _ -from frappe import ValidationError import unittest +import frappe +from frappe import ValidationError, _ + # test_records = frappe.get_test_records('Bank Account') class TestBankAccount(unittest.TestCase): diff --git a/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py index ab52c4af77ca..84fa0c92b802 100644 --- a/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py +++ b/erpnext/accounts/doctype/bank_account_subtype/bank_account_subtype.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class BankAccountSubtype(Document): pass diff --git a/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py index ca3addc979de..d4eb88b36567 100644 --- a/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py +++ b/erpnext/accounts/doctype/bank_account_subtype/test_bank_account_subtype.py @@ -5,5 +5,6 @@ import unittest + class TestBankAccountSubtype(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_account_type/bank_account_type.py b/erpnext/accounts/doctype/bank_account_type/bank_account_type.py index b7dc0e0dc379..bba43dc486c0 100644 --- a/erpnext/accounts/doctype/bank_account_type/bank_account_type.py +++ b/erpnext/accounts/doctype/bank_account_type/bank_account_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class BankAccountType(Document): pass diff --git a/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py b/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py index f04725a2e550..00fd4338d220 100644 --- a/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py +++ b/erpnext/accounts/doctype/bank_account_type/test_bank_account_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBankAccountType(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_clearance/bank_clearance.py b/erpnext/accounts/doctype/bank_clearance/bank_clearance.py index 79f5596384ce..340b44817850 100644 --- a/erpnext/accounts/doctype/bank_clearance/bank_clearance.py +++ b/erpnext/accounts/doctype/bank_clearance/bank_clearance.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt, getdate, nowdate, fmt_money -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.model.document import Document +from frappe.utils import flt, fmt_money, getdate, nowdate form_grid_templates = { "journal_entries": "templates/form_grid/bank_reconciliation_grid.html" diff --git a/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py index 833abde5ce33..bdf3c7f48ae1 100644 --- a/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py +++ b/erpnext/accounts/doctype/bank_clearance/test_bank_clearance.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBankClearance(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py index 59299f81e508..2086c968ac6f 100644 --- a/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py +++ b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class BankClearanceDetail(Document): pass diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py index a0aac6ab170c..8043c5f04e55 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py @@ -3,10 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json -from frappe.model.document import Document + +import json + +import frappe from frappe import _ from frappe.desk.search import sanitize_searchfield +from frappe.model.document import Document + class BankGuarantee(Document): def validate(self): diff --git a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py index 816743a9b038..380483eb2717 100644 --- a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py +++ b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestBankGuarantee(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py index 8a17233cf74b..ce64ee4f5a27 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py @@ -3,17 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import json import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import flt from erpnext import get_company_currency -from erpnext.accounts.utils import get_balance_on -from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import get_entries, get_amounts_not_reflected_in_system from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_paid_amount +from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import ( + get_amounts_not_reflected_in_system, + get_entries, +) +from erpnext.accounts.utils import get_balance_on class BankReconciliationTool(Document): diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py b/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py index d96950abbce2..55b83b6bdfe7 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBankReconciliationTool(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py index ffc9d1c46589..25d1023c270a 100644 --- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py +++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py @@ -3,22 +3,22 @@ # For license information, please see license.txt from __future__ import unicode_literals + import csv import json import re +import frappe import openpyxl +from frappe import _ +from frappe.core.doctype.data_import.data_import import DataImport +from frappe.core.doctype.data_import.importer import Importer, ImportFile +from frappe.utils.background_jobs import enqueue +from frappe.utils.xlsxutils import ILLEGAL_CHARACTERS_RE, handle_html from openpyxl.styles import Font from openpyxl.utils import get_column_letter from six import string_types -import frappe -from frappe.core.doctype.data_import.importer import Importer, ImportFile -from frappe.utils.background_jobs import enqueue -from frappe.utils.xlsxutils import handle_html, ILLEGAL_CHARACTERS_RE -from frappe import _ - -from frappe.core.doctype.data_import.data_import import DataImport class BankStatementImport(DataImport): def __init__(self, *args, **kwargs): diff --git a/erpnext/accounts/doctype/bank_statement_import/test_bank_statement_import.py b/erpnext/accounts/doctype/bank_statement_import/test_bank_statement_import.py index cd5831412d95..5b45fa204bf4 100644 --- a/erpnext/accounts/doctype/bank_statement_import/test_bank_statement_import.py +++ b/erpnext/accounts/doctype/bank_statement_import/test_bank_statement_import.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBankStatementImport(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py index 235af2d86284..29975bed7364 100644 --- a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py +++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from erpnext.controllers.status_updater import StatusUpdater +from frappe import _ from frappe.utils import flt from six.moves import reduce -from frappe import _ + +from erpnext.controllers.status_updater import StatusUpdater + class BankTransaction(StatusUpdater): def after_insert(self): diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py b/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py index dc3b86747001..e8d032be3601 100644 --- a/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py +++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe.utils import getdate from frappe.utils.dateutils import parse_date from six import iteritems + @frappe.whitelist() def upload_bank_statement(): if getattr(frappe, "uploaded_file", None): diff --git a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py index 439d4891194f..35d08bd8033e 100644 --- a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py +++ b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py @@ -3,14 +3,19 @@ # See license.txt from __future__ import unicode_literals -import frappe -import unittest import json -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice +import unittest + +import frappe + +from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import ( + get_linked_payments, + reconcile_vouchers, +) from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry -from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import reconcile_vouchers, get_linked_payments from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice test_dependencies = ["Item", "Cost Center"] diff --git a/erpnext/accounts/doctype/bank_transaction_mapping/bank_transaction_mapping.py b/erpnext/accounts/doctype/bank_transaction_mapping/bank_transaction_mapping.py index 95a5bc338833..8b809fe705d2 100644 --- a/erpnext/accounts/doctype/bank_transaction_mapping/bank_transaction_mapping.py +++ b/erpnext/accounts/doctype/bank_transaction_mapping/bank_transaction_mapping.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class BankTransactionMapping(Document): pass diff --git a/erpnext/accounts/doctype/bank_transaction_payments/bank_transaction_payments.py b/erpnext/accounts/doctype/bank_transaction_payments/bank_transaction_payments.py index d6d7c109cf51..2546f27a46e6 100644 --- a/erpnext/accounts/doctype/bank_transaction_payments/bank_transaction_payments.py +++ b/erpnext/accounts/doctype/bank_transaction_payments/bank_transaction_payments.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class BankTransactionPayments(Document): pass diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index d93b6ffbaf9c..bed8be0c5a38 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -3,13 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, getdate, add_months, get_last_day, fmt_money, nowdate +from frappe.model.document import Document from frappe.model.naming import make_autoname +from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate, nowdate + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) from erpnext.accounts.utils import get_fiscal_year -from frappe.model.document import Document -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions + class BudgetError(frappe.ValidationError): pass class DuplicateBudgetError(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/budget/test_budget.py b/erpnext/accounts/doctype/budget/test_budget.py index 6c25f0024d5e..cc8220920e32 100644 --- a/erpnext/accounts/doctype/budget/test_budget.py +++ b/erpnext/accounts/doctype/budget/test_budget.py @@ -3,13 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, now_datetime + +import frappe +from frappe.utils import now_datetime, nowdate + +from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense +from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry from erpnext.accounts.utils import get_fiscal_year from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order -from erpnext.accounts.doctype.budget.budget import get_actual_expense, BudgetError -from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry test_dependencies = ['Monthly Distribution'] diff --git a/erpnext/accounts/doctype/budget_account/budget_account.py b/erpnext/accounts/doctype/budget_account/budget_account.py index 81b2709ba8b3..cfd5d4a8b84f 100644 --- a/erpnext/accounts/doctype/budget_account/budget_account.py +++ b/erpnext/accounts/doctype/budget_account/budget_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class BudgetAccount(Document): pass diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index cfe28f3ff9f8..b1ab6481597a 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt from frappe import _ from frappe.model.document import Document +from frappe.utils import flt + class CForm(Document): def validate(self): diff --git a/erpnext/accounts/doctype/c_form/test_c_form.py b/erpnext/accounts/doctype/c_form/test_c_form.py index c4c95db0f24d..15109766fce7 100644 --- a/erpnext/accounts/doctype/c_form/test_c_form.py +++ b/erpnext/accounts/doctype/c_form/test_c_form.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('C-Form') class TestCForm(unittest.TestCase): diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py index 20e423a610ed..cc2651fa4e5e 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CFormInvoiceDetail(Document): pass diff --git a/erpnext/accounts/doctype/campaign_item/campaign_item.py b/erpnext/accounts/doctype/campaign_item/campaign_item.py index 4f5fd7f7d78c..d78fdf528589 100644 --- a/erpnext/accounts/doctype/campaign_item/campaign_item.py +++ b/erpnext/accounts/doctype/campaign_item/campaign_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class CampaignItem(Document): pass diff --git a/erpnext/accounts/doctype/cash_flow_mapper/cash_flow_mapper.py b/erpnext/accounts/doctype/cash_flow_mapper/cash_flow_mapper.py index 72515338378c..96920b329e7b 100644 --- a/erpnext/accounts/doctype/cash_flow_mapper/cash_flow_mapper.py +++ b/erpnext/accounts/doctype/cash_flow_mapper/cash_flow_mapper.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py b/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py index b1ad2972beb3..9ec466a7a6db 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py +++ b/erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cash_flow_mapping/test_cash_flow_mapping.py b/erpnext/accounts/doctype/cash_flow_mapping/test_cash_flow_mapping.py index 499c820479e7..5e44c61379b1 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping/test_cash_flow_mapping.py +++ b/erpnext/accounts/doctype/cash_flow_mapping/test_cash_flow_mapping.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + class TestCashFlowMapping(unittest.TestCase): def setUp(self): diff --git a/erpnext/accounts/doctype/cash_flow_mapping_accounts/cash_flow_mapping_accounts.py b/erpnext/accounts/doctype/cash_flow_mapping_accounts/cash_flow_mapping_accounts.py index fc63b8f9af6c..517403531920 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping_accounts/cash_flow_mapping_accounts.py +++ b/erpnext/accounts/doctype/cash_flow_mapping_accounts/cash_flow_mapping_accounts.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cash_flow_mapping_template/cash_flow_mapping_template.py b/erpnext/accounts/doctype/cash_flow_mapping_template/cash_flow_mapping_template.py index 6f77a39bab9a..fabf5796bcf7 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping_template/cash_flow_mapping_template.py +++ b/erpnext/accounts/doctype/cash_flow_mapping_template/cash_flow_mapping_template.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cash_flow_mapping_template_details/cash_flow_mapping_template_details.py b/erpnext/accounts/doctype/cash_flow_mapping_template_details/cash_flow_mapping_template_details.py index e10b63829fd7..f0ff33fb38f5 100644 --- a/erpnext/accounts/doctype/cash_flow_mapping_template_details/cash_flow_mapping_template_details.py +++ b/erpnext/accounts/doctype/cash_flow_mapping_template_details/cash_flow_mapping_template_details.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cashier_closing/cashier_closing.py b/erpnext/accounts/doctype/cashier_closing/cashier_closing.py index 081c6fa4718a..752e57eb5b78 100644 --- a/erpnext/accounts/doctype/cashier_closing/cashier_closing.py +++ b/erpnext/accounts/doctype/cashier_closing/cashier_closing.py @@ -3,10 +3,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document -from frappe.utils import cint, flt, cstr from frappe import _, msgprint, throw +from frappe.model.document import Document +from frappe.utils import cint, cstr, flt + class CashierClosing(Document): def validate(self): diff --git a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py index 3c489a78727b..f0b3a2b6c657 100644 --- a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py +++ b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCashierClosing(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py index f73703158d8c..c408a284c395 100644 --- a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py +++ b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py @@ -3,8 +3,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CashierClosingPayments(Document): pass diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py index 8456b49c8eec..61968cf627d7 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py @@ -3,14 +3,26 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import csv +import os from functools import reduce -import frappe, csv, os + +import frappe from frappe import _ -from frappe.utils import cstr, cint from frappe.model.document import Document +from frappe.utils import cint, cstr from frappe.utils.csvutils import UnicodeWriter -from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts, build_tree_from_json -from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file, read_xls_file_from_attached_file +from frappe.utils.xlsxutils import ( + read_xls_file_from_attached_file, + read_xlsx_file_from_attached_file, +) + +from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import ( + build_tree_from_json, + create_charts, +) + class ChartofAccountsImporter(Document): def validate(self): diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py index 6ab19b771bf6..9ca9dd1e4c0c 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestChartofAccountsImporter(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py index d62ee9deeb55..0f595ba933af 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class ChequePrintTemplate(Document): pass diff --git a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py index fa9c5b5eb09a..7015c51adf83 100644 --- a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Cheque Print Template') class TestChequePrintTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/closed_document/closed_document.py b/erpnext/accounts/doctype/closed_document/closed_document.py index 048ceeecbf5c..afe705ceaaee 100644 --- a/erpnext/accounts/doctype/closed_document/closed_document.py +++ b/erpnext/accounts/doctype/closed_document/closed_document.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ClosedDocument(Document): pass diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 981fec308cc9..b4cf3fc44c4e 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cint, cstr from frappe.utils.nestedset import NestedSet + from erpnext.accounts.utils import validate_field_number diff --git a/erpnext/accounts/doctype/cost_center/test_cost_center.py b/erpnext/accounts/doctype/cost_center/test_cost_center.py index 7779ccefc202..142b925c2ead 100644 --- a/erpnext/accounts/doctype/cost_center/test_cost_center.py +++ b/erpnext/accounts/doctype/cost_center/test_cost_center.py @@ -1,7 +1,9 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe test_records = frappe.get_test_records('Cost Center') diff --git a/erpnext/accounts/doctype/coupon_code/coupon_code.py b/erpnext/accounts/doctype/coupon_code/coupon_code.py index 92a816d25e99..bb2615b36106 100644 --- a/erpnext/accounts/doctype/coupon_code/coupon_code.py +++ b/erpnext/accounts/doctype/coupon_code/coupon_code.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import (strip) +from frappe.utils import strip + + class CouponCode(Document): def autoname(self): self.coupon_name = strip(self.coupon_name) diff --git a/erpnext/accounts/doctype/coupon_code/test_coupon_code.py b/erpnext/accounts/doctype/coupon_code/test_coupon_code.py index 06987a8a4a5b..321d7193f597 100644 --- a/erpnext/accounts/doctype/coupon_code/test_coupon_code.py +++ b/erpnext/accounts/doctype/coupon_code/test_coupon_code.py @@ -3,11 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe +from frappe.test_runner import make_test_objects + from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.stock.get_item_details import get_item_details -from frappe.test_runner import make_test_objects test_dependencies = ['Item'] diff --git a/erpnext/accounts/doctype/customer_group_item/customer_group_item.py b/erpnext/accounts/doctype/customer_group_item/customer_group_item.py index df782ac9e0c6..100bfd5e665f 100644 --- a/erpnext/accounts/doctype/customer_group_item/customer_group_item.py +++ b/erpnext/accounts/doctype/customer_group_item/customer_group_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class CustomerGroupItem(Document): pass diff --git a/erpnext/accounts/doctype/customer_item/customer_item.py b/erpnext/accounts/doctype/customer_item/customer_item.py index a577145e4ee0..da3533fcc685 100644 --- a/erpnext/accounts/doctype/customer_item/customer_item.py +++ b/erpnext/accounts/doctype/customer_item/customer_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class CustomerItem(Document): pass diff --git a/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py b/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py index 93dfcc14bdae..11faa773c653 100644 --- a/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py +++ b/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DiscountedInvoice(Document): pass diff --git a/erpnext/accounts/doctype/distributed_cost_center/distributed_cost_center.py b/erpnext/accounts/doctype/distributed_cost_center/distributed_cost_center.py index 48c589f0c0fb..436704008ea1 100644 --- a/erpnext/accounts/doctype/distributed_cost_center/distributed_cost_center.py +++ b/erpnext/accounts/doctype/distributed_cost_center/distributed_cost_center.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DistributedCostCenter(Document): pass diff --git a/erpnext/accounts/doctype/dunning/dunning.py b/erpnext/accounts/doctype/dunning/dunning.py index 1ef512a4894d..ed3cb1524dec 100644 --- a/erpnext/accounts/doctype/dunning/dunning.py +++ b/erpnext/accounts/doctype/dunning/dunning.py @@ -3,14 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe +from frappe.utils import cint, flt, get_datetime, getdate, rounded from six import string_types -from frappe.utils import getdate, get_datetime, rounded, flt, cint -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) from erpnext.accounts.general_ledger import make_gl_entries, make_reverse_gl_entries -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions from erpnext.controllers.accounts_controller import AccountsController +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + days_in_year, +) class Dunning(AccountsController): diff --git a/erpnext/accounts/doctype/dunning/dunning_dashboard.py b/erpnext/accounts/doctype/dunning/dunning_dashboard.py index 33c6ab080c95..fa3330f7cfd4 100644 --- a/erpnext/accounts/doctype/dunning/dunning_dashboard.py +++ b/erpnext/accounts/doctype/dunning/dunning_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'dunning', diff --git a/erpnext/accounts/doctype/dunning/test_dunning.py b/erpnext/accounts/doctype/dunning/test_dunning.py index 39ee74658ce3..5e380de5bc57 100644 --- a/erpnext/accounts/doctype/dunning/test_dunning.py +++ b/erpnext/accounts/doctype/dunning/test_dunning.py @@ -3,13 +3,19 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import add_days, today, nowdate -from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice_against_cost_center + +import frappe +from frappe.utils import add_days, nowdate, today + from erpnext.accounts.doctype.dunning.dunning import calculate_interest_and_amount from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry +from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + unlink_payment_on_cancel_of_invoice, +) +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import ( + create_sales_invoice_against_cost_center, +) class TestDunning(unittest.TestCase): diff --git a/erpnext/accounts/doctype/dunning_letter_text/dunning_letter_text.py b/erpnext/accounts/doctype/dunning_letter_text/dunning_letter_text.py index 426497b60726..b14fdc11f2a3 100644 --- a/erpnext/accounts/doctype/dunning_letter_text/dunning_letter_text.py +++ b/erpnext/accounts/doctype/dunning_letter_text/dunning_letter_text.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DunningLetterText(Document): pass diff --git a/erpnext/accounts/doctype/dunning_type/dunning_type.py b/erpnext/accounts/doctype/dunning_type/dunning_type.py index 87087484289b..64e7cf420fe2 100644 --- a/erpnext/accounts/doctype/dunning_type/dunning_type.py +++ b/erpnext/accounts/doctype/dunning_type/dunning_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DunningType(Document): pass diff --git a/erpnext/accounts/doctype/dunning_type/test_dunning_type.py b/erpnext/accounts/doctype/dunning_type/test_dunning_type.py index b2fb26f34a5e..ae08907273e3 100644 --- a/erpnext/accounts/doctype/dunning_type/test_dunning_type.py +++ b/erpnext/accounts/doctype/dunning_type/test_dunning_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestDunningType(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index dbbcedcadfa3..9c173d0c5175 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -3,13 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt from frappe.model.document import Document from frappe.model.meta import get_field_precision -from erpnext.setup.utils import get_exchange_rate +from frappe.utils import flt + +import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on +from erpnext.setup.utils import get_exchange_rate + class ExchangeRateRevaluation(Document): def validate(self): diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py index b5cfa04ed673..7358f561ed47 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'reference_name', diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py index 3b037d1dc47f..ba096b08041e 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestExchangeRateRevaluation(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py index 87d7b6734651..c8ede3f21bb7 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ExchangeRateRevaluationAccount(Document): pass diff --git a/erpnext/accounts/doctype/finance_book/finance_book.py b/erpnext/accounts/doctype/finance_book/finance_book.py index bc9fce2ce86b..cb52a4b8158b 100644 --- a/erpnext/accounts/doctype/finance_book/finance_book.py +++ b/erpnext/accounts/doctype/finance_book/finance_book.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class FinanceBook(Document): pass diff --git a/erpnext/accounts/doctype/finance_book/test_finance_book.py b/erpnext/accounts/doctype/finance_book/test_finance_book.py index 2ba21397ad0c..1f25e5a9d27d 100644 --- a/erpnext/accounts/doctype/finance_book/test_finance_book.py +++ b/erpnext/accounts/doctype/finance_book/test_finance_book.py @@ -2,11 +2,13 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry +import unittest import frappe -import unittest + +from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry + class TestFinanceBook(unittest.TestCase): def test_finance_book(self): diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 42556269fdd0..6854ac910d2e 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -2,12 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ -from frappe.utils import getdate, add_days, add_years, cstr from dateutil.relativedelta import relativedelta - +from frappe import _, msgprint from frappe.model.document import Document +from frappe.utils import add_days, add_years, cstr, getdate + class FiscalYearIncorrectDate(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py index cec4f4492d6d..b0365afa827c 100644 --- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py @@ -3,7 +3,9 @@ from __future__ import unicode_literals -import frappe, unittest +import unittest + +import frappe from erpnext.accounts.doctype.fiscal_year.fiscal_year import FiscalYearIncorrectDate diff --git a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py index 8dfc2fa7e292..a4bdb0fbe295 100644 --- a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py +++ b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class FiscalYearCompany(Document): pass diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 0844995f296e..0397253d4abf 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -2,20 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, fmt_money, getdate, formatdate, cint from frappe.model.document import Document -from frappe.model.naming import set_name_from_naming_options from frappe.model.meta import get_field_precision -from erpnext.accounts.party import validate_party_gle_currency, validate_party_frozen_disabled -from erpnext.accounts.utils import get_account_currency -from erpnext.accounts.utils import get_fiscal_year -from erpnext.exceptions import InvalidAccountCurrency, InvalidAccountDimensionError, MandatoryAccountDimensionError -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_checks_for_pl_and_bs_accounts -from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import get_dimension_filter_map +from frappe.model.naming import set_name_from_naming_options +from frappe.utils import cint, flt, fmt_money, formatdate, getdate from six import iteritems +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_checks_for_pl_and_bs_accounts, +) +from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import ( + get_dimension_filter_map, +) +from erpnext.accounts.party import validate_party_frozen_disabled, validate_party_gle_currency +from erpnext.accounts.utils import get_account_currency, get_fiscal_year +from erpnext.exceptions import ( + InvalidAccountCurrency, + InvalidAccountDimensionError, + MandatoryAccountDimensionError, +) + exclude_from_linked_with = True class GLEntry(Document): def autoname(self): diff --git a/erpnext/accounts/doctype/gl_entry/test_gl_entry.py b/erpnext/accounts/doctype/gl_entry/test_gl_entry.py index 4167ca70df2a..14959520767f 100644 --- a/erpnext/accounts/doctype/gl_entry/test_gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/test_gl_entry.py @@ -2,10 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, unittest + +import unittest + +import frappe from frappe.model.naming import parse_naming_series -from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry + from erpnext.accounts.doctype.gl_entry.gl_entry import rename_gle_sle_docs +from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry + class TestGLEntry(unittest.TestCase): def test_round_off_entry(self): diff --git a/erpnext/accounts/doctype/gst_account/gst_account.py b/erpnext/accounts/doctype/gst_account/gst_account.py index d7848495a698..80b8e9455928 100644 --- a/erpnext/accounts/doctype/gst_account/gst_account.py +++ b/erpnext/accounts/doctype/gst_account/gst_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class GSTAccount(Document): pass diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py index b73d8bfbb11a..8867f1cd9bfc 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py @@ -3,12 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json, erpnext + +import json + +import frappe from frappe import _ -from frappe.utils import flt, getdate, nowdate, add_days -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import add_days, flt, getdate, nowdate + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions +from erpnext.controllers.accounts_controller import AccountsController + class InvoiceDiscounting(AccountsController): def validate(self): diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py index 6d35ca243976..bab8e46c31e1 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'reference_name', diff --git a/erpnext/accounts/doctype/invoice_discounting/test_invoice_discounting.py b/erpnext/accounts/doctype/invoice_discounting/test_invoice_discounting.py index 919dd0cba779..58aea92e817f 100644 --- a/erpnext/accounts/doctype/invoice_discounting/test_invoice_discounting.py +++ b/erpnext/accounts/doctype/invoice_discounting/test_invoice_discounting.py @@ -3,13 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import nowdate, add_days, flt import unittest -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries + +import frappe +from frappe.utils import add_days, flt, nowdate + from erpnext.accounts.doctype.account.test_account import create_account from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry_against_invoice +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries + + class TestInvoiceDiscounting(unittest.TestCase): def setUp(self): self.ar_credit = create_account(account_name="_Test Accounts Receivable Credit", parent_account = "Accounts Receivable - _TC", company="_Test Company") diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template.py index d9155cbab4a4..1e26afe02537 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.py +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class ItemTaxTemplate(Document): def validate(self): diff --git a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py index acf1e446e74b..49d95f020f62 100644 --- a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py +++ b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestItemTaxTemplate(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py b/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py index d51bed0520af..9ac854554abf 100644 --- a/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py +++ b/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ItemTaxTemplateDetail(Document): pass diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 72648753a7a8..848d55b38624 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -2,19 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext, json -from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, nowdate, cint, get_link_to_form -from frappe import msgprint, _, scrub -from erpnext.controllers.accounts_controller import AccountsController -from erpnext.accounts.utils import get_balance_on, get_stock_accounts, get_stock_and_account_balance, \ - get_account_currency, check_if_stock_and_account_balance_synced + +import json + +import frappe +from frappe import _, msgprint, scrub +from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, getdate, nowdate +from six import iteritems, string_types + +import erpnext +from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts +from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import ( + get_party_account_based_on_invoice_discounting, +) from erpnext.accounts.party import get_party_account +from erpnext.accounts.utils import ( + check_if_stock_and_account_balance_synced, + get_account_currency, + get_balance_on, + get_stock_accounts, + get_stock_and_account_balance, +) +from erpnext.controllers.accounts_controller import AccountsController from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount -from erpnext.accounts.doctype.invoice_discounting.invoice_discounting \ - import get_party_account_based_on_invoice_discounting -from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts -from six import string_types, iteritems class StockAccountInvalidTransaction(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/journal_entry/test_journal_entry.py b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py index 5835d462ae97..d03a08851a61 100644 --- a/erpnext/accounts/doctype/journal_entry/test_journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py @@ -2,11 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import unittest, frappe + +import unittest + +import frappe from frappe.utils import flt, nowdate + from erpnext.accounts.doctype.account.test_account import get_inventory_account -from erpnext.exceptions import InvalidAccountCurrency from erpnext.accounts.doctype.journal_entry.journal_entry import StockAccountInvalidTransaction +from erpnext.exceptions import InvalidAccountCurrency + class TestJournalEntry(unittest.TestCase): def test_journal_entry_with_against_jv(self): diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py index 2e77cf2b44e8..352b22e39548 100644 --- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class JournalEntryAccount(Document): pass diff --git a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py index e0b9cbc9193d..f0813f5e275f 100644 --- a/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py +++ b/erpnext/accounts/doctype/journal_entry_template/journal_entry_template.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class JournalEntryTemplate(Document): pass diff --git a/erpnext/accounts/doctype/journal_entry_template/test_journal_entry_template.py b/erpnext/accounts/doctype/journal_entry_template/test_journal_entry_template.py index 5f74a2042fdc..61fea94e823c 100644 --- a/erpnext/accounts/doctype/journal_entry_template/test_journal_entry_template.py +++ b/erpnext/accounts/doctype/journal_entry_template/test_journal_entry_template.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestJournalEntryTemplate(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py index 48e6abbc2846..d0408ca2fcdd 100644 --- a/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py +++ b/erpnext/accounts/doctype/journal_entry_template_account/journal_entry_template_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class JournalEntryTemplateAccount(Document): pass diff --git a/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.py b/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.py index 3579a1a96047..0813926f5f29 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.py +++ b/erpnext/accounts/doctype/loyalty_point_entry/loyalty_point_entry.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.utils import today diff --git a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py index b6e2d57b9fb3..b57169576a8f 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py +++ b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestLoyaltyPointEntry(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py b/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py index e4382b6c789a..b95464e5a099 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py +++ b/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LoyaltyPointEntryRedemption(Document): pass diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program.py index cb753a3723df..89ed461fd5d8 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program.py +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program.py @@ -3,11 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import today, flt +from frappe.utils import flt, today + class LoyaltyProgram(Document): pass diff --git a/erpnext/accounts/doctype/loyalty_program/test_loyalty_program.py b/erpnext/accounts/doctype/loyalty_program/test_loyalty_program.py index 31994885aa6b..a039e32b8b99 100644 --- a/erpnext/accounts/doctype/loyalty_program/test_loyalty_program.py +++ b/erpnext/accounts/doctype/loyalty_program/test_loyalty_program.py @@ -3,12 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import today, cint, flt, getdate -from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points + +import frappe +from frappe.utils import cint, flt, getdate, today + +from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( + get_loyalty_program_details_with_points, +) from erpnext.accounts.party import get_dashboard_info + class TestLoyaltyProgram(unittest.TestCase): @classmethod def setUpClass(self): diff --git a/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py b/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py index 42cc38cb4c2b..d2ea76e78fe3 100644 --- a/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py +++ b/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LoyaltyProgramCollection(Document): pass diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py index cea921e999e5..dfe42df226ab 100644 --- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.model.document import Document +import frappe from frappe import _ +from frappe.model.document import Document + class ModeofPayment(Document): def validate(self): diff --git a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py index ad6cd4795f34..241ec2888a46 100644 --- a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Mode of Payment') class TestModeofPayment(unittest.TestCase): diff --git a/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py b/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py index 5cb195a3ba41..4030eaca1a16 100644 --- a/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py +++ b/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ModeofPaymentAccount(Document): pass diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py index ad8623fb4eee..c0e00d620995 100644 --- a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py +++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import (flt, add_months) from frappe.model.document import Document +from frappe.utils import add_months, flt + class MonthlyDistribution(Document): @frappe.whitelist() diff --git a/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py index efbf4eb105f7..63faa158f152 100644 --- a/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py +++ b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py @@ -2,9 +2,11 @@ # See license.txt from __future__ import unicode_literals -import frappe + import unittest +import frappe + test_records = frappe.get_test_records('Monthly Distribution') class TestMonthlyDistribution(unittest.TestCase): diff --git a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py index d9e8bf9c778b..b2d3b6759b86 100644 --- a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py +++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MonthlyDistributionPercentage(Document): pass diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py index 3586e683d4db..646bc4cceb9a 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py @@ -3,14 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import traceback from json import dumps + +import frappe from frappe import _, scrub -from frappe.utils import flt, nowdate from frappe.model.document import Document +from frappe.utils import flt, nowdate from frappe.utils.background_jobs import enqueue -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) class OpeningInvoiceCreationTool(Document): diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py index 8d6de2d562f3..ed3c6a9da0a9 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py @@ -3,12 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe from frappe.cache_manager import clear_doctype_cache from frappe.custom.doctype.property_setter.property_setter import make_property_setter -from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool import get_temporary_opening_account + +from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool import ( + get_temporary_opening_account, +) test_dependencies = ["Customer", "Supplier"] diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py index d47c3e94eccd..d71a7dc99387 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class OpeningInvoiceCreationToolItem(Document): pass diff --git a/erpnext/accounts/doctype/party_account/party_account.py b/erpnext/accounts/doctype/party_account/party_account.py index 21cfb96dba43..b31bd91e5e80 100644 --- a/erpnext/accounts/doctype/party_account/party_account.py +++ b/erpnext/accounts/doctype/party_account/party_account.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PartyAccount(Document): pass diff --git a/erpnext/accounts/doctype/party_link/party_link.py b/erpnext/accounts/doctype/party_link/party_link.py index 9cbba352736e..daf667caf0c1 100644 --- a/erpnext/accounts/doctype/party_link/party_link.py +++ b/erpnext/accounts/doctype/party_link/party_link.py @@ -5,6 +5,7 @@ from frappe import _ from frappe.model.document import Document + class PartyLink(Document): def validate(self): if self.primary_role not in ['Customer', 'Supplier']: diff --git a/erpnext/accounts/doctype/party_link/test_party_link.py b/erpnext/accounts/doctype/party_link/test_party_link.py index a3ea3959ba4b..2ae338133e0e 100644 --- a/erpnext/accounts/doctype/party_link/test_party_link.py +++ b/erpnext/accounts/doctype/party_link/test_party_link.py @@ -4,5 +4,6 @@ # import frappe import unittest + class TestPartyLink(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 9f3cc85742f5..607f85c87bd5 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -3,22 +3,37 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext, json -from frappe import _, scrub, ValidationError, throw -from frappe.utils import flt, comma_or, nowdate, getdate, cint -from erpnext.accounts.utils import get_outstanding_invoices, get_account_currency, get_balance_on -from erpnext.accounts.party import get_party_account + +import json + +import frappe +from frappe import ValidationError, _, scrub, throw +from frappe.utils import cint, comma_or, flt, getdate, nowdate +from six import iteritems, string_types + +import erpnext +from erpnext.accounts.doctype.bank_account.bank_account import ( + get_bank_account_details, + get_party_bank_account, +) +from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import ( + get_party_account_based_on_invoice_discounting, +) from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account -from erpnext.setup.utils import get_exchange_rate +from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( + get_party_tax_withholding_details, +) from erpnext.accounts.general_ledger import make_gl_entries +from erpnext.accounts.party import get_party_account +from erpnext.accounts.utils import get_account_currency, get_balance_on, get_outstanding_invoices +from erpnext.controllers.accounts_controller import ( + AccountsController, + get_supplier_block_status, + validate_taxes_and_charges, +) from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount -from erpnext.accounts.doctype.bank_account.bank_account import get_party_bank_account, get_bank_account_details -from erpnext.controllers.accounts_controller import AccountsController, get_supplier_block_status -from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import get_party_account_based_on_invoice_discounting -from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import get_party_tax_withholding_details -from six import string_types, iteritems +from erpnext.setup.utils import get_exchange_rate -from erpnext.controllers.accounts_controller import validate_taxes_and_charges class InvalidPaymentEntry(ValidationError): pass diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index dac927b2cef2..c90a3c503c20 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -3,14 +3,25 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import flt, nowdate -from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order -from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, InvalidPaymentEntry -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice, create_sales_invoice_against_cost_center -from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice, make_purchase_invoice_against_cost_center + +from erpnext.accounts.doctype.payment_entry.payment_entry import ( + InvalidPaymentEntry, + get_payment_entry, +) +from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + make_purchase_invoice, + make_purchase_invoice_against_cost_center, +) +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import ( + create_sales_invoice, + create_sales_invoice_against_cost_center, +) from erpnext.hr.doctype.expense_claim.test_expense_claim import make_expense_claim +from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order test_dependencies = ["Item"] @@ -324,7 +335,10 @@ def test_payment_entry_against_si_usd_to_usd_with_deduction_in_base_currency (se self.assertEqual(flt(pe.unallocated_amount, 2), 0.0) def test_payment_entry_retrieves_last_exchange_rate(self): - from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records, save_new_records + from erpnext.setup.doctype.currency_exchange.test_currency_exchange import ( + save_new_records, + test_records, + ) save_new_records(test_records) diff --git a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py index d6686bbe4227..2829322ba328 100644 --- a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py +++ b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentEntryDeduction(Document): pass diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py index 51f8c06165ae..497d145e14b2 100644 --- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py +++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentEntryReference(Document): pass diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py index 3529c16a1c27..1d8a8ac5e19c 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py +++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentGatewayAccount(Document): def autoname(self): self.name = self.payment_gateway + " - " + self.currency diff --git a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py index 84c3bc4a600f..3a0ed549fb9f 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py +++ b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Payment Gateway Account') class TestPaymentGatewayAccount(unittest.TestCase): diff --git a/erpnext/accounts/doctype/payment_order/payment_order.py b/erpnext/accounts/doctype/payment_order/payment_order.py index 8d29ae70ae7c..e9b5ad9dc4d6 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order.py +++ b/erpnext/accounts/doctype/payment_order/payment_order.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.model.document import Document from frappe.utils import nowdate + from erpnext.accounts.party import get_party_account -from frappe.model.document import Document + class PaymentOrder(Document): def on_submit(self): diff --git a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py index a4f335833ee5..c82f54793663 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py +++ b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'payment_order', diff --git a/erpnext/accounts/doctype/payment_order/test_payment_order.py b/erpnext/accounts/doctype/payment_order/test_payment_order.py index 9ba57aef3008..6414473346b0 100644 --- a/erpnext/accounts/doctype/payment_order/test_payment_order.py +++ b/erpnext/accounts/doctype/payment_order/test_payment_order.py @@ -3,13 +3,19 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import getdate + from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account -from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, make_payment_order +from erpnext.accounts.doctype.payment_entry.payment_entry import ( + get_payment_entry, + make_payment_order, +) from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice + class TestPaymentOrder(unittest.TestCase): def setUp(self): create_bank_account() diff --git a/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py b/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py index b3a92940e273..68e5615b74a1 100644 --- a/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py +++ b/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentOrderReference(Document): pass diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 1286bf0f0bbf..6f6b96ad64e9 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -2,14 +2,21 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import flt, today, getdate, nowdate -from frappe import msgprint, _ + +import frappe +from frappe import _, msgprint from frappe.model.document import Document -from erpnext.accounts.utils import (get_outstanding_invoices, - update_reference_in_payment_entry, reconcile_against_document) +from frappe.utils import flt, getdate, nowdate, today + +import erpnext +from erpnext.accounts.utils import ( + get_outstanding_invoices, + reconcile_against_document, + update_reference_in_payment_entry, +) from erpnext.controllers.accounts_controller import get_advance_payment_entries + class PaymentReconciliation(Document): @frappe.whitelist() def get_unreconciled_entries(self): diff --git a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py index 87eaaee85640..2271f48a2b9c 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py @@ -4,5 +4,6 @@ # import frappe import unittest + class TestPaymentReconciliation(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/payment_reconciliation_allocation/payment_reconciliation_allocation.py b/erpnext/accounts/doctype/payment_reconciliation_allocation/payment_reconciliation_allocation.py index 0fb63b1cd17c..9db8e62af08b 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_allocation/payment_reconciliation_allocation.py +++ b/erpnext/accounts/doctype/payment_reconciliation_allocation/payment_reconciliation_allocation.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class PaymentReconciliationAllocation(Document): pass diff --git a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py index 800d80097548..f3914a05de5f 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py +++ b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentReconciliationInvoice(Document): pass diff --git a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py index c76f7852c8c0..5e0285f3682f 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py +++ b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PaymentReconciliationPayment(Document): pass diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index f83cb375fcf8..1570b499ac5b 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -3,18 +3,25 @@ # For license information, please see license.txt from __future__ import unicode_literals + import json + import frappe from frappe import _ +from frappe.integrations.utils import get_payment_gateway_controller from frappe.model.document import Document -from frappe.utils import flt, nowdate, get_url +from frappe.utils import flt, get_url, nowdate +from frappe.utils.background_jobs import enqueue + +from erpnext.accounts.doctype.payment_entry.payment_entry import ( + get_company_defaults, + get_payment_entry, +) +from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate from erpnext.accounts.party import get_party_account, get_party_bank_account from erpnext.accounts.utils import get_account_currency -from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, get_company_defaults -from frappe.integrations.utils import get_payment_gateway_controller -from frappe.utils.background_jobs import enqueue from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription -from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate + class PaymentRequest(Document): def validate(self): diff --git a/erpnext/accounts/doctype/payment_request/test_payment_request.py b/erpnext/accounts/doctype/payment_request/test_payment_request.py index ad6ff6f55532..c97c873fc4ed 100644 --- a/erpnext/accounts/doctype/payment_request/test_payment_request.py +++ b/erpnext/accounts/doctype/payment_request/test_payment_request.py @@ -3,11 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order + +import frappe + from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.setup.utils import get_exchange_rate test_dependencies = ["Currency Exchange", "Journal Entry", "Contact", "Address"] diff --git a/erpnext/accounts/doctype/payment_schedule/payment_schedule.py b/erpnext/accounts/doctype/payment_schedule/payment_schedule.py index 41740170f03e..33d5efa10e35 100644 --- a/erpnext/accounts/doctype/payment_schedule/payment_schedule.py +++ b/erpnext/accounts/doctype/payment_schedule/payment_schedule.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_term/payment_term.py b/erpnext/accounts/doctype/payment_term/payment_term.py index 5d4df053fb2b..a04c183bedce 100644 --- a/erpnext/accounts/doctype/payment_term/payment_term.py +++ b/erpnext/accounts/doctype/payment_term/payment_term.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_term/test_payment_term.py b/erpnext/accounts/doctype/payment_term/test_payment_term.py index d9baa5907b99..bc0645f9a62c 100644 --- a/erpnext/accounts/doctype/payment_term/test_payment_term.py +++ b/erpnext/accounts/doctype/payment_term/test_payment_term.py @@ -2,6 +2,7 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py index 39627eb376a4..a37a27827be0 100644 --- a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py +++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe -from frappe.model.document import Document -from frappe.utils import flt, cint from frappe import _ +from frappe.model.document import Document +from frappe.utils import cint, flt class PaymentTermsTemplate(Document): diff --git a/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py index 6daaf1ed74ec..2052a5093d2c 100644 --- a/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py +++ b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py @@ -2,6 +2,7 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest import frappe diff --git a/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py index 54c0fda01190..c857a88b9f5c 100644 --- a/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py +++ b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 3049c0eafbe2..9f30dc00c1e8 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -2,13 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt from frappe import _ +from frappe.utils import flt + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimensions, +) from erpnext.accounts.utils import get_account_currency from erpnext.controllers.accounts_controller import AccountsController -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (get_accounting_dimensions, - get_dimensions) + class PeriodClosingVoucher(AccountsController): def validate(self): diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 2a636bb3381e..17d64cfda64c 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -3,13 +3,17 @@ from __future__ import unicode_literals + import unittest + import frappe from frappe.utils import flt, today -from erpnext.accounts.utils import get_fiscal_year, now -from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry + from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book +from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.accounts.utils import get_fiscal_year, now + class TestPeriodClosingVoucher(unittest.TestCase): def test_closing_entry(self): diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py index 82528728ddc9..9bc717496dad 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py @@ -3,13 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ -from frappe.utils import get_datetime, flt +from frappe.utils import flt, get_datetime + +from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import ( + consolidate_pos_invoices, + unconsolidate_pos_invoices, +) from erpnext.controllers.status_updater import StatusUpdater from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data -from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices, unconsolidate_pos_invoices + class POSClosingEntry(StatusUpdater): def validate(self): diff --git a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py index b596c0cf25a1..1938983e2658 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py @@ -2,14 +2,20 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe + import unittest + +import frappe from frappe.utils import nowdate -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + +from erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry import ( + make_closing_entry_from_opening, +) from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice -from erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry import make_closing_entry_from_opening from erpnext.accounts.doctype.pos_opening_entry.test_pos_opening_entry import create_opening_entry from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + class TestPOSClosingEntry(unittest.TestCase): def setUp(self): diff --git a/erpnext/accounts/doctype/pos_closing_entry_detail/pos_closing_entry_detail.py b/erpnext/accounts/doctype/pos_closing_entry_detail/pos_closing_entry_detail.py index 46b6c773bc32..4293abdfdc1d 100644 --- a/erpnext/accounts/doctype/pos_closing_entry_detail/pos_closing_entry_detail.py +++ b/erpnext/accounts/doctype/pos_closing_entry_detail/pos_closing_entry_detail.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class POSClosingEntryDetail(Document): pass diff --git a/erpnext/accounts/doctype/pos_closing_entry_taxes/pos_closing_entry_taxes.py b/erpnext/accounts/doctype/pos_closing_entry_taxes/pos_closing_entry_taxes.py index f72d9a61e10c..74cf7540311e 100644 --- a/erpnext/accounts/doctype/pos_closing_entry_taxes/pos_closing_entry_taxes.py +++ b/erpnext/accounts/doctype/pos_closing_entry_taxes/pos_closing_entry_taxes.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class POSClosingEntryTaxes(Document): pass diff --git a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py index 85c1c9f8ddf4..a1c68c93ab0e 100644 --- a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py +++ b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class POSCustomerGroup(Document): pass diff --git a/erpnext/accounts/doctype/pos_field/pos_field.py b/erpnext/accounts/doctype/pos_field/pos_field.py index b4720b309bd9..00faebb7abbd 100644 --- a/erpnext/accounts/doctype/pos_field/pos_field.py +++ b/erpnext/accounts/doctype/pos_field/pos_field.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSField(Document): pass diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 034a217a26dc..6ed86da8ef0e 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -3,18 +3,25 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from erpnext.accounts.utils import get_account_currency -from erpnext.accounts.party import get_party_account, get_due_date -from frappe.utils import cint, flt, getdate, nowdate, get_link_to_form -from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request +from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate +from six import iteritems + from erpnext.accounts.doctype.loyalty_program.loyalty_program import validate_loyalty_points +from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request +from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + SalesInvoice, + get_bank_cash_account, + get_mode_of_payment_info, + update_multi_mode_option, +) +from erpnext.accounts.party import get_due_date, get_party_account +from erpnext.accounts.utils import get_account_currency from erpnext.stock.doctype.serial_no.serial_no import get_pos_reserved_serial_nos, get_serial_nos -from erpnext.accounts.doctype.sales_invoice.sales_invoice import SalesInvoice, get_bank_cash_account, update_multi_mode_option, get_mode_of_payment_info -from six import iteritems class POSInvoice(SalesInvoice): def __init__(self, *args, **kwargs): @@ -309,7 +316,7 @@ def set_status(self, update=False, status=None, update_modified=True): def set_pos_fields(self, for_validate=False): """Set retail related fields from POS Profiles""" - from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile + from erpnext.stock.get_item_details import get_pos_profile, get_pos_profile_item_details if not self.pos_profile: pos_profile = get_pos_profile(self.company) or {} if not pos_profile: @@ -519,6 +526,7 @@ def make_sales_return(source_name, target_doc=None): @frappe.whitelist() def make_merge_log(invoices): import json + from six import string_types if isinstance(invoices, string_types): diff --git a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py index d2527fb2e504..097438c0c622 100644 --- a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py @@ -3,14 +3,19 @@ # See license.txt from __future__ import unicode_literals +import copy +import time +import unittest + import frappe -import unittest, copy, time -from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile + from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt -from erpnext.stock.doctype.item.test_item import make_item +from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.stock.doctype.item.test_item import make_item +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry + class TestPOSInvoice(unittest.TestCase): @classmethod @@ -213,8 +218,8 @@ def test_pos_returns_with_repayment(self): self.assertEqual(pos_return.get('payments')[1].amount, -500) def test_pos_return_for_serialized_item(self): - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item(company='_Test Company', target_warehouse="Stores - _TC", cost_center='Main - _TC', expense_account='Cost of Goods Sold - _TC') @@ -239,8 +244,8 @@ def test_pos_return_for_serialized_item(self): self.assertEqual(pos_return.get('items')[0].serial_no, serial_nos[0]) def test_partial_pos_returns(self): - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item(company='_Test Company', target_warehouse="Stores - _TC", cost_center='Main - _TC', expense_account='Cost of Goods Sold - _TC') @@ -293,8 +298,8 @@ def test_without_payment(self): self.assertRaises(frappe.ValidationError, inv.insert) def test_serialized_item_transaction(self): - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item(company='_Test Company', target_warehouse="Stores - _TC", cost_center='Main - _TC', expense_account='Cost of Goods Sold - _TC') @@ -324,8 +329,8 @@ def test_serialized_item_transaction(self): self.assertRaises(frappe.ValidationError, pos2.submit) def test_delivered_serialized_item_transaction(self): - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item(company='_Test Company', target_warehouse="Stores - _TC", cost_center='Main - _TC', expense_account='Cost of Goods Sold - _TC') @@ -353,8 +358,10 @@ def test_delivered_serialized_item_transaction(self): self.assertRaises(frappe.ValidationError, pos2.submit) def test_loyalty_points(self): + from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( + get_loyalty_program_details_with_points, + ) from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records - from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points create_records() frappe.db.set_value("Customer", "Test Loyalty Customer", "loyalty_program", "Test Single Loyalty") @@ -374,7 +381,10 @@ def test_loyalty_points(self): self.assertEqual(after_cancel_lp_details.loyalty_points, before_lp_details.loyalty_points) def test_loyalty_points_redeemption(self): - from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points + from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( + get_loyalty_program_details_with_points, + ) + # add 10 loyalty points create_pos_invoice(customer="Test Loyalty Customer", rate=10000) @@ -392,8 +402,12 @@ def test_loyalty_points_redeemption(self): self.assertEqual(after_redeem_lp_details.loyalty_points, 9) def test_merging_into_sales_invoice_with_discount(self): - from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile - from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices + from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import ( + init_user_and_profile, + ) + from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import ( + consolidate_pos_invoices, + ) frappe.db.sql("delete from `tabPOS Invoice`") test_user, pos_profile = init_user_and_profile() @@ -416,8 +430,12 @@ def test_merging_into_sales_invoice_with_discount(self): self.assertEqual(rounded_total, 3470) def test_merging_into_sales_invoice_with_discount_and_inclusive_tax(self): - from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile - from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices + from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import ( + init_user_and_profile, + ) + from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import ( + consolidate_pos_invoices, + ) frappe.db.sql("delete from `tabPOS Invoice`") test_user, pos_profile = init_user_and_profile() @@ -457,8 +475,12 @@ def test_merging_into_sales_invoice_with_discount_and_inclusive_tax(self): self.assertEqual(rounded_total, 840) def test_merging_with_validate_selling_price(self): - from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile - from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices + from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import ( + init_user_and_profile, + ) + from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import ( + consolidate_pos_invoices, + ) if not frappe.db.get_single_value("Selling Settings", "validate_selling_price"): frappe.db.set_value("Selling Settings", "Selling Settings", "validate_selling_price", 1) diff --git a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py index 92ce61be5297..99e471991c3a 100644 --- a/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py +++ b/erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSInvoiceItem(Document): pass diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py index e50d437ba6a2..798381c8479d 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py @@ -3,17 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json + import frappe +import six from frappe import _ +from frappe.core.page.background_jobs.background_jobs import get_info from frappe.model import default_fields from frappe.model.document import Document +from frappe.model.mapper import map_child_doc, map_doc from frappe.utils import flt, getdate, nowdate from frappe.utils.background_jobs import enqueue -from frappe.model.mapper import map_doc, map_child_doc from frappe.utils.scheduler import is_scheduler_inactive -from frappe.core.page.background_jobs.background_jobs import get_info -import json -import six + class POSInvoiceMergeLog(Document): def validate(self): diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py index 1b9659409c08..c531bb9f0799 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py @@ -3,13 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe -import unittest import json -from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice -from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return -from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import consolidate_pos_invoices +import unittest + +import frappe + from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile +from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return +from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice +from erpnext.accounts.doctype.pos_invoice_merge_log.pos_invoice_merge_log import ( + consolidate_pos_invoices, +) + class TestPOSInvoiceMergeLog(unittest.TestCase): def test_consolidated_invoice_creation(self): diff --git a/erpnext/accounts/doctype/pos_invoice_reference/pos_invoice_reference.py b/erpnext/accounts/doctype/pos_invoice_reference/pos_invoice_reference.py index 4c45265f6081..9bce082c9589 100644 --- a/erpnext/accounts/doctype/pos_invoice_reference/pos_invoice_reference.py +++ b/erpnext/accounts/doctype/pos_invoice_reference/pos_invoice_reference.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSInvoiceReference(Document): pass diff --git a/erpnext/accounts/doctype/pos_item_group/pos_item_group.py b/erpnext/accounts/doctype/pos_item_group/pos_item_group.py index ceaa57ba60cd..177bf25fdaad 100644 --- a/erpnext/accounts/doctype/pos_item_group/pos_item_group.py +++ b/erpnext/accounts/doctype/pos_item_group/pos_item_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class POSItemGroup(Document): pass diff --git a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py index 3318fefab149..979479ffb589 100644 --- a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py +++ b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cint, get_link_to_form + from erpnext.controllers.status_updater import StatusUpdater + class POSOpeningEntry(StatusUpdater): def validate(self): self.validate_pos_profile_and_cashier() diff --git a/erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py b/erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py index c115be5ae94e..35a2b5835fd4 100644 --- a/erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py +++ b/erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestPOSOpeningEntry(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/pos_opening_entry_detail/pos_opening_entry_detail.py b/erpnext/accounts/doctype/pos_opening_entry_detail/pos_opening_entry_detail.py index 555706227fce..be5d876a1648 100644 --- a/erpnext/accounts/doctype/pos_opening_entry_detail/pos_opening_entry_detail.py +++ b/erpnext/accounts/doctype/pos_opening_entry_detail/pos_opening_entry_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSOpeningEntryDetail(Document): pass diff --git a/erpnext/accounts/doctype/pos_payment_method/pos_payment_method.py b/erpnext/accounts/doctype/pos_payment_method/pos_payment_method.py index 8a46d84bfe2d..851d8efde1d2 100644 --- a/erpnext/accounts/doctype/pos_payment_method/pos_payment_method.py +++ b/erpnext/accounts/doctype/pos_payment_method/pos_payment_method.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSPaymentMethod(Document): pass diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py index cf7ed26d2777..384463a5a500 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ -from frappe.utils import cint, now, get_link_to_form -from six import iteritems +from frappe import _, msgprint from frappe.model.document import Document +from frappe.utils import cint, get_link_to_form, now +from six import iteritems + class POSProfile(Document): def validate(self): diff --git a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py index 0033965700ec..83ecfb47bb52 100644 --- a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py @@ -3,10 +3,12 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.stock.get_item_details import get_pos_profile + +import frappe + from erpnext.accounts.doctype.pos_profile.pos_profile import get_child_nodes +from erpnext.stock.get_item_details import get_pos_profile test_dependencies = ['Item'] diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py index d77cddea6148..404c4ab62969 100644 --- a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py +++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class POSProfileUser(Document): pass diff --git a/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py index 5c69ab1fb8fb..dca355640823 100644 --- a/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py +++ b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py @@ -5,5 +5,6 @@ import unittest + class TestPOSProfileUser(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/pos_search_fields/pos_search_fields.py b/erpnext/accounts/doctype/pos_search_fields/pos_search_fields.py index 720ea77745fc..32f9f9298b15 100644 --- a/erpnext/accounts/doctype/pos_search_fields/pos_search_fields.py +++ b/erpnext/accounts/doctype/pos_search_fields/pos_search_fields.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class POSSearchFields(Document): pass diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.py b/erpnext/accounts/doctype/pos_settings/pos_settings.py index d925dd9d86ea..3f613aa511a3 100644 --- a/erpnext/accounts/doctype/pos_settings/pos_settings.py +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class POSSettings(Document): def validate(self): pass diff --git a/erpnext/accounts/doctype/pos_settings/test_pos_settings.py b/erpnext/accounts/doctype/pos_settings/test_pos_settings.py index a3df10803c0a..949fed775bf0 100644 --- a/erpnext/accounts/doctype/pos_settings/test_pos_settings.py +++ b/erpnext/accounts/doctype/pos_settings/test_pos_settings.py @@ -5,5 +5,6 @@ import unittest + class TestPOSSettings(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index ccfb29f35562..e5bf3b80641d 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -3,15 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -import json + import copy +import json import re -from frappe import throw, _ -from frappe.utils import flt, cint, getdate +import frappe +from frappe import _, throw from frappe.model.document import Document - +from frappe.utils import cint, flt, getdate from six import string_types apply_on_dict = {"Item Code": "items", @@ -228,8 +228,12 @@ def get_serial_no_for_item(args): return item_details def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False): - from erpnext.accounts.doctype.pricing_rule.utils import (get_pricing_rules, - get_applied_pricing_rules, get_pricing_rule_items, get_product_discount_rule) + from erpnext.accounts.doctype.pricing_rule.utils import ( + get_applied_pricing_rules, + get_pricing_rule_items, + get_pricing_rules, + get_product_discount_rule, + ) if isinstance(doc, string_types): doc = json.loads(doc) @@ -389,8 +393,10 @@ def apply_price_discount_rule(pricing_rule, item_details, args): if pricing_rule else args.get(field, 0)) def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None): - from erpnext.accounts.doctype.pricing_rule.utils import (get_applied_pricing_rules, - get_pricing_rule_items) + from erpnext.accounts.doctype.pricing_rule.utils import ( + get_applied_pricing_rules, + get_pricing_rule_items, + ) for d in get_applied_pricing_rules(pricing_rules): if not d or not frappe.db.exists("Pricing Rule", d): continue pricing_rule = frappe.get_cached_doc('Pricing Rule', d) diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 662d7704a551..e2b23704c884 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -3,14 +3,18 @@ from __future__ import unicode_literals + import unittest + import frappe -from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.stock.get_item_details import get_item_details from frappe import MandatoryError -from erpnext.stock.doctype.item.test_item import make_item + +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.healthcare.doctype.lab_test_template.lab_test_template import make_item_price +from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order +from erpnext.stock.doctype.item.test_item import make_item +from erpnext.stock.get_item_details import get_item_details + class TestPricingRule(unittest.TestCase): def setUp(self): @@ -20,9 +24,10 @@ def tearDown(self): delete_existing_pricing_rules() def test_pricing_rule_for_discount(self): - from erpnext.stock.get_item_details import get_item_details from frappe import MandatoryError + from erpnext.stock.get_item_details import get_item_details + test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", @@ -102,9 +107,10 @@ def test_pricing_rule_for_discount(self): self.assertEqual(details.get("discount_percentage"), 15) def test_pricing_rule_for_margin(self): - from erpnext.stock.get_item_details import get_item_details from frappe import MandatoryError + from erpnext.stock.get_item_details import get_item_details + test_record = { "doctype": "Pricing Rule", "title": "_Test Pricing Rule", @@ -195,9 +201,10 @@ def test_mixed_conditions_for_item_group(self): self.assertEqual(details.get("discount_percentage"), 10) def test_pricing_rule_for_variants(self): - from erpnext.stock.get_item_details import get_item_details from frappe import MandatoryError + from erpnext.stock.get_item_details import get_item_details + if not frappe.db.exists("Item", "Test Variant PRT"): frappe.get_doc({ "doctype": "Item", diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index 6f24587ac7be..639b39de1677 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -8,14 +8,15 @@ import copy import json +import frappe +from frappe import _, bold +from frappe.utils import cint, flt, fmt_money, get_link_to_form, getdate, today from six import string_types -import frappe from erpnext.setup.doctype.item_group.item_group import get_child_item_groups from erpnext.stock.doctype.warehouse.warehouse import get_child_warehouses from erpnext.stock.get_item_details import get_conversion_factor -from frappe import _, bold -from frappe.utils import cint, flt, get_link_to_form, getdate, today, fmt_money + class MultiplePricingRuleConflict(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py b/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py index e2f70af4a12d..0b426ebe7f28 100644 --- a/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py +++ b/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PricingRuleBrand(Document): pass diff --git a/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py b/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py index 3cb7da915844..c38139495c40 100644 --- a/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py +++ b/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PricingRuleDetail(Document): pass diff --git a/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py b/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py index 4468620314c4..9f36f14c05a9 100644 --- a/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py +++ b/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PricingRuleItemCode(Document): pass diff --git a/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py b/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py index d3c36197c77e..665704f2b784 100644 --- a/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py +++ b/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PricingRuleItemGroup(Document): pass diff --git a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py index 5e7583a9745d..418c3cc0882b 100644 --- a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py +++ b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _ from frappe.model.document import Document + +import erpnext +from erpnext.accounts.deferred_revenue import ( + build_conditions, + convert_deferred_expense_to_expense, + convert_deferred_revenue_to_income, +) from erpnext.accounts.general_ledger import make_reverse_gl_entries -from erpnext.accounts.deferred_revenue import convert_deferred_expense_to_expense, \ - convert_deferred_revenue_to_income, build_conditions + class ProcessDeferredAccounting(Document): def validate(self): diff --git a/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py b/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py index 03c269ac766a..69e2caa8e82b 100644 --- a/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py +++ b/erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py @@ -3,11 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.accounts.doctype.account.test_account import create_account +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import ( + check_gl_entries, + create_sales_invoice, +) from erpnext.stock.doctype.item.test_item import create_item -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice, check_gl_entries + class TestProcessDeferredAccounting(unittest.TestCase): def test_creation_of_ledger_entry_on_submit(self): diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py index 30b1edcec8dc..472ebac3551f 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py @@ -3,22 +3,26 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import copy +from datetime import timedelta + import frappe from frappe import _ from frappe.model.document import Document -from erpnext.accounts.report.general_ledger.general_ledger import execute as get_soa -from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import execute as get_ageing +from frappe.utils import add_days, add_months, format_date, getdate, today +from frappe.utils.jinja import validate_template +from frappe.utils.pdf import get_pdf +from frappe.utils.print_format import report_to_pdf +from frappe.www.printview import get_print_style + from erpnext import get_company_currency from erpnext.accounts.party import get_party_account_currency +from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import ( + execute as get_ageing, +) +from erpnext.accounts.report.general_ledger.general_ledger import execute as get_soa -from frappe.utils.print_format import report_to_pdf -from frappe.utils.pdf import get_pdf -from frappe.utils import today, add_days, add_months, getdate, format_date -from frappe.utils.jinja import validate_template - -import copy -from datetime import timedelta -from frappe.www.printview import get_print_style class ProcessStatementOfAccounts(Document): def validate(self): diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/test_process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/test_process_statement_of_accounts.py index 30efbb368330..7ddcd105af92 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/test_process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/test_process_statement_of_accounts.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestProcessStatementOfAccounts(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/process_statement_of_accounts_customer/process_statement_of_accounts_customer.py b/erpnext/accounts/doctype/process_statement_of_accounts_customer/process_statement_of_accounts_customer.py index 1a760101dba1..fe940094071a 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts_customer/process_statement_of_accounts_customer.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts_customer/process_statement_of_accounts_customer.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProcessStatementOfAccountsCustomer(Document): pass diff --git a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py index 3d7a891f3338..4d6b86ce5f51 100644 --- a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py +++ b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py @@ -3,11 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cstr -from frappe.model.naming import make_autoname from frappe.model.document import Document +from frappe.model.naming import make_autoname +from frappe.utils import cstr pricing_rule_fields = ['apply_on', 'mixed_conditions', 'is_cumulative', 'other_item_code', 'other_item_group', 'apply_rule_on_other', 'other_brand', 'selling', 'buying', 'applicable_for', 'valid_from', diff --git a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py index 54fedb77387b..6d079242682d 100644 --- a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py +++ b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py @@ -1,5 +1,6 @@ from frappe import _ + def get_data(): return { 'fieldname': 'promotional_scheme', diff --git a/erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py b/erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py index 286f7cf6edd4..190b734cc17a 100644 --- a/erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py +++ b/erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestPromotionalScheme(unittest.TestCase): def test_promotional_scheme(self): ps = make_promotional_scheme() diff --git a/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py b/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py index 380ae32f9a58..2d6394fb7f45 100644 --- a/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py +++ b/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PromotionalSchemePriceDiscount(Document): pass diff --git a/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py b/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py index 2931106f768d..b33791430651 100644 --- a/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py +++ b/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PromotionalSchemeProductDiscount(Document): pass diff --git a/erpnext/accounts/doctype/psoa_cost_center/psoa_cost_center.py b/erpnext/accounts/doctype/psoa_cost_center/psoa_cost_center.py index 0aeef3ed3a80..cb5aaa9c5e02 100644 --- a/erpnext/accounts/doctype/psoa_cost_center/psoa_cost_center.py +++ b/erpnext/accounts/doctype/psoa_cost_center/psoa_cost_center.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PSOACostCenter(Document): pass diff --git a/erpnext/accounts/doctype/psoa_project/psoa_project.py b/erpnext/accounts/doctype/psoa_project/psoa_project.py index f4a5dee97521..1cd995179d53 100644 --- a/erpnext/accounts/doctype/psoa_project/psoa_project.py +++ b/erpnext/accounts/doctype/psoa_project/psoa_project.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PSOAProject(Document): pass diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index fdd8765b4112..f34a8fbd9f28 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -3,29 +3,43 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import cint, cstr, formatdate, flt, getdate, nowdate, get_link_to_form -from frappe import _, throw + +import frappe import frappe.defaults +from frappe import _, throw +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate +from six import iteritems +import erpnext +from erpnext.accounts.deferred_revenue import validate_service_stop_date +from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt +from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + check_if_return_invoice_linked_with_payment_entry, + unlink_inter_company_doc, + update_linked_doc, + validate_inter_company_party, +) +from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( + get_party_tax_withholding_details, +) +from erpnext.accounts.general_ledger import ( + get_round_off_account_and_cost_center, + make_gl_entries, + make_reverse_gl_entries, + merge_similar_entries, +) +from erpnext.accounts.party import get_due_date, get_party_account +from erpnext.accounts.utils import get_account_currency, get_fiscal_year +from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_enabled from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account +from erpnext.buying.utils import check_on_hold_or_closed_status from erpnext.controllers.buying_controller import BuyingController -from erpnext.accounts.party import get_party_account, get_due_date -from erpnext.accounts.utils import get_account_currency, get_fiscal_year -from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_billed_amount_based_on_po from erpnext.stock import get_warehouse_account_map -from erpnext.accounts.general_ledger import make_gl_entries, merge_similar_entries, make_reverse_gl_entries -from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt -from erpnext.buying.utils import check_on_hold_or_closed_status -from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center -from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_enabled -from frappe.model.mapper import get_mapped_doc -from six import iteritems -from erpnext.accounts.doctype.sales_invoice.sales_invoice import validate_inter_company_party, update_linked_doc,\ - unlink_inter_company_doc, check_if_return_invoice_linked_with_payment_entry -from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import get_party_tax_withholding_details -from erpnext.accounts.deferred_revenue import validate_service_stop_date -from erpnext.stock.doctype.purchase_receipt.purchase_receipt import get_item_account_wise_additional_cost +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import ( + get_item_account_wise_additional_cost, + update_billed_amount_based_on_po, +) form_grid_templates = { "items": "templates/form_grid/item_grid.html" diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py index b6467a3d5cac..4cc319d594f0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'purchase_invoice', diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index bfe34bb4a737..04d03f5bc832 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -3,20 +3,27 @@ from __future__ import unicode_literals + import unittest -import frappe, erpnext + +import frappe +import frappe.defaults import frappe.model +from frappe.utils import add_days, cint, flt, getdate, nowdate, today + +import erpnext +from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry -from frappe.utils import cint, flt, today, nowdate, add_days, getdate -import frappe.defaults -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt, get_taxes +from erpnext.buying.doctype.supplier.test_supplier import create_supplier from erpnext.controllers.accounts_controller import get_payment_terms from erpnext.exceptions import InvalidCurrency -from erpnext.stock.doctype.stock_entry.test_stock_entry import get_qty_after_transaction from erpnext.projects.doctype.project.test_project import make_project -from erpnext.accounts.doctype.account.test_account import get_inventory_account, create_account from erpnext.stock.doctype.item.test_item import create_item -from erpnext.buying.doctype.supplier.test_supplier import create_supplier +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( + get_taxes, + make_purchase_receipt, +) +from erpnext.stock.doctype.stock_entry.test_stock_entry import get_qty_after_transaction test_dependencies = ["Item", "Cost Center", "Payment Term", "Payment Terms Template"] test_ignore = ["Serial No"] @@ -380,8 +387,9 @@ def test_purchase_invoice_with_subcontracted_item(self): self.assertEqual(tax.total, expected_values[i][2]) def test_purchase_invoice_with_advance(self): - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.copy_doc(jv_test_records[1]) jv.insert() @@ -420,8 +428,9 @@ def test_purchase_invoice_with_advance(self): where reference_type='Purchase Invoice' and reference_name=%s""", pi.name)) def test_invoice_with_advance_and_multi_payment_terms(self): - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.copy_doc(jv_test_records[1]) jv.insert() @@ -693,8 +702,9 @@ def test_rejected_serial_no(self): "warehouse"), pi.get("items")[0].rejected_warehouse) def test_outstanding_amount_after_advance_jv_cancelation(self): - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.copy_doc(jv_test_records[1]) jv.accounts[0].is_advance = 'Yes' @@ -773,8 +783,7 @@ def test_outstanding_amount_after_advance_payment_entry_cancelation(self): self.assertEqual(flt(pi.outstanding_amount), flt(pi.rounded_total + pi.total_advance)) def test_purchase_invoice_with_shipping_rule(self): - from erpnext.accounts.doctype.shipping_rule.test_shipping_rule \ - import create_shipping_rule + from erpnext.accounts.doctype.shipping_rule.test_shipping_rule import create_shipping_rule shipping_rule = create_shipping_rule(shipping_rule_type = "Buying", shipping_rule_name = "Shipping Rule - Purchase Invoice Test") @@ -1112,9 +1121,9 @@ def test_gain_loss_with_advance_entry(self): frappe.db.set_value("Company", "_Test Company", "exchange_gain_loss_account", original_account) def test_purchase_invoice_advance_taxes(self): - from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry from erpnext.buying.doctype.purchase_order.purchase_order import get_mapped_purchase_invoice + from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order # create a new supplier to test supplier = create_supplier(supplier_name = '_Test TDS Advance Supplier', diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py index d157837a7a54..4183d054061a 100644 --- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py +++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseInvoiceAdvance(Document): pass diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py index 50ec7d8b4d8d..447235c8b39e 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseInvoiceItem(Document): pass diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py index 5854ddee940c..9d3b64725149 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseTaxesandCharges(Document): pass diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.py index efcef469bde4..53b549f6829a 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template.py @@ -3,10 +3,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document -from erpnext.accounts.doctype.sales_taxes_and_charges_template.sales_taxes_and_charges_template \ - import valdiate_taxes_and_charges_template + +from erpnext.accounts.doctype.sales_taxes_and_charges_template.sales_taxes_and_charges_template import ( + valdiate_taxes_and_charges_template, +) + class PurchaseTaxesandChargesTemplate(Document): def validate(self): diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py index 97fbca31b6b5..85af12ed8c28 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Purchase Taxes and Charges Template') class TestPurchaseTaxesandChargesTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/salary_component_account/salary_component_account.py b/erpnext/accounts/doctype/salary_component_account/salary_component_account.py index 983d0156a581..81ccbdeef470 100644 --- a/erpnext/accounts/doctype/salary_component_account/salary_component_account.py +++ b/erpnext/accounts/doctype/salary_component_account/salary_component_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SalaryComponentAccount(Document): pass diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 4eaf2f40a6fb..c9b1afad52f8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -2,32 +2,52 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe import frappe.defaults -from frappe.utils import cint, flt, getdate, add_days, add_months, cstr, nowdate, get_link_to_form, formatdate from frappe import _, msgprint, throw -from erpnext.accounts.party import get_party_account, get_due_date, get_party_details +from frappe.contacts.doctype.address.address import get_address_display from frappe.model.mapper import get_mapped_doc -from erpnext.controllers.selling_controller import SellingController -from erpnext.accounts.utils import get_account_currency -from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so -from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data -from erpnext.assets.doctype.asset.depreciation \ - import get_disposal_account_and_cost_center, get_gl_entries_on_asset_disposal, get_gl_entries_on_asset_regain, post_depreciation_entries -from erpnext.stock.doctype.batch.batch import set_batch_nos -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos, get_delivery_note_serial_no -from erpnext.setup.doctype.company.company import update_company_current_month_sales -from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center -from erpnext.accounts.doctype.loyalty_program.loyalty_program import \ - get_loyalty_program_details_with_points, get_loyalty_details, validate_loyalty_points -from erpnext.accounts.deferred_revenue import validate_service_stop_date -from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import get_party_tax_withholding_details from frappe.model.utils import get_fetch_values -from frappe.contacts.doctype.address.address import get_address_display +from frappe.utils import ( + add_days, + add_months, + cint, + cstr, + flt, + formatdate, + get_link_to_form, + getdate, + nowdate, +) +from six import iteritems +import erpnext +from erpnext.accounts.deferred_revenue import validate_service_stop_date +from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( + get_loyalty_details, + get_loyalty_program_details_with_points, + validate_loyalty_points, +) +from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( + get_party_tax_withholding_details, +) +from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center +from erpnext.accounts.party import get_due_date, get_party_account, get_party_details +from erpnext.accounts.utils import get_account_currency +from erpnext.assets.doctype.asset.depreciation import ( + get_disposal_account_and_cost_center, + get_gl_entries_on_asset_disposal, + get_gl_entries_on_asset_regain, + post_depreciation_entries, +) +from erpnext.controllers.selling_controller import SellingController from erpnext.healthcare.utils import manage_invoice_submit_cancel - -from six import iteritems +from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data +from erpnext.setup.doctype.company.company import update_company_current_month_sales +from erpnext.stock.doctype.batch.batch import set_batch_nos +from erpnext.stock.doctype.delivery_note.delivery_note import update_billed_amount_based_on_so +from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no, get_serial_nos form_grid_templates = { "items": "templates/form_grid/item_grid.html" @@ -482,7 +502,7 @@ def set_pos_fields(self, for_validate=False): if not self.account_for_change_amount: self.account_for_change_amount = frappe.get_cached_value('Company', self.company, 'default_cash_account') - from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile + from erpnext.stock.get_item_details import get_pos_profile, get_pos_profile_item_details if not self.pos_profile: pos_profile = get_pos_profile(self.company) or {} if not pos_profile: @@ -1371,8 +1391,10 @@ def get_returned_amount(self): # redeem the loyalty points. def apply_loyalty_points(self): - from erpnext.accounts.doctype.loyalty_point_entry.loyalty_point_entry \ - import get_loyalty_point_entries, get_redemption_details + from erpnext.accounts.doctype.loyalty_point_entry.loyalty_point_entry import ( + get_loyalty_point_entries, + get_redemption_details, + ) loyalty_point_entries = get_loyalty_point_entries(self.customer, self.loyalty_program, self.company, self.posting_date) redemption_details = get_redemption_details(self.customer, self.loyalty_program, self.company) @@ -2005,7 +2027,11 @@ def get_mode_of_payment_info(mode_of_payment, company): @frappe.whitelist() def create_dunning(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - from erpnext.accounts.doctype.dunning.dunning import get_dunning_letter_text, calculate_interest_and_amount + + from erpnext.accounts.doctype.dunning.dunning import ( + calculate_interest_and_amount, + get_dunning_letter_text, + ) def set_missing_values(source, target): target.sales_invoice = source_name target.outstanding_amount = source.outstanding_amount diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py index 3238ead43163..64b35b2987e1 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'sales_invoice', diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 8fbd2502231c..2e95aae451f1 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2,30 +2,39 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import copy +import time +import unittest -import unittest, copy, time -from frappe.utils import nowdate, flt, getdate, cint, add_days, add_months +import frappe from frappe.model.dynamic_links import get_dynamic_link_map -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction -from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice -from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile -from erpnext.assets.doctype.asset.test_asset import create_asset, create_asset_data -from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries -from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency -from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError from frappe.model.naming import make_autoname -from erpnext.accounts.doctype.account.test_account import get_inventory_account, create_account -from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data -from erpnext.stock.doctype.item.test_item import create_item +from frappe.utils import add_days, add_months, cint, flt, getdate, nowdate from six import iteritems + +from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account +from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + unlink_payment_on_cancel_of_invoice, +) from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_inter_company_transaction +from erpnext.accounts.utils import PaymentEntryUnlinkError +from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries +from erpnext.assets.doctype.asset.test_asset import create_asset, create_asset_data +from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data +from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency from erpnext.regional.india.utils import get_ewb_data -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice +from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry +from erpnext.stock.doctype.stock_entry.test_stock_entry import ( + get_qty_after_transaction, + make_stock_entry, +) from erpnext.stock.utils import get_incoming_rate -from erpnext.accounts.utils import PaymentEntryUnlinkError + class TestSalesInvoice(unittest.TestCase): def make(self): @@ -676,8 +685,9 @@ def test_outstanding(self): def test_payment(self): w = self.make() - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.get_doc(frappe.copy_doc(jv_test_records[0])) jv.get("accounts")[0].reference_type = w.doctype @@ -943,16 +953,18 @@ def test_sales_invoice_gl_entry_with_perpetual_inventory_non_stock_item(self): def _insert_purchase_receipt(self): - from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ - as pr_test_records + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( + test_records as pr_test_records, + ) pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" pr.insert() pr.submit() def _insert_delivery_note(self): - from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ - as dn_test_records + from erpnext.stock.doctype.delivery_note.test_delivery_note import ( + test_records as dn_test_records, + ) dn = frappe.copy_doc(dn_test_records[0]) dn.naming_series = "_T-Delivery Note-" dn.insert() @@ -960,8 +972,9 @@ def _insert_delivery_note(self): return dn def test_sales_invoice_with_advance(self): - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.copy_doc(jv_test_records[0]) jv.insert() @@ -993,8 +1006,8 @@ def test_sales_invoice_with_advance(self): si.cancel() def test_serialized(self): - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() serial_nos = get_serial_nos(se.get("items")[0].serial_no) @@ -1047,9 +1060,9 @@ def test_serial_numbers_against_delivery_note(self): check if the sales invoice item serial numbers and the delivery note items serial numbers are same """ - from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() serial_nos = get_serial_nos(se.get("items")[0].serial_no) @@ -1298,8 +1311,9 @@ def test_create_so_with_margin(self): self.assertEqual(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate)) def test_outstanding_amount_after_advance_jv_cancelation(self): - from erpnext.accounts.doctype.journal_entry.test_journal_entry \ - import test_records as jv_test_records + from erpnext.accounts.doctype.journal_entry.test_journal_entry import ( + test_records as jv_test_records, + ) jv = frappe.copy_doc(jv_test_records[0]) jv.accounts[0].is_advance = 'Yes' @@ -1585,8 +1599,7 @@ def test_rounding_adjustment_2(self): self.assertEqual(expected_values[gle.account][2], gle.credit) def test_sales_invoice_with_shipping_rule(self): - from erpnext.accounts.doctype.shipping_rule.test_shipping_rule \ - import create_shipping_rule + from erpnext.accounts.doctype.shipping_rule.test_shipping_rule import create_shipping_rule shipping_rule = create_shipping_rule(shipping_rule_type = "Selling", shipping_rule_name = "Shipping Rule - Sales Invoice Test") @@ -2102,7 +2115,9 @@ def test_item_tax_net_range(self): self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 10 - _TC") def test_sales_invoice_with_discount_accounting_enabled(self): - from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import enable_discount_accounting + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + enable_discount_accounting, + ) enable_discount_accounting() @@ -2120,7 +2135,9 @@ def test_sales_invoice_with_discount_accounting_enabled(self): enable_discount_accounting(enable=0) def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self): - from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import enable_discount_accounting + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + enable_discount_accounting, + ) enable_discount_accounting() additional_discount_account = create_account(account_name="Discount Account", @@ -2174,7 +2191,9 @@ def test_asset_depreciation_on_sale(self): self.assertTrue(schedule.journal_entry) def test_sales_invoice_against_supplier(self): - from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import make_customer + from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import ( + make_customer, + ) from erpnext.buying.doctype.supplier.test_supplier import create_supplier # create a customer diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py index 28aeef4d5e11..8f4662f08c8d 100644 --- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py +++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SalesInvoiceAdvance(Document): pass diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py index a73b03acc84d..732c47dde626 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SalesInvoiceItem(Document): pass diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py index cc0b7a620dbd..69a085fcd079 100644 --- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py +++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SalesInvoicePayment(Document): pass diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py index afc05ab7ede3..24dbc70a9630 100644 --- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py +++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SalesInvoiceTimesheet(Document): pass diff --git a/erpnext/accounts/doctype/sales_partner_item/sales_partner_item.py b/erpnext/accounts/doctype/sales_partner_item/sales_partner_item.py index 9796c7b0ccf7..97489d155fc8 100644 --- a/erpnext/accounts/doctype/sales_partner_item/sales_partner_item.py +++ b/erpnext/accounts/doctype/sales_partner_item/sales_partner_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class SalesPartnerItem(Document): pass diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py index b1de9d85fdb3..533704c8ef2a 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SalesTaxesandCharges(Document): pass diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py index 8f9eb6577b8b..0a0bb3e00b90 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py @@ -2,11 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt from frappe.model.document import Document -from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax, validate_cost_center, validate_account_head +from frappe.utils import flt + +from erpnext.controllers.accounts_controller import ( + validate_account_head, + validate_cost_center, + validate_inclusive_tax, + validate_taxes_and_charges, +) + class SalesTaxesandChargesTemplate(Document): def validate(self): diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.py index 1c0c0c77e75f..1cad4129f835 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = frappe.get_test_records('Sales Taxes and Charges Template') class TestSalesTaxesandChargesTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/share_balance/share_balance.py b/erpnext/accounts/doctype/share_balance/share_balance.py index bd165cd38a46..9ffbefb79469 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.py +++ b/erpnext/accounts/doctype/share_balance/share_balance.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ShareBalance(Document): pass diff --git a/erpnext/accounts/doctype/share_transfer/share_transfer.py b/erpnext/accounts/doctype/share_transfer/share_transfer.py index 3d4543fb0519..5117ef8b5b55 100644 --- a/erpnext/accounts/doctype/share_transfer/share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/share_transfer.py @@ -3,13 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.model.document import Document -from frappe.model.naming import make_autoname from frappe.exceptions import ValidationError +from frappe.model.document import Document +from frappe.model.naming import make_autoname from frappe.utils import nowdate + class ShareDontExists(ValidationError): pass class ShareTransfer(Document): diff --git a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py index 2ff9b02129fa..b40e5fbbf8ec 100644 --- a/erpnext/accounts/doctype/share_transfer/test_share_transfer.py +++ b/erpnext/accounts/doctype/share_transfer/test_share_transfer.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists test_dependencies = ["Share Type", "Shareholder"] diff --git a/erpnext/accounts/doctype/share_type/share_type.py b/erpnext/accounts/doctype/share_type/share_type.py index ab4b8bc1ef28..7d04e11dacee 100644 --- a/erpnext/accounts/doctype/share_type/share_type.py +++ b/erpnext/accounts/doctype/share_type/share_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ShareType(Document): pass diff --git a/erpnext/accounts/doctype/share_type/test_share_type.py b/erpnext/accounts/doctype/share_type/test_share_type.py index 1c1f05165887..d41d407a1041 100644 --- a/erpnext/accounts/doctype/share_type/test_share_type.py +++ b/erpnext/accounts/doctype/share_type/test_share_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestShareType(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/shareholder/shareholder.py b/erpnext/accounts/doctype/shareholder/shareholder.py index c507fcfaa9d3..3553ae40da34 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder.py +++ b/erpnext/accounts/doctype/shareholder/shareholder.py @@ -3,9 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.model.document import Document -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address + class Shareholder(Document): def onload(self): diff --git a/erpnext/accounts/doctype/shareholder/test_shareholder.py b/erpnext/accounts/doctype/shareholder/test_shareholder.py index 9ce00932fad5..0c3f6e5bc738 100644 --- a/erpnext/accounts/doctype/shareholder/test_shareholder.py +++ b/erpnext/accounts/doctype/shareholder/test_shareholder.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestShareholder(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index d32a348741ea..285210147204 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -4,10 +4,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _, msgprint, throw -from frappe.utils import flt, fmt_money from frappe.model.document import Document +from frappe.utils import flt, fmt_money + +import erpnext + class OverlappingConditionError(frappe.ValidationError): pass class FromGreaterThanToError(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index abc6ab82d3d4..bdd9be3beda8 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -2,9 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError + +import frappe + +from erpnext.accounts.doctype.shipping_rule.shipping_rule import ( + FromGreaterThanToError, + ManyBlankToValuesError, + OverlappingConditionError, +) test_records = frappe.get_test_records('Shipping Rule') diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py index db6ef117c225..2f35c448aacd 100644 --- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py +++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ShippingRuleCondition(Document): pass diff --git a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py index b9646cfc2931..32ead2c7a77c 100644 --- a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py +++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ShippingRuleCountry(Document): pass diff --git a/erpnext/accounts/doctype/south_africa_vat_account/south_africa_vat_account.py b/erpnext/accounts/doctype/south_africa_vat_account/south_africa_vat_account.py index 4bd8c65a046c..d9a3bcc0df4f 100644 --- a/erpnext/accounts/doctype/south_africa_vat_account/south_africa_vat_account.py +++ b/erpnext/accounts/doctype/south_africa_vat_account/south_africa_vat_account.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class SouthAfricaVATAccount(Document): pass diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index 7c4ff73d9083..68f4e9841651 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -6,13 +6,27 @@ from __future__ import unicode_literals import frappe -import erpnext from frappe import _ from frappe.model.document import Document -from frappe.utils.data import nowdate, getdate, cstr, cint, add_days, date_diff, get_last_day, add_to_date, flt -from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions +from frappe.utils.data import ( + add_days, + add_to_date, + cint, + cstr, + date_diff, + flt, + get_last_day, + getdate, + nowdate, +) + +import erpnext from erpnext import get_default_company +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) +from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate + class Subscription(Document): def before_insert(self): diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 4f2cf487a4f6..03ec6e9151ff 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -6,9 +6,20 @@ import unittest import frappe +from frappe.utils.data import ( + add_days, + add_months, + add_to_date, + date_diff, + flt, + get_date_str, + get_first_day, + get_last_day, + nowdate, +) + from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor -from frappe.utils.data import (nowdate, add_days, add_to_date, add_months, date_diff, flt, get_date_str, - get_first_day, get_last_day) + def create_plan(): if not frappe.db.exists('Subscription Plan', '_Test Plan Name'): diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py index 6f459b4790da..687c94cce2c9 100644 --- a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py +++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SubscriptionInvoice(Document): pass diff --git a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py index e60a4eeca99d..2cc3038d9138 100644 --- a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py +++ b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py @@ -5,5 +5,6 @@ import unittest + class TestSubscriptionInvoice(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py index a341c2af6ac2..c7bb58cb26d3 100644 --- a/erpnext/accounts/doctype/subscription_plan/subscription_plan.py +++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import get_first_day, get_last_day, date_diff, flt, getdate from frappe.model.document import Document +from frappe.utils import date_diff, flt, get_first_day, get_last_day, getdate + from erpnext.utilities.product import get_price + class SubscriptionPlan(Document): def validate(self): self.validate_interval_count() diff --git a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py index 73afbf620ec1..ba997632479d 100644 --- a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py +++ b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py @@ -5,5 +5,6 @@ import unittest + class TestSubscriptionPlan(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py index 1d9606ff78cf..a63a27700ccc 100644 --- a/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py +++ b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SubscriptionPlanDetail(Document): pass diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py index cc378e4d9fd4..54735834baaa 100644 --- a/erpnext/accounts/doctype/subscription_settings/subscription_settings.py +++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SubscriptionSettings(Document): pass diff --git a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py index 82c7e1d269ef..5875ee069ec8 100644 --- a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py +++ b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py @@ -5,5 +5,6 @@ import unittest + class TestSubscriptionSettings(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/supplier_group_item/supplier_group_item.py b/erpnext/accounts/doctype/supplier_group_item/supplier_group_item.py index de0444ee193c..61c16fe0ff19 100644 --- a/erpnext/accounts/doctype/supplier_group_item/supplier_group_item.py +++ b/erpnext/accounts/doctype/supplier_group_item/supplier_group_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class SupplierGroupItem(Document): pass diff --git a/erpnext/accounts/doctype/supplier_item/supplier_item.py b/erpnext/accounts/doctype/supplier_item/supplier_item.py index ad66e230c805..2105b1d33275 100644 --- a/erpnext/accounts/doctype/supplier_item/supplier_item.py +++ b/erpnext/accounts/doctype/supplier_item/supplier_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class SupplierItem(Document): pass diff --git a/erpnext/accounts/doctype/tax_category/tax_category.py b/erpnext/accounts/doctype/tax_category/tax_category.py index 2870e3200f83..82758bc916af 100644 --- a/erpnext/accounts/doctype/tax_category/tax_category.py +++ b/erpnext/accounts/doctype/tax_category/tax_category.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TaxCategory(Document): pass diff --git a/erpnext/accounts/doctype/tax_category/test_tax_category.py b/erpnext/accounts/doctype/tax_category/test_tax_category.py index 548d00852aab..854671b97bb3 100644 --- a/erpnext/accounts/doctype/tax_category/test_tax_category.py +++ b/erpnext/accounts/doctype/tax_category/test_tax_category.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTaxCategory(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py index 581423181773..150498d6acca 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py @@ -3,18 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -from past.builtins import cmp + +import functools + import frappe from frappe import _ -from frappe.model.document import Document -from frappe.utils import cstr, cint from frappe.contacts.doctype.address.address import get_default_address +from frappe.model.document import Document +from frappe.utils import cint, cstr from frappe.utils.nestedset import get_root_of -from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups +from past.builtins import cmp +from six import iteritems -import functools +from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups -from six import iteritems class IncorrectCustomerGroup(frappe.ValidationError): pass class IncorrectSupplierType(frappe.ValidationError): pass diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py index cf7226822edb..0a6bdbc36749 100644 --- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py @@ -3,16 +3,24 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template -from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity + +import frappe + +from erpnext.accounts.doctype.tax_rule.tax_rule import ( + ConflictingTaxRule, + IncorrectCustomerGroup, + IncorrectSupplierType, + get_tax_template, +) from erpnext.crm.doctype.opportunity.opportunity import make_quotation +from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity test_records = frappe.get_test_records('Tax Rule') from six import iteritems + class TestTaxRule(unittest.TestCase): @classmethod def setUpClass(cls): diff --git a/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py b/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py index 76e3fa32b0c9..ef4757e3fe20 100644 --- a/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py +++ b/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TaxWithholdingAccount(Document): pass diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index 5772ac23b8d0..d7de48c72ffb 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, getdate, cint +from frappe.utils import cint, flt, getdate + from erpnext.accounts.utils import get_fiscal_year + class TaxWithholdingCategory(Document): pass diff --git a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py index 0f921db678d8..bf10c9e073a1 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import today + from erpnext.accounts.utils import get_fiscal_year from erpnext.buying.doctype.supplier.test_supplier import create_supplier diff --git a/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py b/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py index 6e32abec3904..fb6cd040c87f 100644 --- a/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py +++ b/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TaxWithholdingRate(Document): pass diff --git a/erpnext/accounts/doctype/territory_item/territory_item.py b/erpnext/accounts/doctype/territory_item/territory_item.py index d46edc9dca81..bcc02be2dd33 100644 --- a/erpnext/accounts/doctype/territory_item/territory_item.py +++ b/erpnext/accounts/doctype/territory_item/territory_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class TerritoryItem(Document): pass diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 312613840801..2bc9e7400608 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -2,12 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import flt, cstr, cint, comma_and, today, getdate, formatdate, now + +import frappe from frappe import _ from frappe.model.meta import get_field_precision +from frappe.utils import cint, comma_and, cstr, flt, formatdate, getdate, now, today + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions + class ClosedAccountingPeriod(frappe.ValidationError): pass diff --git a/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py b/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py index 1bc4d1874c89..f57de916dd17 100644 --- a/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py +++ b/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_context(context): # do your magic here pass diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index b78ea4285095..8f557c73c2c0 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -3,20 +3,37 @@ from __future__ import unicode_literals -import frappe, erpnext +import frappe from frappe import _, msgprint, scrub +from frappe.contacts.doctype.address.address import ( + get_address_display, + get_company_address, + get_default_address, +) +from frappe.contacts.doctype.contact.contact import get_contact_details from frappe.core.doctype.user_permission.user_permission import get_permitted_documents from frappe.model.utils import get_fetch_values -from frappe.utils import (add_days, getdate, formatdate, date_diff, - add_years, get_timestamp, nowdate, flt, cstr, add_months, get_last_day, cint) -from frappe.contacts.doctype.address.address import (get_address_display, - get_default_address, get_company_address) -from frappe.contacts.doctype.contact.contact import get_contact_details -from erpnext.exceptions import PartyFrozen, PartyDisabled, InvalidAccountCurrency -from erpnext.accounts.utils import get_fiscal_year +from frappe.utils import ( + add_days, + add_months, + add_years, + cint, + cstr, + date_diff, + flt, + formatdate, + get_last_day, + get_timestamp, + getdate, + nowdate, +) +from six import iteritems, string_types + +import erpnext from erpnext import get_company_currency +from erpnext.accounts.utils import get_fiscal_year +from erpnext.exceptions import InvalidAccountCurrency, PartyDisabled, PartyFrozen -from six import iteritems, string_types class DuplicatePartyAccountError(frappe.ValidationError): pass @@ -386,7 +403,7 @@ def get_address_tax_category(tax_category=None, billing_address=None, shipping_a @frappe.whitelist() def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_group=None, tax_category=None, billing_address=None, shipping_address=None, use_for_shopping_cart=None): - from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details + from erpnext.accounts.doctype.tax_rule.tax_rule import get_party_details, get_tax_template args = { party_type.lower(): party, "company": company diff --git a/erpnext/accounts/report/account_balance/account_balance.py b/erpnext/accounts/report/account_balance/account_balance.py index be64c327fdf3..9ae61ddcfd2a 100644 --- a/erpnext/accounts/report/account_balance/account_balance.py +++ b/erpnext/accounts/report/account_balance/account_balance.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.accounts.utils import get_balance_on + def execute(filters=None): filters = frappe._dict(filters or {}) columns = get_columns(filters) diff --git a/erpnext/accounts/report/account_balance/test_account_balance.py b/erpnext/accounts/report/account_balance/test_account_balance.py index f5c9449e85df..94c73f5264b6 100644 --- a/erpnext/accounts/report/account_balance/test_account_balance.py +++ b/erpnext/accounts/report/account_balance/test_account_balance.py @@ -1,10 +1,13 @@ from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import getdate -from erpnext.accounts.report.account_balance.account_balance import execute + from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.accounts.report.account_balance.account_balance import execute + class TestAccountBalance(unittest.TestCase): def test_account_balance(self): diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py index 246ead6016e9..19b66c4a520e 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.py +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport + def execute(filters=None): args = { "party_type": "Supplier", diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py index c08582b564cf..55780d5b0bfa 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py @@ -2,9 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary \ - import AccountsReceivableSummary + +from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import ( + AccountsReceivableSummary, +) + def execute(filters=None): args = { diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index cedfc0f58b83..58508239e5d0 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -2,12 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe import _, scrub -from frappe.utils import getdate, nowdate, flt, cint, formatdate, cstr, now, time_diff_in_seconds + from collections import OrderedDict + +import frappe +from frappe import _, scrub +from frappe.utils import cint, cstr, flt, formatdate, getdate, now, nowdate, time_diff_in_seconds + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) from erpnext.accounts.utils import get_currency_precision -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children # This report gives a summary of all Outstanding Invoices considering the following diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index cca676082381..a748394aaff4 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -1,11 +1,15 @@ from __future__ import unicode_literals + +import unittest + import frappe import frappe.defaults -import unittest -from frappe.utils import today, getdate, add_days -from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from frappe.utils import add_days, getdate, today + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute + class TestAccountsReceivable(unittest.TestCase): def test_accounts_receivable(self): diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py index 4bfb022c4ee8..edcc25dc4f82 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, scrub -from frappe.utils import flt, cint +from frappe.utils import cint, flt +from six import iteritems + from erpnext.accounts.party import get_partywise_advanced_payment_amount from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport -from six import iteritems + def execute(filters=None): args = { diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py index 2162a02eff90..6542333021ba 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py @@ -2,9 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import flt + +import frappe from frappe import _ +from frappe.utils import flt + +import erpnext + def execute(filters=None): columns, data = get_columns(), get_data(filters) diff --git a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py index 5001ad9f12f6..d34bc854bbaf 100644 --- a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +++ b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py @@ -2,9 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import formatdate, flt, add_days +from frappe.utils import add_days, flt, formatdate def execute(filters=None): diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py index 7838385dc56b..78ee7cab9af8 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.py +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py @@ -2,11 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, cint -from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data, - get_filtered_list_for_consolidated_report) +from frappe.utils import cint, flt + +from erpnext.accounts.report.financial_statements import ( + get_columns, + get_data, + get_filtered_list_for_consolidated_report, + get_period_list, +) + def execute(filters=None): period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py index 95f724cc5804..1a1fa964fe06 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import nowdate, getdate +from frappe.utils import getdate, nowdate + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index 63317c52d805..b9843068a18f 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt, getdate, nowdate from frappe import _ +from frappe.utils import flt, getdate, nowdate + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.py b/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.py index 2dcea22f7e67..6c4cd671b24a 100644 --- a/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.py +++ b/erpnext/accounts/report/billed_items_to_be_received/billed_items_to_be_received.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): data = get_data(filters) or [] columns = get_columns() diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py index 443126e4655c..c204250377f4 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py @@ -2,12 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import datetime -from six import iteritems import frappe from frappe import _ from frappe.utils import flt, formatdate +from six import iteritems from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py index 3577457c980d..d5271885b7e1 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.py +++ b/erpnext/accounts/report/cash_flow/cash_flow.py @@ -2,14 +2,23 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cint, cstr -from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data, get_filtered_list_for_consolidated_report) -from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import get_net_profit_loss -from erpnext.accounts.utils import get_fiscal_year from six import iteritems +from erpnext.accounts.report.financial_statements import ( + get_columns, + get_data, + get_filtered_list_for_consolidated_report, + get_period_list, +) +from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( + get_net_profit_loss, +) +from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): if cint(frappe.db.get_single_value('Accounts Settings', 'use_custom_cash_flow')): diff --git a/erpnext/accounts/report/cash_flow/custom_cash_flow.py b/erpnext/accounts/report/cash_flow/custom_cash_flow.py index c11c15390b30..bbc020e591f7 100644 --- a/erpnext/accounts/report/cash_flow/custom_cash_flow.py +++ b/erpnext/accounts/report/cash_flow/custom_cash_flow.py @@ -2,11 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import add_to_date -from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data) -from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import get_net_profit_loss + +from erpnext.accounts.report.financial_statements import get_columns, get_data, get_period_list +from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( + get_net_profit_loss, +) def get_mapper_for(mappers, position): diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py index fc4212733a39..2fcd12947432 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py @@ -2,17 +2,38 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, cint, getdate -from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency +from frappe.utils import cint, flt, getdate + +import erpnext +from erpnext.accounts.report.balance_sheet.balance_sheet import ( + check_opening_balance, + get_chart_data, + get_provisional_profit_loss, +) +from erpnext.accounts.report.balance_sheet.balance_sheet import ( + get_report_summary as get_bs_summary, +) +from erpnext.accounts.report.cash_flow.cash_flow import ( + add_total_row_account, + get_account_type_based_gl_data, + get_cash_flow_accounts, +) +from erpnext.accounts.report.cash_flow.cash_flow import get_report_summary as get_cash_flow_summary from erpnext.accounts.report.financial_statements import get_fiscal_year_data, sort_accounts -from erpnext.accounts.report.balance_sheet.balance_sheet import (get_provisional_profit_loss, - check_opening_balance, get_chart_data, get_report_summary as get_bs_summary) -from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import (get_net_profit_loss, - get_chart_data as get_pl_chart_data, get_report_summary as get_pl_summary) -from erpnext.accounts.report.cash_flow.cash_flow import (get_cash_flow_accounts, get_account_type_based_gl_data, - add_total_row_account, get_report_summary as get_cash_flow_summary) +from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( + get_chart_data as get_pl_chart_data, +) +from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( + get_net_profit_loss, +) +from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( + get_report_summary as get_pl_summary, +) +from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency + def execute(filters=None): columns, data, message, chart = [], [], [], [] diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index c79d7401e6a2..3797402ffd88 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _, scrub from frappe.utils import getdate, nowdate from six import iteritems, itervalues +import erpnext + + class PartyLedgerSummaryReport(object): def __init__(self, filters=None): self.filters = frappe._dict(filters or {}) diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py index 9953d8fcaf58..fae5be087f6d 100644 --- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data + def execute(filters=None): columns = get_column() args = get_args() diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py index de7ed4926e17..4212137d7a69 100644 --- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py +++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py @@ -2,14 +2,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import (flt, cstr) +from frappe.utils import cstr, flt +from six import itervalues -from erpnext.accounts.report.financial_statements import filter_accounts, filter_out_zero_value_rows +import erpnext +from erpnext.accounts.report.financial_statements import ( + filter_accounts, + filter_out_zero_value_rows, +) from erpnext.accounts.report.trial_balance.trial_balance import validate_filters -from six import itervalues def execute(filters=None): validate_filters(filters) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index f5309cd6fdaf..fceef5abb9eb 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -5,19 +5,24 @@ from __future__ import unicode_literals -import re -from past.builtins import cmp import functools import math +import re -import frappe, erpnext -from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency -from erpnext.accounts.utils import get_fiscal_year +import frappe from frappe import _ -from frappe.utils import (flt, getdate, get_first_day, add_months, add_days, formatdate, cstr, cint) - +from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate +from past.builtins import cmp from six import itervalues -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) +from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency +from erpnext.accounts.utils import get_fiscal_year + def get_period_list(from_fiscal_year, to_fiscal_year, period_start_date, period_end_date, filter_based_on, periodicity, accumulated_values=False, company=None, reset_period_on_fy_change=True, ignore_fiscal_year=False): diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 3723c8e0d235..951c1363ac07 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -2,16 +2,24 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from erpnext import get_company_currency, get_default_company -from erpnext.accounts.report.utils import get_currency, convert_to_presentation_currency -from frappe.utils import getdate, cstr, flt, fmt_money + +from collections import OrderedDict + +import frappe from frappe import _, _dict -from erpnext.accounts.utils import get_account_currency -from erpnext.accounts.report.financial_statements import get_cost_centers_with_children +from frappe.utils import cstr, flt, fmt_money, getdate from six import iteritems -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children -from collections import OrderedDict + +import erpnext +from erpnext import get_company_currency, get_default_company +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) +from erpnext.accounts.report.financial_statements import get_cost_centers_with_children +from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency +from erpnext.accounts.utils import get_account_currency + def execute(filters=None): if not filters: diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py index 8e33af7ee8ef..49522d9c8737 100644 --- a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py +++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py @@ -2,11 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import copy + import frappe from frappe import _ from frappe.utils import flt -from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data) -import copy + +from erpnext.accounts.report.financial_statements import get_columns, get_data, get_period_list + def execute(filters=None): period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.period_start_date, diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index c949d9b74e54..dfe643452f28 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _, scrub -from erpnext.stock.utils import get_incoming_rate +from frappe.utils import cint, flt + from erpnext.controllers.queries import get_match_cond -from frappe.utils import flt, cint +from erpnext.stock.utils import get_incoming_rate def execute(filters=None): diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index 7dea80cbe262..a6a69b1d6b6b 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import getdate, add_days, today, cint from frappe import _ +from frappe.utils import add_days, cint, getdate, today + def execute(filters=None): columns = get_columns() diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 685419a17e4a..7f1b3b541511 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -2,14 +2,24 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ from frappe.utils import flt -from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import (get_tax_accounts, - get_grand_total, add_total_row, get_display_value, get_group_by_and_display_fields, add_sub_total_row, - get_group_by_conditions) + +import erpnext +from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import ( + add_sub_total_row, + add_total_row, + get_display_value, + get_grand_total, + get_group_by_and_display_fields, + get_group_by_conditions, + get_tax_accounts, +) from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details + def execute(filters=None): return _execute(filters) diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index c9c22c246ed4..eef10ae5fa34 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -2,13 +2,20 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, cstr from frappe.model.meta import get_field_precision +from frappe.utils import cstr, flt from frappe.utils.xlsxutils import handle_html + +import erpnext from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments -from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details, get_customer_details +from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import ( + get_customer_details, + get_item_details, +) + def execute(filters=None): return _execute(filters) diff --git a/erpnext/accounts/report/non_billed_report.py b/erpnext/accounts/report/non_billed_report.py index 51735056896a..cdda1fc5819c 100644 --- a/erpnext/accounts/report/non_billed_report.py +++ b/erpnext/accounts/report/non_billed_report.py @@ -2,11 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext import get_default_currency from frappe.model.meta import get_field_precision +from erpnext import get_default_currency + + def get_ordered_to_be_billed_data(args): doctype, party = args.get('doctype'), args.get('party') child_tab = doctype + " Item" diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py index 556f5ad4f793..6c6af1cc5a20 100644 --- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.utils import flt, getdate + from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport -from frappe.utils import getdate, flt def execute(filters=None): diff --git a/erpnext/accounts/report/pos_register/pos_register.py b/erpnext/accounts/report/pos_register/pos_register.py index b7e112c0c9aa..9357454b44a0 100644 --- a/erpnext/accounts/report/pos_register/pos_register.py +++ b/erpnext/accounts/report/pos_register/pos_register.py @@ -2,11 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, _dict + from erpnext import get_company_currency, get_default_company from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments + def execute(filters=None): if not filters: return [], [] diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py index 5d04824b5713..ef799f63bf9a 100644 --- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py +++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py @@ -2,11 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt -from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data, - get_filtered_list_for_consolidated_report) + +from erpnext.accounts.report.financial_statements import ( + get_columns, + get_data, + get_filtered_list_for_consolidated_report, + get_period_list, +) + def execute(filters=None): period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index 48bd7308bcad..520dd958d415 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -2,10 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, getdate, formatdate, cstr -from erpnext.accounts.report.financial_statements import filter_accounts, filter_out_zero_value_rows +from frappe.utils import cstr, flt, formatdate, getdate + +from erpnext.accounts.report.financial_statements import ( + filter_accounts, + filter_out_zero_value_rows, +) from erpnext.accounts.report.trial_balance.trial_balance import validate_filters value_fields = ("income", "expense", "gross_profit_loss") diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py index ba236b9969d5..bc8ab52ba6f3 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py @@ -2,8 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py index 10edd41aa886..5d4a03ce60a6 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.py +++ b/erpnext/accounts/report/purchase_register/purchase_register.py @@ -2,10 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe import _, msgprint from frappe.utils import flt -from frappe import msgprint, _ -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) + def execute(filters=None): return _execute(filters) diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py index a5eced5f80b6..5ba0f97cf802 100644 --- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py +++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data + def execute(filters=None): columns = get_column() args = get_args() diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py index ee3992f6f489..fd101d0f6101 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py @@ -2,8 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py index ff774681a291..9ad7007a2cce 100644 --- a/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py +++ b/erpnext/accounts/report/sales_payment_summary/sales_payment_summary.py @@ -1,6 +1,7 @@ # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cstr diff --git a/erpnext/accounts/report/sales_payment_summary/test_sales_payment_summary.py b/erpnext/accounts/report/sales_payment_summary/test_sales_payment_summary.py index e4a3d3527fdd..9fd7bc3de73f 100644 --- a/erpnext/accounts/report/sales_payment_summary/test_sales_payment_summary.py +++ b/erpnext/accounts/report/sales_payment_summary/test_sales_payment_summary.py @@ -2,11 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe -from erpnext.accounts.report.sales_payment_summary.sales_payment_summary import get_mode_of_payments, get_mode_of_payment_details from frappe.utils import today + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry +from erpnext.accounts.report.sales_payment_summary.sales_payment_summary import ( + get_mode_of_payment_details, + get_mode_of_payments, +) test_dependencies = ["Sales Invoice"] diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index f38bd78c0d23..57b69aa81875 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -2,11 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.model.meta import get_field_precision -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children +from frappe.utils import flt + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) + def execute(filters=None): return _execute(filters) diff --git a/erpnext/accounts/report/share_balance/share_balance.py b/erpnext/accounts/report/share_balance/share_balance.py index 9f22f81d2bc8..587430dad84c 100644 --- a/erpnext/accounts/report/share_balance/share_balance.py +++ b/erpnext/accounts/report/share_balance/share_balance.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/accounts/report/share_ledger/share_ledger.py b/erpnext/accounts/report/share_ledger/share_ledger.py index 3ed3c91141ea..fb9538159175 100644 --- a/erpnext/accounts/report/share_ledger/share_ledger.py +++ b/erpnext/accounts/report/share_ledger/share_ledger.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cstr, cint, getdate -from frappe import msgprint, _ +from frappe import _, msgprint +from frappe.utils import cint, cstr, getdate + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py index fbd25b13bb5f..a27b38f75bb5 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py @@ -2,8 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import PartyLedgerSummaryReport + +from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import ( + PartyLedgerSummaryReport, +) + def execute(filters=None): args = { diff --git a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py index 6b9df41f54e5..c4a8c7a899a2 100644 --- a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py +++ b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py @@ -1,10 +1,15 @@ from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + +from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( + get_advance_vouchers, + get_debit_note_amount, +) from erpnext.accounts.utils import get_fiscal_year -from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category \ - import get_advance_vouchers, get_debit_note_amount + def execute(filters=None): validate_filters(filters) diff --git a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py index ceefa31cfa1d..3ab5dc5f23a5 100644 --- a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py +++ b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import getdate + def execute(filters=None): filters["invoices"] = frappe.cache().hget("invoices", frappe.session.user) validate_filters(filters) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 1fc0faab3a72..d65bcc4ada3d 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -2,12 +2,21 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, getdate, formatdate, cstr -from erpnext.accounts.report.financial_statements \ - import filter_accounts, set_gl_entries_by_account, filter_out_zero_value_rows -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions, get_dimension_with_children +from frappe.utils import cstr, flt, formatdate, getdate + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, + get_dimension_with_children, +) +from erpnext.accounts.report.financial_statements import ( + filter_accounts, + filter_out_zero_value_rows, + set_gl_entries_by_account, +) value_fields = ("opening_debit", "opening_credit", "debit", "credit", "closing_debit", "closing_credit") diff --git a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py index f034e7450ee1..8e245443c334 100644 --- a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py +++ b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.py @@ -2,11 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, cint +from frappe.utils import cint, flt + from erpnext.accounts.report.trial_balance.trial_balance import validate_filters + def execute(filters=None): validate_filters(filters) diff --git a/erpnext/accounts/report/unpaid_expense_claim/unpaid_expense_claim.py b/erpnext/accounts/report/unpaid_expense_claim/unpaid_expense_claim.py index 1250d676a06f..71fe4a294a37 100644 --- a/erpnext/accounts/report/unpaid_expense_claim/unpaid_expense_claim.py +++ b/erpnext/accounts/report/unpaid_expense_claim/unpaid_expense_claim.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns, data = [], [] columns = get_columns() diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index ba461edaf868..44a1d97fded5 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -1,9 +1,11 @@ from __future__ import unicode_literals + import frappe +from frappe.utils import cint, flt, formatdate, get_datetime_str + from erpnext import get_company_currency, get_default_company -from erpnext.setup.utils import get_exchange_rate from erpnext.accounts.doctype.fiscal_year.fiscal_year import get_from_and_to_date -from frappe.utils import cint, get_datetime_str, formatdate, flt +from erpnext.setup.utils import get_exchange_rate __exchange_rates = {} diff --git a/erpnext/accounts/test/test_utils.py b/erpnext/accounts/test/test_utils.py index 628c8ce64635..d7b60daa37b8 100644 --- a/erpnext/accounts/test/test_utils.py +++ b/erpnext/accounts/test/test_utils.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import unittest -from erpnext.accounts.party import get_party_shipping_address + from frappe.test_runner import make_test_objects +from erpnext.accounts.party import get_party_shipping_address + class TestUtils(unittest.TestCase): @classmethod diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 0d82a3b47fcb..7478583098f9 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -4,18 +4,20 @@ from __future__ import unicode_literals -import frappe, erpnext +import frappe import frappe.defaults -from frappe.utils import nowdate, cstr, flt, cint, now, getdate -from frappe import throw, _ -from frappe.utils import formatdate, get_number_format_info +from frappe import _, throw +from frappe.model.meta import get_field_precision +from frappe.utils import cint, cstr, flt, formatdate, get_number_format_info, getdate, now, nowdate from six import iteritems + +import erpnext + # imported to enable erpnext.accounts.utils.get_account_currency from erpnext.accounts.doctype.account.account import get_account_currency -from frappe.model.meta import get_field_precision - -from erpnext.stock.utils import get_stock_value_on from erpnext.stock import get_warehouse_account_map +from erpnext.stock.utils import get_stock_value_on + class StockValueAndAccountBalanceOutOfSync(frappe.ValidationError): pass class FiscalYearError(frappe.ValidationError): pass @@ -886,7 +888,9 @@ def get_autoname_with_number(number_value, doc_title, name, company): @frappe.whitelist() def get_coa(doctype, parent, is_root, chart=None): - from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import build_tree_from_json + from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import ( + build_tree_from_json, + ) # add chart to flags to retrieve when called from expand all function chart = chart if chart else frappe.flags.chart diff --git a/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py b/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py index 3bd3d7db065b..c733a98fc579 100644 --- a/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py +++ b/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AgricultureAnalysisCriteria(Document): pass diff --git a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py index d79970b742fe..f0fc1f6220a4 100644 --- a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py +++ b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestAgricultureAnalysisCriteria(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py b/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py index ce39368cd995..80c861ae0c05 100644 --- a/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py +++ b/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AgricultureTask(Document): pass diff --git a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py index e828151d0d80..87168b784382 100644 --- a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py +++ b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestAgricultureTask(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/crop/crop_dashboard.py b/erpnext/agriculture/doctype/crop/crop_dashboard.py index 8f37735c8122..02b937a74b28 100644 --- a/erpnext/agriculture/doctype/crop/crop_dashboard.py +++ b/erpnext/agriculture/doctype/crop/crop_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'transactions': [ diff --git a/erpnext/agriculture/doctype/crop/test_crop.py b/erpnext/agriculture/doctype/crop/test_crop.py index b3079837c359..1968a04796d2 100644 --- a/erpnext/agriculture/doctype/crop/test_crop.py +++ b/erpnext/agriculture/doctype/crop/test_crop.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_dependencies = ["Fertilizer"] class TestCrop(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/detected_disease/detected_disease.py b/erpnext/agriculture/doctype/detected_disease/detected_disease.py index 8c90b839b599..1d8210617ef8 100644 --- a/erpnext/agriculture/doctype/detected_disease/detected_disease.py +++ b/erpnext/agriculture/doctype/detected_disease/detected_disease.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DetectedDisease(Document): pass diff --git a/erpnext/agriculture/doctype/disease/disease.py b/erpnext/agriculture/doctype/disease/disease.py index 8e6ceb4b1dea..e474efe5153a 100644 --- a/erpnext/agriculture/doctype/disease/disease.py +++ b/erpnext/agriculture/doctype/disease/disease.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class Disease(Document): def validate(self): max_period = 0 diff --git a/erpnext/agriculture/doctype/disease/test_disease.py b/erpnext/agriculture/doctype/disease/test_disease.py index 80861770b0d7..1959d1f81120 100644 --- a/erpnext/agriculture/doctype/disease/test_disease.py +++ b/erpnext/agriculture/doctype/disease/test_disease.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestDisease(unittest.TestCase): def test_treatment_period(self): disease = frappe.get_doc('Disease', 'Aphids') diff --git a/erpnext/agriculture/doctype/fertilizer/fertilizer.py b/erpnext/agriculture/doctype/fertilizer/fertilizer.py index c475f002981c..75c2542b85a4 100644 --- a/erpnext/agriculture/doctype/fertilizer/fertilizer.py +++ b/erpnext/agriculture/doctype/fertilizer/fertilizer.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Fertilizer(Document): @frappe.whitelist() def load_contents(self): diff --git a/erpnext/agriculture/doctype/fertilizer/test_fertilizer.py b/erpnext/agriculture/doctype/fertilizer/test_fertilizer.py index 4c71d33fe808..c11c61afec2f 100644 --- a/erpnext/agriculture/doctype/fertilizer/test_fertilizer.py +++ b/erpnext/agriculture/doctype/fertilizer/test_fertilizer.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestFertilizer(unittest.TestCase): def test_fertilizer_creation(self): self.assertEqual(frappe.db.exists('Fertilizer', 'Urea'), 'Urea') diff --git a/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py b/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py index d3852425918b..054f98b6429b 100644 --- a/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py +++ b/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class FertilizerContent(Document): pass diff --git a/erpnext/agriculture/doctype/linked_location/linked_location.py b/erpnext/agriculture/doctype/linked_location/linked_location.py index 3e49d3e18fd7..592ec6c4479c 100644 --- a/erpnext/agriculture/doctype/linked_location/linked_location.py +++ b/erpnext/agriculture/doctype/linked_location/linked_location.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LinkedLocation(Document): pass diff --git a/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py b/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py index daea54b61324..cd3d7d35ae38 100644 --- a/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py +++ b/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LinkedPlantAnalysis(Document): pass diff --git a/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py b/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py index c4e9245cd795..4386cd1a8f08 100644 --- a/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py +++ b/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LinkedSoilAnalysis(Document): pass diff --git a/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py b/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py index 1b7589298e28..8accae9ea60a 100644 --- a/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py +++ b/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LinkedSoilTexture(Document): pass diff --git a/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py b/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py index b65f93de0a0e..2b6141d9cfaa 100644 --- a/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py +++ b/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.naming import make_autoname from frappe.model.document import Document +from frappe.model.naming import make_autoname + class PlantAnalysis(Document): @frappe.whitelist() diff --git a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py index cbd2fd7431a1..a343932948a5 100644 --- a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py +++ b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestPlantAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py b/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py index c1731846a86b..70a28d5ab2ad 100644 --- a/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py +++ b/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PlantAnalysisCriteria(Document): pass diff --git a/erpnext/agriculture/doctype/soil_analysis/soil_analysis.py b/erpnext/agriculture/doctype/soil_analysis/soil_analysis.py index 234d0d4b011e..e0c8177e630c 100644 --- a/erpnext/agriculture/doctype/soil_analysis/soil_analysis.py +++ b/erpnext/agriculture/doctype/soil_analysis/soil_analysis.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SoilAnalysis(Document): @frappe.whitelist() def load_contents(self): diff --git a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py index b89d75631159..d842184e7d1e 100644 --- a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py +++ b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSoilAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py b/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py index b073c200c095..f8e4e9ff2920 100644 --- a/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py +++ b/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SoilAnalysisCriteria(Document): pass diff --git a/erpnext/agriculture/doctype/soil_texture/soil_texture.py b/erpnext/agriculture/doctype/soil_texture/soil_texture.py index d7a5f0917939..636af77f4f8c 100644 --- a/erpnext/agriculture/doctype/soil_texture/soil_texture.py +++ b/erpnext/agriculture/doctype/soil_texture/soil_texture.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, cint +from frappe.utils import cint, flt + class SoilTexture(Document): soil_edit_order = [2, 1, 0] diff --git a/erpnext/agriculture/doctype/soil_texture/test_soil_texture.py b/erpnext/agriculture/doctype/soil_texture/test_soil_texture.py index 16d105c9c58a..c701eb8f271f 100644 --- a/erpnext/agriculture/doctype/soil_texture/test_soil_texture.py +++ b/erpnext/agriculture/doctype/soil_texture/test_soil_texture.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSoilTexture(unittest.TestCase): def test_texture_selection(self): soil_tex = frappe.get_all('Soil Texture', fields=['name'], filters={'collection_datetime': '2017-11-08'}) diff --git a/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py b/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py index a7525ae6e963..86a6c9e8fba5 100644 --- a/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py +++ b/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SoilTextureCriteria(Document): pass diff --git a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py index b6467b7f45d2..5c12294b94e6 100644 --- a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py +++ b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestWaterAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/water_analysis/water_analysis.py b/erpnext/agriculture/doctype/water_analysis/water_analysis.py index ece07002868d..228ae340f206 100644 --- a/erpnext/agriculture/doctype/water_analysis/water_analysis.py +++ b/erpnext/agriculture/doctype/water_analysis/water_analysis.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class WaterAnalysis(Document): @frappe.whitelist() def load_contents(self): diff --git a/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py b/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py index 6833f9053944..78c866444485 100644 --- a/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py +++ b/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WaterAnalysisCriteria(Document): pass diff --git a/erpnext/agriculture/doctype/weather/test_weather.py b/erpnext/agriculture/doctype/weather/test_weather.py index b4ab3ae6f35f..4aa161060e83 100644 --- a/erpnext/agriculture/doctype/weather/test_weather.py +++ b/erpnext/agriculture/doctype/weather/test_weather.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestWeather(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/weather/weather.py b/erpnext/agriculture/doctype/weather/weather.py index 235e684e511e..b41964dafda5 100644 --- a/erpnext/agriculture/doctype/weather/weather.py +++ b/erpnext/agriculture/doctype/weather/weather.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Weather(Document): @frappe.whitelist() def load_contents(self): diff --git a/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py b/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py index 89db74cd7cb4..ea9256cb35c0 100644 --- a/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py +++ b/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WeatherParameter(Document): pass diff --git a/erpnext/agriculture/setup.py b/erpnext/agriculture/setup.py index 75f07be5de2f..d47fb8129031 100644 --- a/erpnext/agriculture/setup.py +++ b/erpnext/agriculture/setup.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.setup.utils import insert_record + def setup_agriculture(): if frappe.get_all('Agriculture Analysis Criteria'): # already setup diff --git a/erpnext/assets/dashboard_fixtures.py b/erpnext/assets/dashboard_fixtures.py index 2c701796072a..bb3d47f4629e 100644 --- a/erpnext/assets/dashboard_fixtures.py +++ b/erpnext/assets/dashboard_fixtures.py @@ -1,13 +1,16 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import frappe import json -from frappe.utils import nowdate, add_months, get_date_str + +import frappe from frappe import _ +from frappe.utils import add_months, get_date_str, nowdate + from erpnext.accounts.dashboard_fixtures import _get_fiscal_year from erpnext.buying.dashboard_fixtures import get_company_for_dashboards + def get_data(): fiscal_year = _get_fiscal_year(nowdate()) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index f1bf31a8e699..c35828e26e87 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -3,18 +3,39 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext, math, json + +import json +import math + +import frappe from frappe import _ -from six import string_types -from frappe.utils import flt, add_months, cint, nowdate, getdate, today, date_diff, month_diff, add_days, get_last_day, get_datetime from frappe.model.document import Document -from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account -from erpnext.assets.doctype.asset.depreciation \ - import get_disposal_account_and_cost_center, get_depreciation_accounts +from frappe.utils import ( + add_days, + add_months, + cint, + date_diff, + flt, + get_datetime, + get_last_day, + getdate, + month_diff, + nowdate, + today, +) +from six import string_types + +import erpnext from erpnext.accounts.general_ledger import make_reverse_gl_entries from erpnext.accounts.utils import get_account_currency +from erpnext.assets.doctype.asset.depreciation import ( + get_depreciation_accounts, + get_disposal_account_and_cost_center, +) +from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account from erpnext.controllers.accounts_controller import AccountsController + class Asset(AccountsController): def validate(self): self.validate_asset_values() @@ -783,6 +804,7 @@ def make_journal_entry(asset_name): @frappe.whitelist() def make_asset_movement(assets, purpose=None): import json + from six import string_types if isinstance(assets, string_types): diff --git a/erpnext/assets/doctype/asset/asset_dashboard.py b/erpnext/assets/doctype/asset/asset_dashboard.py index 62bb4be53aa6..cd04e1d8f043 100644 --- a/erpnext/assets/doctype/asset/asset_dashboard.py +++ b/erpnext/assets/doctype/asset/asset_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'non_standard_fieldnames': { diff --git a/erpnext/assets/doctype/asset/depreciation.py b/erpnext/assets/doctype/asset/depreciation.py index 9a61b79ed351..609791012a2a 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -3,10 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, today, getdate, cint -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_checks_for_pl_and_bs_accounts +from frappe.utils import cint, flt, getdate, today + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_checks_for_pl_and_bs_accounts, +) + def post_depreciation_entries(date=None): # Return if automatic booking of asset depreciation is disabled diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 605ce2e25032..4cc9be5b05de 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -3,14 +3,23 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import cstr, nowdate, getdate, flt, get_last_day, add_days, add_months -from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries, scrap_asset, restore_asset + +import frappe +from frappe.utils import add_days, add_months, cstr, flt, get_last_day, getdate, nowdate + +from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice from erpnext.assets.doctype.asset.asset import make_sales_invoice +from erpnext.assets.doctype.asset.depreciation import ( + post_depreciation_entries, + restore_asset, + scrap_asset, +) +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import ( + make_purchase_invoice as make_invoice, +) from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt -from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice -from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice as make_invoice + class TestAsset(unittest.TestCase): def setUp(self): diff --git a/erpnext/assets/doctype/asset_category/asset_category.py b/erpnext/assets/doctype/asset_category/asset_category.py index 39032d637b5a..1e56c010c462 100644 --- a/erpnext/assets/doctype/asset_category/asset_category.py +++ b/erpnext/assets/doctype/asset_category/asset_category.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cint, get_link_to_form from frappe.model.document import Document +from frappe.utils import cint, get_link_to_form + class AssetCategory(Document): def validate(self): diff --git a/erpnext/assets/doctype/asset_category/test_asset_category.py b/erpnext/assets/doctype/asset_category/test_asset_category.py index 9f7ada65d82f..53ec4ed38efb 100644 --- a/erpnext/assets/doctype/asset_category/test_asset_category.py +++ b/erpnext/assets/doctype/asset_category/test_asset_category.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestAssetCategory(unittest.TestCase): def test_mandatory_fields(self): asset_category = frappe.new_doc("Asset Category") diff --git a/erpnext/assets/doctype/asset_category_account/asset_category_account.py b/erpnext/assets/doctype/asset_category_account/asset_category_account.py index 67925f4fe8bc..bc4e34cf3c9b 100644 --- a/erpnext/assets/doctype/asset_category_account/asset_category_account.py +++ b/erpnext/assets/doctype/asset_category_account/asset_category_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssetCategoryAccount(Document): pass diff --git a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py index bdc2acfb7922..8fac1311d67b 100644 --- a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py +++ b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssetFinanceBook(Document): pass diff --git a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.py b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.py index e14f1d88dcbb..ec55fa4efcb7 100644 --- a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.py +++ b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.py @@ -3,12 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document +from frappe import _, throw from frappe.desk.form import assign_to -from frappe import throw, _ +from frappe.model.document import Document from frappe.utils import add_days, add_months, add_years, getdate, nowdate + class AssetMaintenance(Document): def validate(self): for task in self.get('asset_maintenance_tasks'): diff --git a/erpnext/assets/doctype/asset_maintenance/test_asset_maintenance.py b/erpnext/assets/doctype/asset_maintenance/test_asset_maintenance.py index 7610152039df..0f915086a9fd 100644 --- a/erpnext/assets/doctype/asset_maintenance/test_asset_maintenance.py +++ b/erpnext/assets/doctype/asset_maintenance/test_asset_maintenance.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, get_last_day, add_days -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt + +import frappe +from frappe.utils import add_days, get_last_day, nowdate + from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate_next_due_date +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt + class TestAssetMaintenance(unittest.TestCase): def setUp(self): diff --git a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py index 34facd8d0507..1f2393649d0e 100644 --- a/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py +++ b/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import nowdate, getdate +from frappe.model.document import Document +from frappe.utils import getdate, nowdate + from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate_next_due_date + class AssetMaintenanceLog(Document): def validate(self): if getdate(self.due_date) < getdate(nowdate()) and self.maintenance_status not in ["Completed", "Cancelled"]: diff --git a/erpnext/assets/doctype/asset_maintenance_log/test_asset_maintenance_log.py b/erpnext/assets/doctype/asset_maintenance_log/test_asset_maintenance_log.py index a1ec8792b2d9..7ad69e92abaa 100644 --- a/erpnext/assets/doctype/asset_maintenance_log/test_asset_maintenance_log.py +++ b/erpnext/assets/doctype/asset_maintenance_log/test_asset_maintenance_log.py @@ -5,5 +5,6 @@ import unittest + class TestAssetMaintenanceLog(unittest.TestCase): pass diff --git a/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py b/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py index 2a5666d50649..5cfe052ff088 100644 --- a/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py +++ b/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssetMaintenanceTask(Document): pass diff --git a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py index f741a8fff3e8..6d7f4a82bf4e 100644 --- a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py +++ b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssetMaintenanceTeam(Document): pass diff --git a/erpnext/assets/doctype/asset_maintenance_team/test_asset_maintenance_team.py b/erpnext/assets/doctype/asset_maintenance_team/test_asset_maintenance_team.py index a0c0b146f1bb..8d757b74c066 100644 --- a/erpnext/assets/doctype/asset_maintenance_team/test_asset_maintenance_team.py +++ b/erpnext/assets/doctype/asset_maintenance_team/test_asset_maintenance_team.py @@ -5,5 +5,6 @@ import unittest + class TestAssetMaintenanceTeam(unittest.TestCase): pass diff --git a/erpnext/assets/doctype/asset_movement/asset_movement.py b/erpnext/assets/doctype/asset_movement/asset_movement.py index 1771e27ddfe1..901bdb5c0010 100644 --- a/erpnext/assets/doctype/asset_movement/asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/asset_movement.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class AssetMovement(Document): def validate(self): self.validate_asset() diff --git a/erpnext/assets/doctype/asset_movement/test_asset_movement.py b/erpnext/assets/doctype/asset_movement/test_asset_movement.py index 2b2d2b44004f..36e3655176f1 100644 --- a/erpnext/assets/doctype/asset_movement/test_asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/test_asset_movement.py @@ -3,15 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe +from frappe.utils import add_days, get_last_day, now, nowdate + import erpnext -from erpnext.stock.doctype.item.test_item import make_item -from frappe.utils import now, nowdate, get_last_day, add_days from erpnext.assets.doctype.asset.test_asset import create_asset_data -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + class TestAssetMovement(unittest.TestCase): def setUp(self): diff --git a/erpnext/assets/doctype/asset_movement_item/asset_movement_item.py b/erpnext/assets/doctype/asset_movement_item/asset_movement_item.py index 4c6aaab58a09..24da37176e8d 100644 --- a/erpnext/assets/doctype/asset_movement_item/asset_movement_item.py +++ b/erpnext/assets/doctype/asset_movement_item/asset_movement_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AssetMovementItem(Document): pass diff --git a/erpnext/assets/doctype/asset_repair/asset_repair.py b/erpnext/assets/doctype/asset_repair/asset_repair.py index 746f582fdcd5..99a7d9bfbf82 100644 --- a/erpnext/assets/doctype/asset_repair/asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/asset_repair.py @@ -3,13 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import time_diff_in_hours, getdate, add_months, flt, cint +from frappe.utils import add_months, cint, flt, getdate, time_diff_in_hours + from erpnext.accounts.general_ledger import make_gl_entries from erpnext.assets.doctype.asset.asset import get_asset_account from erpnext.controllers.accounts_controller import AccountsController + class AssetRepair(AccountsController): def validate(self): self.asset_doc = frappe.get_doc('Asset', self.asset) diff --git a/erpnext/assets/doctype/asset_repair/test_asset_repair.py b/erpnext/assets/doctype/asset_repair/test_asset_repair.py index 5e727d007a92..9945a328cfcc 100644 --- a/erpnext/assets/doctype/asset_repair/test_asset_repair.py +++ b/erpnext/assets/doctype/asset_repair/test_asset_repair.py @@ -2,10 +2,18 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import nowdate, flt + import unittest -from erpnext.assets.doctype.asset.test_asset import create_asset_data, create_asset, set_depreciation_settings_in_company + +import frappe +from frappe.utils import flt, nowdate + +from erpnext.assets.doctype.asset.test_asset import ( + create_asset, + create_asset_data, + set_depreciation_settings_in_company, +) + class TestAssetRepair(unittest.TestCase): def setUp(self): @@ -110,8 +118,8 @@ def num_of_depreciations(asset): return asset.finance_books[0].total_number_of_depreciations def create_asset_repair(**args): - from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice + from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse args = frappe._dict(args) diff --git a/erpnext/assets/doctype/asset_repair_consumed_item/asset_repair_consumed_item.py b/erpnext/assets/doctype/asset_repair_consumed_item/asset_repair_consumed_item.py index fa22a5712f4b..2a8d64ef490c 100644 --- a/erpnext/assets/doctype/asset_repair_consumed_item/asset_repair_consumed_item.py +++ b/erpnext/assets/doctype/asset_repair_consumed_item/asset_repair_consumed_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class AssetRepairConsumedItem(Document): pass diff --git a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py index 2f6b5ee2dc9a..2c11018caa9d 100644 --- a/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py +++ b/erpnext/assets/doctype/asset_value_adjustment/asset_value_adjustment.py @@ -3,12 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, getdate, cint, date_diff, formatdate -from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts from frappe.model.document import Document -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_checks_for_pl_and_bs_accounts +from frappe.utils import cint, date_diff, flt, formatdate, getdate + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_checks_for_pl_and_bs_accounts, +) +from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts + class AssetValueAdjustment(Document): def validate(self): diff --git a/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py b/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py index a9dc9795ee37..52728d6fd69a 100644 --- a/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py +++ b/erpnext/assets/doctype/asset_value_adjustment/test_asset_value_adjustment.py @@ -3,12 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, get_last_day, add_days + +import frappe +from frappe.utils import add_days, get_last_day, nowdate + from erpnext.assets.doctype.asset.test_asset import create_asset_data +from erpnext.assets.doctype.asset_value_adjustment.asset_value_adjustment import ( + get_current_asset_value, +) from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt -from erpnext.assets.doctype.asset_value_adjustment.asset_value_adjustment import get_current_asset_value + class TestAssetValueAdjustment(unittest.TestCase): def setUp(self): diff --git a/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py b/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py index 54fba3f68c11..8e6a25d4b770 100644 --- a/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py +++ b/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DepreciationSchedule(Document): pass diff --git a/erpnext/assets/doctype/linked_location/linked_location.py b/erpnext/assets/doctype/linked_location/linked_location.py index 3e49d3e18fd7..592ec6c4479c 100644 --- a/erpnext/assets/doctype/linked_location/linked_location.py +++ b/erpnext/assets/doctype/linked_location/linked_location.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LinkedLocation(Document): pass diff --git a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py index 3d9e555db6d8..e70570dceded 100644 --- a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py +++ b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MaintenanceTeamMember(Document): pass diff --git a/erpnext/assets/doctype/maintenance_team_member/test_maintenance_team_member.py b/erpnext/assets/doctype/maintenance_team_member/test_maintenance_team_member.py index c805e56e5ca7..f8958c6bbefd 100644 --- a/erpnext/assets/doctype/maintenance_team_member/test_maintenance_team_member.py +++ b/erpnext/assets/doctype/maintenance_team_member/test_maintenance_team_member.py @@ -5,5 +5,6 @@ import unittest + class TestMaintenanceTeamMember(unittest.TestCase): pass diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py index 7d07397944b7..cf2695802efa 100644 --- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py +++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py @@ -2,10 +2,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cstr, today, flt, add_years, formatdate, getdate -from erpnext.accounts.report.financial_statements import get_period_list, get_fiscal_year_data, validate_fiscal_year +from frappe.utils import add_years, cstr, flt, formatdate, getdate, today + +from erpnext.accounts.report.financial_statements import ( + get_fiscal_year_data, + get_period_list, + validate_fiscal_year, +) + def execute(filters=None): filters = frappe._dict(filters or {}) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.py b/erpnext/buying/doctype/buying_settings/buying_settings.py index a634a0908b09..9e72c1890c51 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.py +++ b/erpnext/buying/doctype/buying_settings/buying_settings.py @@ -4,10 +4,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class BuyingSettings(Document): def validate(self): for key in ["supplier_group", "supp_master_name", "maintain_same_rate", "buying_price_list"]: diff --git a/erpnext/buying/doctype/buying_settings/test_buying_settings.py b/erpnext/buying/doctype/buying_settings/test_buying_settings.py index bf6eec67d4ce..4998aebd6bb2 100644 --- a/erpnext/buying/doctype/buying_settings/test_buying_settings.py +++ b/erpnext/buying/doctype/buying_settings/test_buying_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBuyingSettings(unittest.TestCase): pass diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index ca3bd90960cc..ac86337b2570 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -2,23 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json -from frappe.utils import cstr, flt, cint -from frappe import msgprint, _ -from frappe.model.mapper import get_mapped_doc -from erpnext.controllers.buying_controller import BuyingController -from erpnext.stock.doctype.item.item import get_last_purchase_details -from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty + +import frappe +from frappe import _, msgprint from frappe.desk.notifications import clear_doctype_notifications -from erpnext.buying.utils import validate_for_items, check_on_hold_or_closed_status -from erpnext.stock.utils import get_bin +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, cstr, flt + +from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + unlink_inter_company_doc, + update_linked_doc, + validate_inter_company_party, +) +from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( + get_party_tax_withholding_details, +) from erpnext.accounts.party import get_party_account_currency -from erpnext.stock.doctype.item.item import get_item_defaults +from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items +from erpnext.controllers.buying_controller import BuyingController from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults -from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import get_party_tax_withholding_details -from erpnext.accounts.doctype.sales_invoice.sales_invoice import (validate_inter_company_party, - update_linked_doc, unlink_inter_company_doc) +from erpnext.stock.doctype.item.item import get_item_defaults, get_last_purchase_details +from erpnext.stock.stock_balance import get_ordered_qty, update_bin_qty +from erpnext.stock.utils import get_bin form_grid_templates = { "items": "templates/form_grid/item_grid.html" diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index ab514dac3087..af1dceb4070a 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'purchase_order', diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index fa174ba8fa89..164e2813f8e9 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -2,24 +2,34 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import json import unittest + import frappe -import json import frappe.defaults +from frappe.utils import add_days, flt, getdate, nowdate + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry -from frappe.utils import flt, add_days, nowdate, getdate -from erpnext.stock.doctype.item.test_item import make_item -from erpnext.buying.doctype.purchase_order.purchase_order \ - import (make_purchase_receipt, make_purchase_invoice as make_pi_from_po, make_rm_stock_entry as make_subcontract_transfer_entry) -from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice as make_pi_from_pr -from erpnext.stock.doctype.material_request.test_material_request import make_material_request -from erpnext.stock.doctype.material_request.material_request import make_purchase_order -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry +from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_purchase_invoice as make_pi_from_po, +) +from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt +from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_rm_stock_entry as make_subcontract_transfer_entry, +) from erpnext.controllers.accounts_controller import update_child_qty_rate from erpnext.controllers.status_updater import OverAllowanceError from erpnext.manufacturing.doctype.blanket_order.test_blanket_order import make_blanket_order - from erpnext.stock.doctype.batch.test_batch import make_new_batch +from erpnext.stock.doctype.item.test_item import make_item +from erpnext.stock.doctype.material_request.material_request import make_purchase_order +from erpnext.stock.doctype.material_request.test_material_request import make_material_request +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import ( + make_purchase_invoice as make_pi_from_pr, +) +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_receipt(self): @@ -415,10 +425,12 @@ def test_return_against_purchase_order(self): self.assertEqual(po.get("items")[0].received_qty, 9) # Make return purchase receipt, purchase invoice and check quantity - from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \ - import make_purchase_receipt as make_purchase_receipt_return - from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice \ - import make_purchase_invoice as make_purchase_invoice_return + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import ( + make_purchase_invoice as make_purchase_invoice_return, + ) + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( + make_purchase_receipt as make_purchase_receipt_return, + ) pr1 = make_purchase_receipt_return(is_return=1, return_against=pr.name, qty=-3, do_not_submit=True) pr1.items[0].purchase_order = po.name @@ -484,7 +496,10 @@ def test_purchase_order_on_hold(self): def test_make_purchase_invoice_with_terms(self): - from erpnext.selling.doctype.sales_order.test_sales_order import automatically_fetch_payment_terms, compare_payment_schedules + from erpnext.selling.doctype.sales_order.test_sales_order import ( + automatically_fetch_payment_terms, + compare_payment_schedules, + ) automatically_fetch_payment_terms() po = create_purchase_order(do_not_save=True) @@ -977,9 +992,14 @@ def test_po_optional_blanket_order(self): self.assertEqual(po_doc.items[0].blanket_order, None) def test_payment_terms_are_fetched_when_creating_purchase_invoice(self): - from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template + from erpnext.accounts.doctype.payment_entry.test_payment_entry import ( + create_payment_terms_template, + ) from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice - from erpnext.selling.doctype.sales_order.test_sales_order import automatically_fetch_payment_terms, compare_payment_schedules + from erpnext.selling.doctype.sales_order.test_sales_order import ( + automatically_fetch_payment_terms, + compare_payment_schedules, + ) automatically_fetch_payment_terms() diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py index b6e28b6c6740..a391a3d06887 100644 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseOrderItem(Document): pass diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py index c85ca2fbafc9..9ba18e26983f 100644 --- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py +++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseOrderItemSupplied(Document): pass diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py index 00c93ed1ea38..8c3194d8d5d0 100644 --- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py +++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseReceiptItemSupplied(Document): pass diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py index 8ed6c9e2a6d7..7e7a05af128a 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py @@ -3,20 +3,23 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ +from frappe.core.doctype.communication.email import make +from frappe.desk.form.load import get_attachments from frappe.model.mapper import get_mapped_doc -from frappe.utils import get_url, cint -from frappe.utils.user import get_user_fullname +from frappe.utils import cint, get_url from frappe.utils.print_format import download_pdf -from frappe.desk.form.load import get_attachments -from frappe.core.doctype.communication.email import make +from frappe.utils.user import get_user_fullname +from six import string_types + from erpnext.accounts.party import get_party_account_currency, get_party_details -from erpnext.stock.doctype.material_request.material_request import set_missing_values -from erpnext.controllers.buying_controller import BuyingController from erpnext.buying.utils import validate_for_items - -from six import string_types +from erpnext.controllers.buying_controller import BuyingController +from erpnext.stock.doctype.material_request.material_request import set_missing_values STANDARD_USERS = ("Guest", "Administrator") diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py index 751336dc4c6c..adc035b640e5 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'docstatus': 1, diff --git a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py index 36f87b0b8419..33fde8e6dc81 100644 --- a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py @@ -7,12 +7,16 @@ import frappe from frappe.utils import nowdate + +from erpnext.buying.doctype.request_for_quotation.request_for_quotation import ( + create_supplier_quotation, + make_supplier_quotation_from_rfq, +) +from erpnext.crm.doctype.opportunity.opportunity import make_request_for_quotation as make_rfq +from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity from erpnext.stock.doctype.item.test_item import make_item from erpnext.templates.pages.rfq import check_supplier_has_docname_access -from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation_from_rfq -from erpnext.buying.doctype.request_for_quotation.request_for_quotation import create_supplier_quotation -from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity -from erpnext.crm.doctype.opportunity.opportunity import make_request_for_quotation as make_rfq + class TestRequestforQuotation(unittest.TestCase): def test_quote_status(self): diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py index cc897af944be..6f7997f4bfeb 100644 --- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py +++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class RequestforQuotationItem(Document): pass diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py index 4b0bbbee8c2e..8dd524ad8dab 100644 --- a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py +++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class RequestforQuotationSupplier(Document): pass diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index c9750caa65a2..15829009f889 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -2,13 +2,22 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe import frappe.defaults -from frappe import msgprint, _ +from frappe import _, msgprint +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.model.naming import set_name_by_naming_series -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address + +from erpnext.accounts.party import ( # keep this + get_dashboard_info, + get_timeline_data, + validate_party_accounts, +) from erpnext.utilities.transaction_base import TransactionBase -from erpnext.accounts.party import validate_party_accounts, get_dashboard_info, get_timeline_data # keep this class Supplier(TransactionBase): @@ -92,9 +101,10 @@ def create_primary_contact(self): self.db_set('email_id', self.email_id) def create_primary_address(self): - from erpnext.selling.doctype.customer.customer import make_address from frappe.contacts.doctype.address.address import get_address_display + from erpnext.selling.doctype.customer.customer import make_address + if self.flags.is_new_doc and self.get('address_line1'): address = make_address(self) address_display = get_address_display(address.name) diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py index 898046627009..8a4eefa4fd35 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.py +++ b/erpnext/buying/doctype/supplier/test_supplier.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals +import unittest + +import frappe +from frappe.test_runner import make_test_records -import frappe, unittest from erpnext.accounts.party import get_due_date from erpnext.exceptions import PartyDisabled -from frappe.test_runner import make_test_records test_dependencies = ['Payment Term', 'Payment Terms Template'] test_records = frappe.get_test_records('Supplier') diff --git a/erpnext/buying/doctype/supplier_item_group/supplier_item_group.py b/erpnext/buying/doctype/supplier_item_group/supplier_item_group.py index 4473ddea28e9..6d71f7d5160c 100644 --- a/erpnext/buying/doctype/supplier_item_group/supplier_item_group.py +++ b/erpnext/buying/doctype/supplier_item_group/supplier_item_group.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class SupplierItemGroup(Document): def validate(self): exists = frappe.db.exists({ diff --git a/erpnext/buying/doctype/supplier_item_group/test_supplier_item_group.py b/erpnext/buying/doctype/supplier_item_group/test_supplier_item_group.py index c75044d44eb7..55ba85ef2d6b 100644 --- a/erpnext/buying/doctype/supplier_item_group/test_supplier_item_group.py +++ b/erpnext/buying/doctype/supplier_item_group/test_supplier_item_group.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestSupplierItemGroup(unittest.TestCase): pass diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index 25e4e2a4dcfc..ae64d2466d1e 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -2,13 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, nowdate, add_days, getdate from frappe.model.mapper import get_mapped_doc +from frappe.utils import add_days, flt, getdate, nowdate -from erpnext.controllers.buying_controller import BuyingController from erpnext.buying.utils import validate_for_items +from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { "items": "templates/form_grid/item_grid.html" diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py index 6b40305e01ff..014b1025dd38 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'supplier_quotation', diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 6f34ca6c390e..2ca3975f9443 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -3,10 +3,13 @@ from __future__ import unicode_literals + import unittest + import frappe import frappe.defaults + class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_order(self): from erpnext.buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py index 64dda8794501..33ed22a6044c 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SupplierQuotationItem(Document): pass diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py index e956afdf749e..f944fe446658 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe import throw, _ -from frappe.model.document import Document + import time from datetime import timedelta -from frappe.utils import nowdate, get_last_day, getdate, add_days, add_years -from erpnext.buying.doctype.supplier_scorecard_period.supplier_scorecard_period import make_supplier_scorecard + +import frappe +from frappe import _, throw +from frappe.model.document import Document +from frappe.utils import add_days, add_years, get_last_day, getdate, nowdate + +from erpnext.buying.doctype.supplier_scorecard_period.supplier_scorecard_period import ( + make_supplier_scorecard, +) + class SupplierScorecard(Document): diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py index 8e5cce5696b6..7186e01d084d 100644 --- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py +++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py index a5f05ea52580..ef7fae3f1118 100644 --- a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSupplierScorecard(unittest.TestCase): def test_create_scorecard(self): diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py index 33a0dc783772..c456377d9b77 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import re + import frappe from frappe import _ -import re from frappe.model.document import Document + class InvalidFormulaVariable(frappe.ValidationError): pass class SupplierScorecardCriteria(Document): diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py index 3babfc8cab37..9fca9a9f17a7 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSupplierScorecardCriteria(unittest.TestCase): def test_variables_exist(self): delete_test_scorecards() diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py index cc345e96bb83..b03d216ce238 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py @@ -3,12 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import throw, _ +from frappe import _, throw from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc + import erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable as variable_functions -from erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria import get_variables +from erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria import ( + get_variables, +) + class SupplierScorecardPeriod(Document): diff --git a/erpnext/buying/doctype/supplier_scorecard_period/test_supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/test_supplier_scorecard_period.py index 8baa3185ba75..de8bc0a02720 100644 --- a/erpnext/buying/doctype/supplier_scorecard_period/test_supplier_scorecard_period.py +++ b/erpnext/buying/doctype/supplier_scorecard_period/test_supplier_scorecard_period.py @@ -5,5 +5,6 @@ import unittest + class TestSupplierScorecardPeriod(unittest.TestCase): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.py b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.py index b64abed8a67d..79d5082ab6aa 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SupplierScorecardScoringCriteria(Document): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.py b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.py index e8ad79f33d39..5063b20ddbb7 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.py +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SupplierScorecardScoringStanding(Document): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.py b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.py index 58a8a99a09c3..476cb35e8cdb 100644 --- a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.py +++ b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SupplierScorecardScoringVariable(Document): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.py b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.py index 678855a457b6..4fc45e89c7b3 100644 --- a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.py +++ b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SupplierScorecardStanding(Document): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_standing/test_supplier_scorecard_standing.py b/erpnext/buying/doctype/supplier_scorecard_standing/test_supplier_scorecard_standing.py index 4d9665131375..5ac5927d081e 100644 --- a/erpnext/buying/doctype/supplier_scorecard_standing/test_supplier_scorecard_standing.py +++ b/erpnext/buying/doctype/supplier_scorecard_standing/test_supplier_scorecard_standing.py @@ -5,5 +5,6 @@ import unittest + class TestSupplierScorecardStanding(unittest.TestCase): pass diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py index 89a6459bbabc..30b2a1893f1f 100644 --- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py +++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import sys + +import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import getdate + class VariablePathNotFound(frappe.ValidationError): pass class SupplierScorecardVariable(Document): @@ -18,7 +21,9 @@ def validate(self): def validate_path_exists(self): if '.' in self.path: try: - from erpnext.buying.doctype.supplier_scorecard_period.supplier_scorecard_period import import_string_path + from erpnext.buying.doctype.supplier_scorecard_period.supplier_scorecard_period import ( + import_string_path, + ) import_string_path(self.path) except AttributeError: frappe.throw(_("Could not find path for " + self.path), VariablePathNotFound) diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py b/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py index 14b87105e66a..990413cd404f 100644 --- a/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py +++ b/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py @@ -3,10 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable import VariablePathNotFound +import frappe + +from erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable import ( + VariablePathNotFound, +) class TestSupplierScorecardVariable(unittest.TestCase): diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 99bcbe633cc7..cb9923428207 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): columns = get_columns(filters) data = get_data(filters) diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index c36083f2aff3..a5b09473a059 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -2,15 +2,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + import unittest from datetime import datetime + import frappe + +from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt from erpnext.buying.report.procurement_tracker.procurement_tracker import execute -from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.material_request.material_request import make_purchase_order -from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt +from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse + class TestProcurementTracker(unittest.TestCase): def test_result_for_procurement_tracker(self): filters = { diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.py b/erpnext/buying/report/purchase_analytics/purchase_analytics.py index 0f949477b1cc..bef66da4818c 100644 --- a/erpnext/buying/report/purchase_analytics/purchase_analytics.py +++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.py @@ -2,7 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from erpnext.selling.report.sales_analytics.sales_analytics import Analytics + def execute(filters=None): return Analytics(filters).run() diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py index bda172769a90..5d59456550b1 100644 --- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py +++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import copy + +import frappe from frappe import _ -from frappe.utils import flt, date_diff, getdate +from frappe.utils import date_diff, flt, getdate + def execute(filters=None): if not filters: diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py index 095a44319d68..7ce73171a1b8 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py index faf67c9f7f3d..42cc6ebc0a66 100644 --- a/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py +++ b/erpnext/buying/report/requested_items_to_order_and_receive/requested_items_to_order_and_receive.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import copy + +import frappe from frappe import _ -from frappe.utils import flt, date_diff, getdate +from frappe.utils import date_diff, flt, getdate + def execute(filters=None): if not filters: diff --git a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py index 9a45972837b8..202d3641859e 100644 --- a/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py +++ b/erpnext/buying/report/subcontract_order_summary/subcontract_order_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns, data = [], [] columns = get_columns() diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py index 2da53d726b79..9299cca0da4a 100644 --- a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py +++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if filters.from_date >= filters.to_date: frappe.msgprint(_("To Date must be greater than From Date")) diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py index cb304a1fdab7..694b5541c29f 100644 --- a/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py +++ b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py @@ -3,12 +3,19 @@ # Compiled at: 2019-05-06 09:51:46 # Decompiled by https://python-decompiler.com from __future__ import unicode_literals -from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order + +import unittest +from pprint import pprint + +import frappe + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt +from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order +from erpnext.buying.report.subcontracted_item_to_be_received.subcontracted_item_to_be_received import ( + execute, +) from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry -from erpnext.buying.report.subcontracted_item_to_be_received.subcontracted_item_to_be_received import execute -import frappe, unittest -from pprint import pprint + class TestSubcontractedItemToBeReceived(unittest.TestCase): diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py index 96cacb6f1b50..a8fad967d401 100644 --- a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if filters.from_date >= filters.to_date: frappe.msgprint(_("To Date must be greater than From Date")) diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py index 2448e17c50fb..dcdc5e36abe8 100644 --- a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py @@ -3,11 +3,19 @@ # Compiled at: 2019-05-06 10:24:35 # Decompiled by https://python-decompiler.com from __future__ import unicode_literals -from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order + +import json +import unittest + +import frappe + from erpnext.buying.doctype.purchase_order.purchase_order import make_rm_stock_entry +from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order +from erpnext.buying.report.subcontracted_raw_materials_to_be_transferred.subcontracted_raw_materials_to_be_transferred import ( + execute, +) from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry -from erpnext.buying.report.subcontracted_raw_materials_to_be_transferred.subcontracted_raw_materials_to_be_transferred import execute -import json, frappe, unittest + class TestSubcontractedItemToBeTransferred(unittest.TestCase): diff --git a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py index a5a3105a8479..62b83ede04bc 100644 --- a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py +++ b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py @@ -2,12 +2,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from collections import defaultdict + import frappe -from frappe.utils import flt, cint from frappe import _ -from collections import defaultdict +from frappe.utils import cint, flt + from erpnext.setup.utils import get_exchange_rate + def execute(filters=None): if not filters: return [], [] diff --git a/erpnext/buying/utils.py b/erpnext/buying/utils.py index 17928634e782..81d995ce8de1 100644 --- a/erpnext/buying/utils.py +++ b/erpnext/buying/utils.py @@ -2,13 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import json + import frappe -from frappe.utils import flt, cstr, cint from frappe import _ -import json +from frappe.utils import cint, cstr, flt + +from erpnext.stock.doctype.item.item import get_last_purchase_details, validate_end_of_life -from erpnext.stock.doctype.item.item import get_last_purchase_details -from erpnext.stock.doctype.item.item import validate_end_of_life def update_last_purchase_rate(doc, is_submit): """updates last_purchase_rate in item table for each item""" diff --git a/erpnext/commands/__init__.py b/erpnext/commands/__init__.py index 2276c738fbe4..f3bf11ad6522 100644 --- a/erpnext/commands/__init__.py +++ b/erpnext/commands/__init__.py @@ -1,10 +1,12 @@ # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt -from __future__ import unicode_literals, absolute_import, print_function +from __future__ import absolute_import, print_function, unicode_literals + import click import frappe -from frappe.commands import pass_context, get_site +from frappe.commands import get_site, pass_context + def call_command(cmd, context): return click.Context(cmd, obj=context).forward(cmd) diff --git a/erpnext/communication/doctype/communication_medium/communication_medium.py b/erpnext/communication/doctype/communication_medium/communication_medium.py index f233da07d5d3..b15c3bed71b9 100644 --- a/erpnext/communication/doctype/communication_medium/communication_medium.py +++ b/erpnext/communication/doctype/communication_medium/communication_medium.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class CommunicationMedium(Document): pass diff --git a/erpnext/communication/doctype/communication_medium_timeslot/communication_medium_timeslot.py b/erpnext/communication/doctype/communication_medium_timeslot/communication_medium_timeslot.py index d68d2d67a76a..5189b09dc3e1 100644 --- a/erpnext/communication/doctype/communication_medium_timeslot/communication_medium_timeslot.py +++ b/erpnext/communication/doctype/communication_medium_timeslot/communication_medium_timeslot.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class CommunicationMediumTimeslot(Document): pass diff --git a/erpnext/config/education.py b/erpnext/config/education.py index 1c8ab10f537d..ecd771f608c7 100644 --- a/erpnext/config/education.py +++ b/erpnext/config/education.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return [ { diff --git a/erpnext/config/projects.py b/erpnext/config/projects.py index ab4db964772e..d4d4a72a5d14 100644 --- a/erpnext/config/projects.py +++ b/erpnext/config/projects.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return [ { diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index bbf1c7fb934d..4df7fd84012f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2,27 +2,64 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + import json + +import frappe from frappe import _, throw -from frappe.utils import (today, flt, cint, fmt_money, formatdate, - getdate, add_days, add_months, get_last_day, nowdate, get_link_to_form) -from frappe.model.workflow import get_workflow_name, is_transition_condition_satisfied, WorkflowPermissionError -from erpnext.stock.get_item_details import get_conversion_factor, get_item_details -from erpnext.setup.utils import get_exchange_rate -from erpnext.accounts.utils import get_fiscal_years, validate_fiscal_year, get_account_currency -from erpnext.utilities.transaction_base import TransactionBase +from frappe.model.workflow import ( + WorkflowPermissionError, + get_workflow_name, + is_transition_condition_satisfied, +) +from frappe.utils import ( + add_days, + add_months, + cint, + flt, + fmt_money, + formatdate, + get_last_day, + get_link_to_form, + getdate, + nowdate, + today, +) +from six import text_type + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) +from erpnext.accounts.doctype.pricing_rule.utils import ( + apply_pricing_rule_for_free_items, + apply_pricing_rule_on_transaction, + get_applied_pricing_rules, +) +from erpnext.accounts.party import ( + get_party_account, + get_party_account_currency, + validate_party_frozen_disabled, +) +from erpnext.accounts.utils import get_account_currency, get_fiscal_years, validate_fiscal_year from erpnext.buying.utils import update_last_purchase_rate +from erpnext.controllers.print_settings import ( + set_print_templates_for_item_table, + set_print_templates_for_taxes, +) from erpnext.controllers.sales_and_purchase_return import validate_return -from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled, get_party_account -from erpnext.accounts.doctype.pricing_rule.utils import (apply_pricing_rule_on_transaction, - apply_pricing_rule_for_free_items, get_applied_pricing_rules) from erpnext.exceptions import InvalidCurrency -from six import text_type -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions -from erpnext.stock.get_item_details import get_item_warehouse, _get_item_tax_template, get_item_tax_map +from erpnext.setup.utils import get_exchange_rate from erpnext.stock.doctype.packed_item.packed_item import make_packing_list -from erpnext.controllers.print_settings import set_print_templates_for_item_table, set_print_templates_for_taxes +from erpnext.stock.get_item_details import ( + _get_item_tax_template, + get_conversion_factor, + get_item_details, + get_item_tax_map, + get_item_warehouse, +) +from erpnext.utilities.transaction_base import TransactionBase + class AccountMissingError(frappe.ValidationError): pass @@ -1816,7 +1853,12 @@ def validate_child_on_delete(row, parent): def update_bin_on_delete(row, doctype): """Update bin for deleted item (row).""" - from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty, get_ordered_qty, get_indented_qty + from erpnext.stock.stock_balance import ( + get_indented_qty, + get_ordered_qty, + get_reserved_qty, + update_bin_qty, + ) qty_dict = {} if doctype == "Sales Order": diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 974ade358493..426ca52f7f41 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -2,24 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +from collections import OrderedDict + import frappe from frappe import _, msgprint -from frappe.utils import flt,cint, cstr, getdate -from six import iteritems -from collections import OrderedDict -from erpnext.accounts.party import get_party_details -from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.buying.utils import validate_for_items, update_last_purchase_rate -from erpnext.stock.stock_ledger import get_valuation_rate -from erpnext.stock.doctype.serial_no.serial_no import get_auto_serial_nos, auto_make_serial_nos, get_serial_nos from frappe.contacts.doctype.address.address import get_address_display +from frappe.utils import cint, cstr, flt, getdate +from six import iteritems from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget +from erpnext.accounts.party import get_party_details +from erpnext.buying.utils import update_last_purchase_rate, validate_for_items from erpnext.controllers.sales_and_purchase_return import get_rate_for_return -from erpnext.stock.utils import get_incoming_rate - from erpnext.controllers.stock_controller import StockController from erpnext.controllers.subcontracting import Subcontracting +from erpnext.stock.doctype.serial_no.serial_no import ( + auto_make_serial_nos, + get_auto_serial_nos, + get_serial_nos, +) +from erpnext.stock.get_item_details import get_conversion_factor +from erpnext.stock.stock_ledger import get_valuation_rate +from erpnext.stock.utils import get_incoming_rate + class BuyingController(StockController, Subcontracting): diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index 8c361a2e561a..1b56ae9d4dce 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -2,13 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import copy +import json + import frappe from frappe import _ from frappe.utils import cstr, flt -import json, copy - from six import string_types + class ItemVariantExistsError(frappe.ValidationError): pass class InvalidItemAttributeValueError(frappe.ValidationError): pass class ItemTemplateCannotHaveStock(frappe.ValidationError): pass diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index e08c400068b3..019825937476 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils import cint + def set_print_templates_for_item_table(doc, settings): doc.print_templates = { "items": "templates/print_formats/includes/items.html", diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 4b4c8befa532..c31279441635 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -2,14 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -import erpnext + import json -from frappe.desk.reportview import get_match_cond, get_filters_cond -from frappe.utils import nowdate, getdate from collections import defaultdict + +import frappe +from frappe.desk.reportview import get_filters_cond, get_match_cond +from frappe.utils import getdate, nowdate, unique + +import erpnext from erpnext.stock.get_item_details import _get_item_tax_template -from frappe.utils import unique + # searches for active employees @frappe.whitelist() @@ -517,7 +520,9 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): @frappe.whitelist() @frappe.validate_and_sanitize_search_inputs def get_filtered_dimensions(doctype, txt, searchfield, start, page_len, filters): - from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import get_dimension_filter_map + from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import ( + get_dimension_filter_map, + ) dimension_filters = get_dimension_filter_map() dimension_filters = dimension_filters.get((filters.get('dimension'),filters.get('account'))) query_filters = [] @@ -692,7 +697,9 @@ def get_healthcare_service_units(doctype, txt, searchfield, start, page_len, fil company = frappe.db.escape(filters.get('company')), txt = frappe.db.escape('%{0}%'.format(txt))) if filters and filters.get('inpatient_record'): - from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_current_healthcare_service_unit + from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import ( + get_current_healthcare_service_unit, + ) service_unit = get_current_healthcare_service_unit(filters.get('inpatient_record')) # if the patient is admitted, then appointments should be allowed against the admission service unit, diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index f673a9b6e57c..5f2fbeb0c93c 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -2,11 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ from frappe.model.meta import get_field_precision +from frappe.utils import flt, format_datetime, get_datetime + +import erpnext from erpnext.stock.utils import get_incoming_rate -from frappe.utils import flt, get_datetime, format_datetime + class StockOverReturnError(frappe.ValidationError): pass @@ -235,6 +239,7 @@ def get_returned_qty_map_for_row(row_name, doctype): def make_return_doc(doctype, source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos company = frappe.db.get_value("Delivery Note", source_name, "company") default_warehouse_for_sales_return = frappe.db.get_value("Company", company, "default_warehouse_for_sales_return") diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 844c40c8a647..0158a1120f99 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -2,18 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint, flt, cstr, get_link_to_form, nowtime from frappe import _, bold, throw -from erpnext.stock.get_item_details import get_bin_details -from erpnext.stock.utils import get_incoming_rate -from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.stock.doctype.item.item import set_item_default from frappe.contacts.doctype.address.address import get_address_display -from erpnext.controllers.accounts_controller import get_taxes_and_charges +from frappe.utils import cint, cstr, flt, get_link_to_form, nowtime -from erpnext.controllers.stock_controller import StockController +from erpnext.controllers.accounts_controller import get_taxes_and_charges from erpnext.controllers.sales_and_purchase_return import get_rate_for_return +from erpnext.controllers.stock_controller import StockController +from erpnext.stock.doctype.item.item import set_item_default +from erpnext.stock.get_item_details import get_bin_details, get_conversion_factor +from erpnext.stock.utils import get_incoming_rate + class SellingController(StockController): def get_feed(self): diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 7b24e50b1439..8738204ce092 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt, comma_or, nowdate, getdate, now from frappe import _ from frappe.model.document import Document +from frappe.utils import comma_or, flt, getdate, now, nowdate + class OverAllowanceError(frappe.ValidationError): pass diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 17707ecae7f1..718e5d608a42 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -10,7 +10,11 @@ from frappe.utils import cint, cstr, flt, get_link_to_form, getdate import erpnext -from erpnext.accounts.general_ledger import make_gl_entries, make_reverse_gl_entries, process_gl_map +from erpnext.accounts.general_ledger import ( + make_gl_entries, + make_reverse_gl_entries, + process_gl_map, +) from erpnext.accounts.utils import get_fiscal_year from erpnext.controllers.accounts_controller import AccountsController from erpnext.stock import get_warehouse_account_map diff --git a/erpnext/controllers/subcontracting.py b/erpnext/controllers/subcontracting.py index 969829f96519..3addb91aaa00 100644 --- a/erpnext/controllers/subcontracting.py +++ b/erpnext/controllers/subcontracting.py @@ -1,10 +1,13 @@ -import frappe import copy -from frappe import _ -from frappe.utils import flt, cint, get_link_to_form from collections import defaultdict + +import frappe +from frappe import _ +from frappe.utils import cint, flt, get_link_to_form + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + class Subcontracting(): def set_materials_for_subcontracted_items(self, raw_material_table): if self.doctype == 'Purchase Invoice' and not self.update_stock: diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 05edb2530c22..fbfdfdfac89c 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -2,15 +2,23 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import json -import frappe, erpnext + +import frappe from frappe import _, scrub from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction -from erpnext.controllers.accounts_controller import validate_conversion_rate, \ - validate_taxes_and_charges, validate_inclusive_tax -from erpnext.stock.get_item_details import _get_item_tax_template -from erpnext.accounts.doctype.pricing_rule.utils import get_applied_pricing_rules + +import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate +from erpnext.accounts.doctype.pricing_rule.utils import get_applied_pricing_rules +from erpnext.controllers.accounts_controller import ( + validate_conversion_rate, + validate_inclusive_tax, + validate_taxes_and_charges, +) +from erpnext.stock.get_item_details import _get_item_tax_template + class calculate_taxes_and_totals(object): def __init__(self, doc): diff --git a/erpnext/controllers/tests/test_item_variant.py b/erpnext/controllers/tests/test_item_variant.py index 813f0a00758c..b3633e6ff095 100644 --- a/erpnext/controllers/tests/test_item_variant.py +++ b/erpnext/controllers/tests/test_item_variant.py @@ -1,14 +1,17 @@ from __future__ import unicode_literals -import frappe import json import unittest -from erpnext.stock.doctype.item.test_item import set_item_variant_settings +import frappe +from six import string_types + from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code -from erpnext.stock.doctype.quality_inspection.test_quality_inspection import create_quality_inspection_parameter +from erpnext.stock.doctype.item.test_item import set_item_variant_settings +from erpnext.stock.doctype.quality_inspection.test_quality_inspection import ( + create_quality_inspection_parameter, +) -from six import string_types class TestItemVariant(unittest.TestCase): def test_tables_in_template_copied_to_variant(self): diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py index 7a4b2d36148b..7a84aafb2404 100644 --- a/erpnext/controllers/tests/test_mapper.py +++ b/erpnext/controllers/tests/test_mapper.py @@ -1,12 +1,15 @@ from __future__ import unicode_literals + +import json +import random import unittest -import frappe -import random, json +import frappe import frappe.utils -from frappe.utils import nowdate, add_months from frappe.model import mapper from frappe.test_runner import make_test_records +from frappe.utils import add_months, nowdate + class TestMapper(unittest.TestCase): def test_map_docs(self): diff --git a/erpnext/controllers/tests/test_qty_based_taxes.py b/erpnext/controllers/tests/test_qty_based_taxes.py index aaeac5d9399e..41673d1e6fb2 100644 --- a/erpnext/controllers/tests/test_qty_based_taxes.py +++ b/erpnext/controllers/tests/test_qty_based_taxes.py @@ -1,8 +1,11 @@ -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + import unittest -import frappe from uuid import uuid4 as _uuid4 +import frappe + + def uuid4(): return str(_uuid4()) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 9b4b0eb9173a..05d900d0f042 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import getdate from frappe import _ +from frappe.utils import getdate + def get_columns(filters, trans): validate_filters(filters) diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py index 7c072e4fad3d..ff2ed45bd240 100644 --- a/erpnext/controllers/website_list_for_contact.py +++ b/erpnext/controllers/website_list_for_contact.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import json + import frappe from frappe import _ from frappe.utils import flt, has_common from frappe.utils.user import is_website_user + def get_list_context(context=None): return { "global_number_format": frappe.db.get_default("number_format") or "#,###.##", diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index f7c6b6c79934..f8432ea6762c 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -12,7 +12,7 @@ from frappe import _ from frappe.model.document import Document from frappe.utils import get_url, getdate -from frappe.utils.verified_command import verify_request, get_signed_params +from frappe.utils.verified_command import get_signed_params, verify_request class Appointment(Document): diff --git a/erpnext/crm/doctype/appointment/test_appointment.py b/erpnext/crm/doctype/appointment/test_appointment.py index 50c98c59de6a..8c4924f696c0 100644 --- a/erpnext/crm/doctype/appointment/test_appointment.py +++ b/erpnext/crm/doctype/appointment/test_appointment.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe -import unittest import datetime +import unittest + +import frappe def create_test_lead(): diff --git a/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.py b/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.py index ad781d685996..7e1da6773128 100644 --- a/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.py +++ b/erpnext/crm/doctype/appointment_booking_settings/appointment_booking_settings.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import datetime + import frappe from frappe import _ -import datetime from frappe.model.document import Document diff --git a/erpnext/crm/doctype/appointment_booking_settings/test_appointment_booking_settings.py b/erpnext/crm/doctype/appointment_booking_settings/test_appointment_booking_settings.py index 3dc3c3997128..5c5432c52466 100644 --- a/erpnext/crm/doctype/appointment_booking_settings/test_appointment_booking_settings.py +++ b/erpnext/crm/doctype/appointment_booking_settings/test_appointment_booking_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestAppointmentBookingSettings(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/appointment_booking_slots/appointment_booking_slots.py b/erpnext/crm/doctype/appointment_booking_slots/appointment_booking_slots.py index 3cadbc955904..4741c8af5a1a 100644 --- a/erpnext/crm/doctype/appointment_booking_slots/appointment_booking_slots.py +++ b/erpnext/crm/doctype/appointment_booking_slots/appointment_booking_slots.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AppointmentBookingSlots(Document): pass diff --git a/erpnext/crm/doctype/availability_of_slots/availability_of_slots.py b/erpnext/crm/doctype/availability_of_slots/availability_of_slots.py index 8258471eed19..e33d87b19393 100644 --- a/erpnext/crm/doctype/availability_of_slots/availability_of_slots.py +++ b/erpnext/crm/doctype/availability_of_slots/availability_of_slots.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AvailabilityOfSlots(Document): pass diff --git a/erpnext/crm/doctype/campaign_email_schedule/campaign_email_schedule.py b/erpnext/crm/doctype/campaign_email_schedule/campaign_email_schedule.py index 8445b8a397e3..f053e6e7e4f7 100644 --- a/erpnext/crm/doctype/campaign_email_schedule/campaign_email_schedule.py +++ b/erpnext/crm/doctype/campaign_email_schedule/campaign_email_schedule.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class CampaignEmailSchedule(Document): pass diff --git a/erpnext/crm/doctype/contract/test_contract.py b/erpnext/crm/doctype/contract/test_contract.py index d5f4e71bffa3..87716368177a 100644 --- a/erpnext/crm/doctype/contract/test_contract.py +++ b/erpnext/crm/doctype/contract/test_contract.py @@ -8,6 +8,7 @@ import frappe from frappe.utils import add_days, nowdate + class TestContract(unittest.TestCase): def setUp(self): diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py index 60390357277b..cd3a3433f819 100644 --- a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py +++ b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ContractFulfilmentChecklist(Document): pass diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py index c78796be6bda..d6d783b3d620 100644 --- a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py +++ b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestContractFulfilmentChecklist(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/contract_template/contract_template.py b/erpnext/crm/doctype/contract_template/contract_template.py index 9281220eef4e..fc1845c372db 100644 --- a/erpnext/crm/doctype/contract_template/contract_template.py +++ b/erpnext/crm/doctype/contract_template/contract_template.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json + import frappe from frappe.model.document import Document from frappe.utils.jinja import validate_template from six import string_types -import json + class ContractTemplate(Document): def validate(self): diff --git a/erpnext/crm/doctype/contract_template/test_contract_template.py b/erpnext/crm/doctype/contract_template/test_contract_template.py index b2b0db66a594..704cc70484a4 100644 --- a/erpnext/crm/doctype/contract_template/test_contract_template.py +++ b/erpnext/crm/doctype/contract_template/test_contract_template.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestContractTemplate(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py b/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py index 767b1901ab9c..1d53e8a799eb 100644 --- a/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py +++ b/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ContractTemplateFulfilmentTerms(Document): pass diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py index 71c93e8d3931..e9baec461e4f 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate, add_days, today, nowdate, cstr -from frappe.model.document import Document from frappe.core.doctype.communication.email import make +from frappe.model.document import Document +from frappe.utils import add_days, cstr, getdate, nowdate, today + class EmailCampaign(Document): def validate(self): diff --git a/erpnext/crm/doctype/email_campaign/test_email_campaign.py b/erpnext/crm/doctype/email_campaign/test_email_campaign.py index f5eab483330b..f68b8c6d290a 100644 --- a/erpnext/crm/doctype/email_campaign/test_email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/test_email_campaign.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestEmailCampaign(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index 9e00b5aac902..9a5ef496bb93 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -4,13 +4,23 @@ from __future__ import unicode_literals import frappe -from erpnext.accounts.party import set_taxes -from erpnext.controllers.selling_controller import SellingController from frappe import _ from frappe.contacts.address_and_contact import load_address_and_contact from frappe.email.inbox import link_communication_to_document from frappe.model.mapper import get_mapped_doc -from frappe.utils import cint, comma_and, cstr, getdate, has_gravatar, nowdate, validate_email_address +from frappe.utils import ( + cint, + comma_and, + cstr, + getdate, + has_gravatar, + nowdate, + validate_email_address, +) + +from erpnext.accounts.party import set_taxes +from erpnext.controllers.selling_controller import SellingController + class Lead(SellingController): def get_feed(self): diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py index 3950d063f22f..e1c46144e3d2 100644 --- a/erpnext/crm/doctype/lead/lead_dashboard.py +++ b/erpnext/crm/doctype/lead/lead_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'lead', diff --git a/erpnext/crm/doctype/lead/test_lead.py b/erpnext/crm/doctype/lead/test_lead.py index d428a453f9fc..3655c97f368e 100644 --- a/erpnext/crm/doctype/lead/test_lead.py +++ b/erpnext/crm/doctype/lead/test_lead.py @@ -3,9 +3,10 @@ from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = frappe.get_test_records('Lead') class TestLead(unittest.TestCase): diff --git a/erpnext/crm/doctype/lead_source/lead_source.py b/erpnext/crm/doctype/lead_source/lead_source.py index 5c64fb8b4ad1..8de1c4301b16 100644 --- a/erpnext/crm/doctype/lead_source/lead_source.py +++ b/erpnext/crm/doctype/lead_source/lead_source.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class LeadSource(Document): pass diff --git a/erpnext/crm/doctype/lead_source/test_lead_source.py b/erpnext/crm/doctype/lead_source/test_lead_source.py index b5bc6490cf9b..ecf61171e990 100644 --- a/erpnext/crm/doctype/lead_source/test_lead_source.py +++ b/erpnext/crm/doctype/lead_source/test_lead_source.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLeadSource(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/linkedin_settings/linkedin_settings.py b/erpnext/crm/doctype/linkedin_settings/linkedin_settings.py index c56eed84cef2..03c9d9c762c9 100644 --- a/erpnext/crm/doctype/linkedin_settings/linkedin_settings.py +++ b/erpnext/crm/doctype/linkedin_settings/linkedin_settings.py @@ -3,14 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe import requests from frappe import _ -from frappe.utils import get_url_to_form from frappe.model.document import Document +from frappe.utils import get_url_to_form from frappe.utils.file_manager import get_file_path from six.moves.urllib.parse import urlencode + class LinkedInSettings(Document): @frappe.whitelist() def get_authorization_url(self): diff --git a/erpnext/crm/doctype/linkedin_settings/test_linkedin_settings.py b/erpnext/crm/doctype/linkedin_settings/test_linkedin_settings.py index 9c3ef3f32f07..1d86f0c66fe2 100644 --- a/erpnext/crm/doctype/linkedin_settings/test_linkedin_settings.py +++ b/erpnext/crm/doctype/linkedin_settings/test_linkedin_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLinkedInSettings(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.py b/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.py index 3baa011e64d4..88abd423cfa7 100644 --- a/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.py +++ b/erpnext/crm/doctype/lost_reason_detail/lost_reason_detail.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class LostReasonDetail(Document): pass diff --git a/erpnext/crm/doctype/market_segment/market_segment.py b/erpnext/crm/doctype/market_segment/market_segment.py index 830ea693437d..71ce7bd6278e 100644 --- a/erpnext/crm/doctype/market_segment/market_segment.py +++ b/erpnext/crm/doctype/market_segment/market_segment.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MarketSegment(Document): pass diff --git a/erpnext/crm/doctype/market_segment/test_market_segment.py b/erpnext/crm/doctype/market_segment/test_market_segment.py index 2f9ed34f7c44..5c09471dbe3a 100644 --- a/erpnext/crm/doctype/market_segment/test_market_segment.py +++ b/erpnext/crm/doctype/market_segment/test_market_segment.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestMarketSegment(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index a74a94afd68d..7bea150aef97 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -2,14 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json -from frappe.utils import cstr, cint, get_fullname -from frappe import msgprint, _ + +import json + +import frappe +from frappe import _, msgprint +from frappe.email.inbox import link_communication_to_document from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, cstr, get_fullname + +from erpnext.accounts.party import get_party_account_currency from erpnext.setup.utils import get_exchange_rate from erpnext.utilities.transaction_base import TransactionBase -from erpnext.accounts.party import get_party_account_currency -from frappe.email.inbox import link_communication_to_document + class Opportunity(TransactionBase): def after_insert(self): diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py index b8c53f077ae6..2f3369c7fb67 100644 --- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py +++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'opportunity', diff --git a/erpnext/crm/doctype/opportunity/test_opportunity.py b/erpnext/crm/doctype/opportunity/test_opportunity.py index 52aa0b036ae4..347bf6366d28 100644 --- a/erpnext/crm/doctype/opportunity/test_opportunity.py +++ b/erpnext/crm/doctype/opportunity/test_opportunity.py @@ -2,11 +2,13 @@ # See license.txt from __future__ import unicode_literals +import unittest + import frappe -from frappe.utils import today, random_string +from frappe.utils import random_string, today + from erpnext.crm.doctype.lead.lead import make_customer from erpnext.crm.doctype.opportunity.opportunity import make_quotation -import unittest test_records = frappe.get_test_records('Opportunity') diff --git a/erpnext/crm/doctype/opportunity_item/opportunity_item.py b/erpnext/crm/doctype/opportunity_item/opportunity_item.py index 7a5ed63f883b..70e7359881e8 100644 --- a/erpnext/crm/doctype/opportunity_item/opportunity_item.py +++ b/erpnext/crm/doctype/opportunity_item/opportunity_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class OpportunityItem(Document): pass diff --git a/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.py b/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.py index 48b63b091e26..b25f02afffdb 100644 --- a/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.py +++ b/erpnext/crm/doctype/opportunity_lost_reason/opportunity_lost_reason.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class OpportunityLostReason(Document): pass diff --git a/erpnext/crm/doctype/opportunity_lost_reason_detail/opportunity_lost_reason_detail.py b/erpnext/crm/doctype/opportunity_lost_reason_detail/opportunity_lost_reason_detail.py index 8723f1d04577..4bb5c54b1d9d 100644 --- a/erpnext/crm/doctype/opportunity_lost_reason_detail/opportunity_lost_reason_detail.py +++ b/erpnext/crm/doctype/opportunity_lost_reason_detail/opportunity_lost_reason_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class OpportunityLostReasonDetail(Document): pass diff --git a/erpnext/crm/doctype/opportunity_type/opportunity_type.py b/erpnext/crm/doctype/opportunity_type/opportunity_type.py index 48abac3fe291..0b0e2550a177 100644 --- a/erpnext/crm/doctype/opportunity_type/opportunity_type.py +++ b/erpnext/crm/doctype/opportunity_type/opportunity_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class OpportunityType(Document): pass diff --git a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py index 6410bbc3401e..f1333dc9a391 100644 --- a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py +++ b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestOpportunityType(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/sales_stage/sales_stage.py b/erpnext/crm/doctype/sales_stage/sales_stage.py index a80f4cc0894c..757f001e1646 100644 --- a/erpnext/crm/doctype/sales_stage/sales_stage.py +++ b/erpnext/crm/doctype/sales_stage/sales_stage.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SalesStage(Document): pass diff --git a/erpnext/crm/doctype/sales_stage/test_sales_stage.py b/erpnext/crm/doctype/sales_stage/test_sales_stage.py index 80b65130e675..188d125a6be5 100644 --- a/erpnext/crm/doctype/sales_stage/test_sales_stage.py +++ b/erpnext/crm/doctype/sales_stage/test_sales_stage.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSalesStage(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/social_media_post/social_media_post.py b/erpnext/crm/doctype/social_media_post/social_media_post.py index 8e441edba857..14d4521e1e62 100644 --- a/erpnext/crm/doctype/social_media_post/social_media_post.py +++ b/erpnext/crm/doctype/social_media_post/social_media_post.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import datetime + import frappe -from frappe.model.document import Document from frappe import _ -import datetime +from frappe.model.document import Document + class SocialMediaPost(Document): def validate(self): diff --git a/erpnext/crm/doctype/social_media_post/test_social_media_post.py b/erpnext/crm/doctype/social_media_post/test_social_media_post.py index ec81ee587104..c2d041898aaa 100644 --- a/erpnext/crm/doctype/social_media_post/test_social_media_post.py +++ b/erpnext/crm/doctype/social_media_post/test_social_media_post.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestSocialMediaPost(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/twitter_settings/test_twitter_settings.py b/erpnext/crm/doctype/twitter_settings/test_twitter_settings.py index 3f999c1af4bb..ff3163c559b5 100644 --- a/erpnext/crm/doctype/twitter_settings/test_twitter_settings.py +++ b/erpnext/crm/doctype/twitter_settings/test_twitter_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestTwitterSettings(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/twitter_settings/twitter_settings.py b/erpnext/crm/doctype/twitter_settings/twitter_settings.py index 9c37ffd77156..d853c24ddf05 100644 --- a/erpnext/crm/doctype/twitter_settings/twitter_settings.py +++ b/erpnext/crm/doctype/twitter_settings/twitter_settings.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, os, tweepy, json + +import json +import os + +import frappe +import tweepy from frappe import _ from frappe.model.document import Document +from frappe.utils import get_link_to_form, get_url_to_form from frappe.utils.file_manager import get_file_path -from frappe.utils import get_url_to_form, get_link_to_form from tweepy.error import TweepError + class TwitterSettings(Document): @frappe.whitelist() def get_authorize_url(self): diff --git a/erpnext/crm/doctype/utils.py b/erpnext/crm/doctype/utils.py index f244daffea3e..32ed9621c55f 100644 --- a/erpnext/crm/doctype/utils.py +++ b/erpnext/crm/doctype/utils.py @@ -1,6 +1,8 @@ +import json + import frappe from frappe import _ -import json + @frappe.whitelist() def get_last_interaction(contact=None, lead=None): diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py index 238884b5190b..87f516b8c724 100644 --- a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py +++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): columns, data = [], [] columns=get_columns("Campaign Name") diff --git a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py index 2ffbc3e62ac3..df57893ef493 100644 --- a/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py +++ b/erpnext/crm/report/first_response_time_for_opportunity/first_response_time_for_opportunity.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe + def execute(filters=None): columns = [ { diff --git a/erpnext/crm/report/lead_conversion_time/lead_conversion_time.py b/erpnext/crm/report/lead_conversion_time/lead_conversion_time.py index e66bc1ec8e31..71efdb96e753 100644 --- a/erpnext/crm/report/lead_conversion_time/lead_conversion_time.py +++ b/erpnext/crm/report/lead_conversion_time/lead_conversion_time.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, msgprint from frappe.utils import date_diff, flt + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/crm/report/lead_details/lead_details.py b/erpnext/crm/report/lead_details/lead_details.py index 072a47611b7b..11e827642789 100644 --- a/erpnext/crm/report/lead_details/lead_details.py +++ b/erpnext/crm/report/lead_details/lead_details.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe import _ + import frappe +from frappe import _ + def execute(filters=None): columns, data = get_columns(), get_data(filters) diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py index 8fe16a2f4ce3..66a52c983c64 100644 --- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py +++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data + def execute(filters=None): columns, data = [], [] columns=get_columns() diff --git a/erpnext/crm/report/lost_opportunity/lost_opportunity.py b/erpnext/crm/report/lost_opportunity/lost_opportunity.py index 858dcc4da81f..b308ceb272de 100644 --- a/erpnext/crm/report/lost_opportunity/lost_opportunity.py +++ b/erpnext/crm/report/lost_opportunity/lost_opportunity.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe import _ + import frappe +from frappe import _ + def execute(filters=None): columns, data = get_columns(), get_data(filters) diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py index 425b7a8fdd78..4a16f3d53962 100644 --- a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py +++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import add_days, now + def execute(filters=None): columns, data = [], [] set_defaut_value_for_filters(filters) diff --git a/erpnext/demo/demo.py b/erpnext/demo/demo.py index a4e4220c3a9d..5be24206ca06 100644 --- a/erpnext/demo/demo.py +++ b/erpnext/demo/demo.py @@ -1,11 +1,16 @@ from __future__ import unicode_literals -import frappe, sys -import erpnext +import sys + +import frappe import frappe.utils -from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset + +import erpnext +from erpnext.demo.setup import education, healthcare, manufacture, retail, setup_data +from erpnext.demo.user import accounts from erpnext.demo.user import education as edu -from erpnext.demo.setup import education, manufacture, setup_data, healthcare, retail +from erpnext.demo.user import fixed_asset, hr, manufacturing, projects, purchase, sales, stock + """ Make a demo diff --git a/erpnext/demo/setup/education.py b/erpnext/demo/setup/education.py index cf9451d5dae0..304bc3d2c3cd 100644 --- a/erpnext/demo/setup/education.py +++ b/erpnext/demo/setup/education.py @@ -2,11 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json -from frappe.utils.make_random import get_random +import json +import random from datetime import datetime + +import frappe +from frappe.utils.make_random import get_random + from erpnext.demo.setup.setup_data import import_json -import random + def setup_data(): frappe.flags.mute_emails = True diff --git a/erpnext/demo/setup/healthcare.py b/erpnext/demo/setup/healthcare.py index aa389e56b41c..5d5707f6470e 100644 --- a/erpnext/demo/setup/healthcare.py +++ b/erpnext/demo/setup/healthcare.py @@ -2,13 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json -from frappe.utils.make_random import get_random import datetime -from erpnext.demo.setup.setup_data import import_json +import json + +import frappe from frappe.utils import getdate +from frappe.utils.make_random import get_random + +from erpnext.demo.setup.setup_data import import_json from erpnext.healthcare.doctype.lab_test.lab_test import create_test_from_template + def setup_data(): frappe.flags.mute_emails = True make_masters() diff --git a/erpnext/demo/setup/manufacture.py b/erpnext/demo/setup/manufacture.py index 7d6b5012ea6e..5db3519c2cee 100644 --- a/erpnext/demo/setup/manufacture.py +++ b/erpnext/demo/setup/manufacture.py @@ -1,12 +1,15 @@ from __future__ import unicode_literals -import random, json +import json +import random + import frappe -from frappe.utils import nowdate, add_days -from erpnext.demo.setup.setup_data import import_json +from frappe.utils import add_days, nowdate +from six import iteritems + from erpnext.demo.domains import data +from erpnext.demo.setup.setup_data import import_json -from six import iteritems def setup_data(): import_json("Location") diff --git a/erpnext/demo/setup/retail.py b/erpnext/demo/setup/retail.py index 82d1c15ea3e5..90de59d7bf47 100644 --- a/erpnext/demo/setup/retail.py +++ b/erpnext/demo/setup/retail.py @@ -1,12 +1,15 @@ from __future__ import unicode_literals -import random, json +import json +import random + import frappe -from frappe.utils import nowdate, add_days -from erpnext.demo.setup.setup_data import import_json +from frappe.utils import add_days, nowdate +from six import iteritems + from erpnext.demo.domains import data +from erpnext.demo.setup.setup_data import import_json -from six import iteritems def setup_data(): setup_item() diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py index 05ee28a24a41..42f83a3b4e8e 100644 --- a/erpnext/demo/setup/setup_data.py +++ b/erpnext/demo/setup/setup_data.py @@ -1,13 +1,18 @@ from __future__ import print_function, unicode_literals -import random, json -import frappe, erpnext -from frappe.utils.nestedset import get_root_of -from frappe.utils import flt, now_datetime, cstr, random_string -from frappe.utils.make_random import add_random_children, get_random +import json +import random + +import frappe +from frappe import _ from frappe.custom.doctype.custom_field.custom_field import create_custom_fields +from frappe.utils import cstr, flt, now_datetime, random_string +from frappe.utils.make_random import add_random_children, get_random +from frappe.utils.nestedset import get_root_of + +import erpnext from erpnext.demo.domains import data -from frappe import _ + def setup(domain): frappe.flags.in_demo = 1 diff --git a/erpnext/demo/user/accounts.py b/erpnext/demo/user/accounts.py index 7fab7722358b..2a248244850d 100644 --- a/erpnext/demo/user/accounts.py +++ b/erpnext/demo/user/accounts.py @@ -4,19 +4,25 @@ from __future__ import unicode_literals -import erpnext -import frappe import random -from frappe.utils import random_string + +import frappe from frappe.desk import query_report +from frappe.utils import random_string +from frappe.utils.make_random import get_random + +import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry_against_invoice from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry -from frappe.utils.make_random import get_random -from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request, make_payment_entry +from erpnext.accounts.doctype.payment_request.payment_request import ( + make_payment_entry, + make_payment_request, +) from erpnext.demo.user.sales import make_sales_order from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice + def work(): frappe.set_user(frappe.db.get_global('demo_accounts_user')) diff --git a/erpnext/demo/user/education.py b/erpnext/demo/user/education.py index 883a6d88cf2a..adc0463a7ff8 100644 --- a/erpnext/demo/user/education.py +++ b/erpnext/demo/user/education.py @@ -4,13 +4,21 @@ from __future__ import unicode_literals -import frappe import random +from datetime import timedelta + +import frappe from frappe.utils import cstr from frappe.utils.make_random import get_random -from datetime import timedelta -from erpnext.education.api import get_student_group_students, make_attendance_records, enroll_student, \ - get_fee_schedule, collect_fees, get_course + +from erpnext.education.api import ( + collect_fees, + enroll_student, + get_course, + get_fee_schedule, + get_student_group_students, + make_attendance_records, +) def work(): diff --git a/erpnext/demo/user/fixed_asset.py b/erpnext/demo/user/fixed_asset.py index dc094e1c918d..ec0e4c818bad 100644 --- a/erpnext/demo/user/fixed_asset.py +++ b/erpnext/demo/user/fixed_asset.py @@ -6,6 +6,7 @@ import frappe from frappe.utils.make_random import get_random + from erpnext.assets.doctype.asset.asset import make_sales_invoice from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries, scrap_asset diff --git a/erpnext/demo/user/hr.py b/erpnext/demo/user/hr.py index 0211bc8a90a5..17d5829f9080 100644 --- a/erpnext/demo/user/hr.py +++ b/erpnext/demo/user/hr.py @@ -1,15 +1,23 @@ from __future__ import unicode_literals -import frappe, erpnext -import random + import datetime -from frappe.utils import random_string, add_days, get_last_day, getdate -from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet -from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice +import random + +import frappe +from frappe.utils import add_days, get_last_day, getdate, random_string from frappe.utils.make_random import get_random -from erpnext.hr.doctype.expense_claim.test_expense_claim import get_payable_account + +import erpnext from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry -from erpnext.hr.doctype.leave_application.leave_application import (get_leave_balance_on, - OverlapError, AttendanceAlreadyMarkedError) +from erpnext.hr.doctype.expense_claim.test_expense_claim import get_payable_account +from erpnext.hr.doctype.leave_application.leave_application import ( + AttendanceAlreadyMarkedError, + OverlapError, + get_leave_balance_on, +) +from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet +from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice + def work(): frappe.set_user(frappe.db.get_global('demo_hr_user')) diff --git a/erpnext/demo/user/manufacturing.py b/erpnext/demo/user/manufacturing.py index bece0798faab..acc5d35c25bd 100644 --- a/erpnext/demo/user/manufacturing.py +++ b/erpnext/demo/user/manufacturing.py @@ -3,12 +3,17 @@ from __future__ import unicode_literals -import frappe, random, erpnext +import random from datetime import timedelta -from frappe.utils.make_random import how_many + +import frappe from frappe.desk import query_report -from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError +from frappe.utils.make_random import how_many + +import erpnext from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record +from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError + def work(): if random.random() < 0.3: return @@ -68,9 +73,12 @@ def work(): def make_stock_entry_from_pro(pro_id, purpose): from erpnext.manufacturing.doctype.work_order.work_order import make_stock_entry + from erpnext.stock.doctype.stock_entry.stock_entry import ( + DuplicateEntryForWorkOrderError, + IncorrectValuationRateError, + OperationsNotCompleteError, + ) from erpnext.stock.stock_ledger import NegativeStockError - from erpnext.stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, \ - DuplicateEntryForWorkOrderError, OperationsNotCompleteError try: st = frappe.get_doc(make_stock_entry(pro_id, purpose)) diff --git a/erpnext/demo/user/projects.py b/erpnext/demo/user/projects.py index 044e2967fdec..b6b99de532da 100644 --- a/erpnext/demo/user/projects.py +++ b/erpnext/demo/user/projects.py @@ -3,11 +3,14 @@ from __future__ import unicode_literals -import frappe, erpnext +import frappe from frappe.utils import flt from frappe.utils.make_random import get_random -from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet + +import erpnext from erpnext.demo.user.hr import make_sales_invoice_for_timesheet +from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet + def run_projects(current_date): frappe.set_user(frappe.db.get_global('demo_projects_user')) diff --git a/erpnext/demo/user/purchase.py b/erpnext/demo/user/purchase.py index b7aca79cf9ba..ec32f973dae5 100644 --- a/erpnext/demo/user/purchase.py +++ b/erpnext/demo/user/purchase.py @@ -3,15 +3,22 @@ from __future__ import unicode_literals -import frappe, random, json, erpnext -from frappe.utils.make_random import how_many, get_random +import json +import random + +import frappe from frappe.desk import query_report -from erpnext.setup.utils import get_exchange_rate +from frappe.utils.make_random import get_random, how_many + +import erpnext from erpnext.accounts.party import get_party_account_currency +from erpnext.buying.doctype.request_for_quotation.request_for_quotation import ( + make_supplier_quotation_from_rfq, +) from erpnext.exceptions import InvalidCurrency +from erpnext.setup.utils import get_exchange_rate from erpnext.stock.doctype.material_request.material_request import make_request_for_quotation -from erpnext.buying.doctype.request_for_quotation.request_for_quotation import \ - make_supplier_quotation_from_rfq + def work(): frappe.set_user(frappe.db.get_global('demo_purchase_user')) diff --git a/erpnext/demo/user/sales.py b/erpnext/demo/user/sales.py index 8d5ba28b79af..95494ee3242b 100644 --- a/erpnext/demo/user/sales.py +++ b/erpnext/demo/user/sales.py @@ -3,12 +3,20 @@ from __future__ import unicode_literals -import frappe, random, erpnext +import random + +import frappe from frappe.utils import flt from frappe.utils.make_random import add_random_children, get_random -from erpnext.setup.utils import get_exchange_rate + +import erpnext +from erpnext.accounts.doctype.payment_request.payment_request import ( + make_payment_entry, + make_payment_request, +) from erpnext.accounts.party import get_party_account_currency -from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request, make_payment_entry +from erpnext.setup.utils import get_exchange_rate + def work(domain="Manufacturing"): frappe.set_user(frappe.db.get_global('demo_sales_user_2')) diff --git a/erpnext/demo/user/stock.py b/erpnext/demo/user/stock.py index d44da7d127e1..188fc13f24d8 100644 --- a/erpnext/demo/user/stock.py +++ b/erpnext/demo/user/stock.py @@ -3,13 +3,18 @@ from __future__ import print_function, unicode_literals -import frappe, random, erpnext +import random + +import frappe from frappe.desk import query_report -from erpnext.stock.stock_ledger import NegativeStockError -from erpnext.stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError + +import erpnext from erpnext.stock.doctype.batch.batch import UnableToSelectBatchError from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_return from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_return +from erpnext.stock.doctype.serial_no.serial_no import SerialNoQtyError, SerialNoRequiredError +from erpnext.stock.stock_ledger import NegativeStockError + def work(): frappe.set_user(frappe.db.get_global('demo_manufacturing_user')) @@ -66,8 +71,10 @@ def make_delivery_note(): def make_stock_reconciliation(): # random set some items as damaged - from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation \ - import OpeningEntryAccountError, EmptyStockReconciliationItemsError + from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + EmptyStockReconciliationItemsError, + OpeningEntryAccountError, + ) if random.random() < 0.4: stock_reco = frappe.new_doc("Stock Reconciliation") @@ -88,8 +95,11 @@ def make_stock_reconciliation(): frappe.db.rollback() def submit_draft_stock_entries(): - from erpnext.stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, \ - DuplicateEntryForWorkOrderError, OperationsNotCompleteError + from erpnext.stock.doctype.stock_entry.stock_entry import ( + DuplicateEntryForWorkOrderError, + IncorrectValuationRateError, + OperationsNotCompleteError, + ) # try posting older drafts (if exists) frappe.db.commit() diff --git a/erpnext/education/__init__.py b/erpnext/education/__init__.py index c0589bb489bd..a3164b259705 100644 --- a/erpnext/education/__init__.py +++ b/erpnext/education/__init__.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe import _ + class StudentNotInGroupError(frappe.ValidationError): pass def validate_student_belongs_to_group(student, student_group): diff --git a/erpnext/education/api.py b/erpnext/education/api.py index 4493a3fef170..d2a8805c8972 100644 --- a/erpnext/education/api.py +++ b/erpnext/education/api.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ -from frappe.model.mapper import get_mapped_doc -from frappe.utils import flt, cstr, getdate from frappe.email.doctype.email_group.email_group import add_subscribers +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cstr, flt, getdate + def get_course(program): '''Return list of courses for a particular program diff --git a/erpnext/education/doctype/academic_term/academic_term.py b/erpnext/education/doctype/academic_term/academic_term.py index fa7f2899dcb8..b8e22b68c62c 100644 --- a/erpnext/education/doctype/academic_term/academic_term.py +++ b/erpnext/education/doctype/academic_term/academic_term.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate from frappe.model.document import Document +from frappe.utils import getdate + class AcademicTerm(Document): def autoname(self): diff --git a/erpnext/education/doctype/academic_term/academic_term_dashboard.py b/erpnext/education/doctype/academic_term/academic_term_dashboard.py index eb2f90742ce8..a1087b8fc422 100644 --- a/erpnext/education/doctype/academic_term/academic_term_dashboard.py +++ b/erpnext/education/doctype/academic_term/academic_term_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'academic_term', diff --git a/erpnext/education/doctype/academic_term/test_academic_term.py b/erpnext/education/doctype/academic_term/test_academic_term.py index 0964a56454ba..4581afc4ac33 100644 --- a/erpnext/education/doctype/academic_term/test_academic_term.py +++ b/erpnext/education/doctype/academic_term/test_academic_term.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Academic Term') class TestAcademicTerm(unittest.TestCase): diff --git a/erpnext/education/doctype/academic_year/academic_year.py b/erpnext/education/doctype/academic_year/academic_year.py index f2858a42d4bd..9aeeed0d00ff 100644 --- a/erpnext/education/doctype/academic_year/academic_year.py +++ b/erpnext/education/doctype/academic_year/academic_year.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.model.document import Document + class AcademicYear(Document): def validate(self): #Check that start of academic year is earlier than end of academic year diff --git a/erpnext/education/doctype/academic_year/academic_year_dashboard.py b/erpnext/education/doctype/academic_year/academic_year_dashboard.py index d3734df80366..49d68c3af289 100644 --- a/erpnext/education/doctype/academic_year/academic_year_dashboard.py +++ b/erpnext/education/doctype/academic_year/academic_year_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'academic_year', diff --git a/erpnext/education/doctype/academic_year/test_academic_year.py b/erpnext/education/doctype/academic_year/test_academic_year.py index 9da75a72143b..ca6bb7f65ba0 100644 --- a/erpnext/education/doctype/academic_year/test_academic_year.py +++ b/erpnext/education/doctype/academic_year/test_academic_year.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Academic Year') class TestAcademicYear(unittest.TestCase): diff --git a/erpnext/education/doctype/article/article.py b/erpnext/education/doctype/article/article.py index b5cc5cbc7a6a..f3c77880fc19 100644 --- a/erpnext/education/doctype/article/article.py +++ b/erpnext/education/doctype/article/article.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Article(Document): def get_article(self): pass diff --git a/erpnext/education/doctype/article/test_article.py b/erpnext/education/doctype/article/test_article.py index 2fce07f82c13..8de405088a7f 100644 --- a/erpnext/education/doctype/article/test_article.py +++ b/erpnext/education/doctype/article/test_article.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestArticle(unittest.TestCase): pass diff --git a/erpnext/education/doctype/assessment_criteria/assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/assessment_criteria.py index bfbf26cf6c1f..f8f04bf5135b 100644 --- a/erpnext/education/doctype/assessment_criteria/assessment_criteria.py +++ b/erpnext/education/doctype/assessment_criteria/assessment_criteria.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py index fc0d7451108a..879cad3446b1 100644 --- a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py +++ b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Assessment Criteria') class TestAssessmentCriteria(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py index 75381e1d0bfd..f0901b0d3c2c 100644 --- a/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py +++ b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssessmentCriteriaGroup(Document): pass diff --git a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py index 5b293371bb8c..83148a119dec 100644 --- a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py +++ b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Assessment Criteria Group') class TestAssessmentCriteriaGroup(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_group/assessment_group.py b/erpnext/education/doctype/assessment_group/assessment_group.py index 88acc124d31b..166e2af0feae 100644 --- a/erpnext/education/doctype/assessment_group/assessment_group.py +++ b/erpnext/education/doctype/assessment_group/assessment_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssessmentGroup(Document): pass diff --git a/erpnext/education/doctype/assessment_group/assessment_group_dashboard.py b/erpnext/education/doctype/assessment_group/assessment_group_dashboard.py index 1a23606a61d4..83438c0ed74c 100644 --- a/erpnext/education/doctype/assessment_group/assessment_group_dashboard.py +++ b/erpnext/education/doctype/assessment_group/assessment_group_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'assessment_group', diff --git a/erpnext/education/doctype/assessment_group/test_assessment_group.py b/erpnext/education/doctype/assessment_group/test_assessment_group.py index 2fd98b6d02fe..80b8d3edf111 100644 --- a/erpnext/education/doctype/assessment_group/test_assessment_group.py +++ b/erpnext/education/doctype/assessment_group/test_assessment_group.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Assessment Group') class TestAssessmentGroup(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_plan/assessment_plan.py b/erpnext/education/doctype/assessment_plan/assessment_plan.py index 16136c19f717..2a58a313cdd9 100644 --- a/erpnext/education/doctype/assessment_plan/assessment_plan.py +++ b/erpnext/education/doctype/assessment_plan/assessment_plan.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + import frappe from frappe import _ +from frappe.model.document import Document + class AssessmentPlan(Document): def validate(self): diff --git a/erpnext/education/doctype/assessment_plan/assessment_plan_dashboard.py b/erpnext/education/doctype/assessment_plan/assessment_plan_dashboard.py index 8ac3faf6dde7..672953852ed4 100644 --- a/erpnext/education/doctype/assessment_plan/assessment_plan_dashboard.py +++ b/erpnext/education/doctype/assessment_plan/assessment_plan_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'assessment_plan', diff --git a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py index 2de4f23f5b9f..16f37f8abbaa 100644 --- a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py +++ b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Assessment Plan') class TestAssessmentPlan(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py index 53b477f700ab..bcfd73024285 100644 --- a/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py +++ b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssessmentPlanCriteria(Document): pass diff --git a/erpnext/education/doctype/assessment_result/assessment_result.py b/erpnext/education/doctype/assessment_result/assessment_result.py index 7dfe0cf6c274..01f483f8b0be 100644 --- a/erpnext/education/doctype/assessment_result/assessment_result.py +++ b/erpnext/education/doctype/assessment_result/assessment_result.py @@ -3,14 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt from frappe.model.document import Document -from erpnext.education.api import get_grade -from erpnext.education.api import get_assessment_details +from frappe.utils import flt from frappe.utils.csvutils import getlink + import erpnext.education +from erpnext.education.api import get_assessment_details, get_grade + class AssessmentResult(Document): def validate(self): diff --git a/erpnext/education/doctype/assessment_result/assessment_result_dashboard.py b/erpnext/education/doctype/assessment_result/assessment_result_dashboard.py index 2526076d308c..f9e2008ebc7d 100644 --- a/erpnext/education/doctype/assessment_result/assessment_result_dashboard.py +++ b/erpnext/education/doctype/assessment_result/assessment_result_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'reports': [ diff --git a/erpnext/education/doctype/assessment_result/test_assessment_result.py b/erpnext/education/doctype/assessment_result/test_assessment_result.py index adce57769dd1..2b4f22badc11 100644 --- a/erpnext/education/doctype/assessment_result/test_assessment_result.py +++ b/erpnext/education/doctype/assessment_result/test_assessment_result.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.education.api import get_grade # test_records = frappe.get_test_records('Assessment Result') diff --git a/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py index d05159315905..48eff847e1dc 100644 --- a/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py +++ b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssessmentResultDetail(Document): pass diff --git a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py index a0d286ccbe97..d10820003821 100644 --- a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py +++ b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AssessmentResultTool(Document): pass diff --git a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py index f784ccb256b2..1e6dcbb8ecd3 100644 --- a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py +++ b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestAssessmentResultTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/content_activity/content_activity.py b/erpnext/education/doctype/content_activity/content_activity.py index 2ae7a5c94c93..7a0843394bd6 100644 --- a/erpnext/education/doctype/content_activity/content_activity.py +++ b/erpnext/education/doctype/content_activity/content_activity.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ContentActivity(Document): pass diff --git a/erpnext/education/doctype/content_question/content_question.py b/erpnext/education/doctype/content_question/content_question.py index b239d211a3f1..9e8773845e66 100644 --- a/erpnext/education/doctype/content_question/content_question.py +++ b/erpnext/education/doctype/content_question/content_question.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ContentQuestion(Document): pass diff --git a/erpnext/education/doctype/content_question/test_content_question.py b/erpnext/education/doctype/content_question/test_content_question.py index 268b9be2e7a8..bc0a4f85f0c3 100644 --- a/erpnext/education/doctype/content_question/test_content_question.py +++ b/erpnext/education/doctype/content_question/test_content_question.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestContentQuestion(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course/course.py b/erpnext/education/doctype/course/course.py index 92f92ed9f3e7..9cc373a5fe25 100644 --- a/erpnext/education/doctype/course/course.py +++ b/erpnext/education/doctype/course/course.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json -from frappe.model.document import Document + +import frappe from frappe import _ +from frappe.model.document import Document + class Course(Document): def validate(self): diff --git a/erpnext/education/doctype/course/course_dashboard.py b/erpnext/education/doctype/course/course_dashboard.py index 8de91b1c092b..8eca2a135097 100644 --- a/erpnext/education/doctype/course/course_dashboard.py +++ b/erpnext/education/doctype/course/course_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'course', diff --git a/erpnext/education/doctype/course/test_course.py b/erpnext/education/doctype/course/test_course.py index 4667ac45a23a..dd43ef447c22 100644 --- a/erpnext/education/doctype/course/test_course.py +++ b/erpnext/education/doctype/course/test_course.py @@ -2,12 +2,13 @@ # Copyright (c) 2015, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals -from erpnext.education.doctype.topic.test_topic import make_topic -from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content -import frappe import unittest +import frappe + +from erpnext.education.doctype.topic.test_topic import make_topic, make_topic_and_linked_content + # test_records = frappe.get_test_records('Course') class TestCourse(unittest.TestCase): diff --git a/erpnext/education/doctype/course_activity/course_activity.py b/erpnext/education/doctype/course_activity/course_activity.py index 3aa1ea0c5b3d..61b51a05a16b 100644 --- a/erpnext/education/doctype/course_activity/course_activity.py +++ b/erpnext/education/doctype/course_activity/course_activity.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class CourseActivity(Document): def validate(self): self.check_if_enrolled() diff --git a/erpnext/education/doctype/course_activity/test_course_activity.py b/erpnext/education/doctype/course_activity/test_course_activity.py index 5269a6b71a3e..778cefecab13 100644 --- a/erpnext/education/doctype/course_activity/test_course_activity.py +++ b/erpnext/education/doctype/course_activity/test_course_activity.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCourseActivity(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py index ade2a390a279..7ffce22da0d0 100644 --- a/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py +++ b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CourseAssessmentCriteria(Document): pass diff --git a/erpnext/education/doctype/course_content/course_content.py b/erpnext/education/doctype/course_content/course_content.py index 0d2f85ab500a..67691dde637b 100644 --- a/erpnext/education/doctype/course_content/course_content.py +++ b/erpnext/education/doctype/course_content/course_content.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CourseContent(Document): pass diff --git a/erpnext/education/doctype/course_content/test_course_content.py b/erpnext/education/doctype/course_content/test_course_content.py index 9be4b1f5ce34..accf005feccf 100644 --- a/erpnext/education/doctype/course_content/test_course_content.py +++ b/erpnext/education/doctype/course_content/test_course_content.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCourseContent(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_enrollment/course_enrollment.py b/erpnext/education/doctype/course_enrollment/course_enrollment.py index ce88990a70d9..21e74516f89f 100644 --- a/erpnext/education/doctype/course_enrollment/course_enrollment.py +++ b/erpnext/education/doctype/course_enrollment/course_enrollment.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from functools import reduce + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import get_link_to_form -from functools import reduce + class CourseEnrollment(Document): def validate(self): diff --git a/erpnext/education/doctype/course_enrollment/course_enrollment_dashboard.py b/erpnext/education/doctype/course_enrollment/course_enrollment_dashboard.py index 37972fe354c5..253325c586e7 100644 --- a/erpnext/education/doctype/course_enrollment/course_enrollment_dashboard.py +++ b/erpnext/education/doctype/course_enrollment/course_enrollment_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'enrollment', diff --git a/erpnext/education/doctype/course_enrollment/test_course_enrollment.py b/erpnext/education/doctype/course_enrollment/test_course_enrollment.py index 874bf121f477..e5feb1b7f7c9 100644 --- a/erpnext/education/doctype/course_enrollment/test_course_enrollment.py +++ b/erpnext/education/doctype/course_enrollment/test_course_enrollment.py @@ -3,14 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe -from erpnext.education.doctype.student.test_student import create_student -from erpnext.education.doctype.student.test_student import get_student -from erpnext.education.doctype.program.test_program import setup_program from erpnext.education.doctype.course_activity.test_course_activity import make_course_activity +from erpnext.education.doctype.program.test_program import setup_program +from erpnext.education.doctype.student.test_student import create_student, get_student + class TestCourseEnrollment(unittest.TestCase): def setUp(self): diff --git a/erpnext/education/doctype/course_schedule/course_schedule.py b/erpnext/education/doctype/course_schedule/course_schedule.py index 748728d104e9..38379e4c7786 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule.py +++ b/erpnext/education/doctype/course_schedule/course_schedule.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class CourseSchedule(Document): def validate(self): self.instructor_name = frappe.db.get_value("Instructor", self.instructor, "instructor_name") diff --git a/erpnext/education/doctype/course_schedule/course_schedule_dashboard.py b/erpnext/education/doctype/course_schedule/course_schedule_dashboard.py index 22ce7e1ec24e..12a1735f4eaf 100644 --- a/erpnext/education/doctype/course_schedule/course_schedule_dashboard.py +++ b/erpnext/education/doctype/course_schedule/course_schedule_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'course_schedule', diff --git a/erpnext/education/doctype/course_schedule/test_course_schedule.py b/erpnext/education/doctype/course_schedule/test_course_schedule.py index 5bb4de858468..247bfb0ad334 100644 --- a/erpnext/education/doctype/course_schedule/test_course_schedule.py +++ b/erpnext/education/doctype/course_schedule/test_course_schedule.py @@ -3,14 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe +import datetime import unittest -import datetime -from frappe.utils import today, to_timedelta -from erpnext.education.utils import OverlapError +import frappe +from frappe.utils import to_timedelta, today from frappe.utils.make_random import get_random +from erpnext.education.utils import OverlapError + # test_records = frappe.get_test_records('Course Schedule') class TestCourseSchedule(unittest.TestCase): diff --git a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py index 66587f055f6b..4f7ed368211a 100644 --- a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py +++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import calendar + +import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import add_days, getdate + from erpnext.education.utils import OverlapError diff --git a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py index d921f8e0e15c..c7c3f47e980c 100644 --- a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py +++ b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCourseSchedulingTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_topic/course_topic.py b/erpnext/education/doctype/course_topic/course_topic.py index 2364f17a49c9..fabe60a074ef 100644 --- a/erpnext/education/doctype/course_topic/course_topic.py +++ b/erpnext/education/doctype/course_topic/course_topic.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CourseTopic(Document): pass diff --git a/erpnext/education/doctype/course_topic/test_course_topic.py b/erpnext/education/doctype/course_topic/test_course_topic.py index 7ce46d28adf2..8f224e985a44 100644 --- a/erpnext/education/doctype/course_topic/test_course_topic.py +++ b/erpnext/education/doctype/course_topic/test_course_topic.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCourseTopic(unittest.TestCase): pass diff --git a/erpnext/education/doctype/education_settings/education_settings.py b/erpnext/education/doctype/education_settings/education_settings.py index 6c7e95c80daf..71d13f733bdb 100644 --- a/erpnext/education/doctype/education_settings/education_settings.py +++ b/erpnext/education/doctype/education_settings/education_settings.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe import frappe.defaults from frappe.model.document import Document diff --git a/erpnext/education/doctype/education_settings/test_education_settings.py b/erpnext/education/doctype/education_settings/test_education_settings.py index 038fb6e57e1b..aca1de9c74c7 100644 --- a/erpnext/education/doctype/education_settings/test_education_settings.py +++ b/erpnext/education/doctype/education_settings/test_education_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEducationSettings(unittest.TestCase): pass diff --git a/erpnext/education/doctype/fee_category/fee_category.py b/erpnext/education/doctype/fee_category/fee_category.py index 55234442baee..ebfa2f953bf9 100644 --- a/erpnext/education/doctype/fee_category/fee_category.py +++ b/erpnext/education/doctype/fee_category/fee_category.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class FeeCategory(Document): pass diff --git a/erpnext/education/doctype/fee_category/test_fee_category.py b/erpnext/education/doctype/fee_category/test_fee_category.py index 48e7589a0c0e..0bdd78da4997 100644 --- a/erpnext/education/doctype/fee_category/test_fee_category.py +++ b/erpnext/education/doctype/fee_category/test_fee_category.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Fee Category') class TestFeeCategory(unittest.TestCase): diff --git a/erpnext/education/doctype/fee_component/fee_component.py b/erpnext/education/doctype/fee_component/fee_component.py index 8694610927bb..b370d11246c4 100644 --- a/erpnext/education/doctype/fee_component/fee_component.py +++ b/erpnext/education/doctype/fee_component/fee_component.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class FeeComponent(Document): pass diff --git a/erpnext/education/doctype/fee_schedule/fee_schedule.py b/erpnext/education/doctype/fee_schedule/fee_schedule.py index 0b025c753479..6bf46671790e 100644 --- a/erpnext/education/doctype/fee_schedule/fee_schedule.py +++ b/erpnext/education/doctype/fee_schedule/fee_schedule.py @@ -3,13 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe +from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe.utils import money_in_words -from frappe.utils import cint, flt, cstr +from frappe.utils import cint, cstr, flt, money_in_words from frappe.utils.background_jobs import enqueue -from frappe import _ + +import erpnext class FeeSchedule(Document): diff --git a/erpnext/education/doctype/fee_schedule/fee_schedule_dashboard.py b/erpnext/education/doctype/fee_schedule/fee_schedule_dashboard.py index 4d7da21ea175..34f870578fdd 100644 --- a/erpnext/education/doctype/fee_schedule/fee_schedule_dashboard.py +++ b/erpnext/education/doctype/fee_schedule/fee_schedule_dashboard.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'fee_schedule', diff --git a/erpnext/education/doctype/fee_schedule/test_fee_schedule.py b/erpnext/education/doctype/fee_schedule/test_fee_schedule.py index 44e0756d64d0..86b74de34213 100644 --- a/erpnext/education/doctype/fee_schedule/test_fee_schedule.py +++ b/erpnext/education/doctype/fee_schedule/test_fee_schedule.py @@ -5,5 +5,6 @@ import unittest + class TestFeeSchedule(unittest.TestCase): pass diff --git a/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py b/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py index 11d56973808a..5e9ed61ba827 100644 --- a/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py +++ b/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class FeeScheduleProgram(Document): pass diff --git a/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py b/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py index 776534d6fafa..ba30a91516f9 100644 --- a/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py +++ b/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class FeeScheduleStudentGroup(Document): pass diff --git a/erpnext/education/doctype/fee_structure/fee_structure.py b/erpnext/education/doctype/fee_structure/fee_structure.py index 9755717ee941..a6cc7019215f 100644 --- a/erpnext/education/doctype/fee_structure/fee_structure.py +++ b/erpnext/education/doctype/fee_structure/fee_structure.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/education/doctype/fee_structure/fee_structure_dashboard.py b/erpnext/education/doctype/fee_structure/fee_structure_dashboard.py index fdf7df7aa264..c053b4ea4ba7 100644 --- a/erpnext/education/doctype/fee_structure/fee_structure_dashboard.py +++ b/erpnext/education/doctype/fee_structure/fee_structure_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'fee_structure', diff --git a/erpnext/education/doctype/fee_structure/test_fee_structure.py b/erpnext/education/doctype/fee_structure/test_fee_structure.py index 785ae4e7d37d..762e83da152c 100644 --- a/erpnext/education/doctype/fee_structure/test_fee_structure.py +++ b/erpnext/education/doctype/fee_structure/test_fee_structure.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Fee Structure') class TestFeeStructure(unittest.TestCase): diff --git a/erpnext/education/doctype/fees/fees.py b/erpnext/education/doctype/fees/fees.py index 7e8670490470..4586a00138d4 100644 --- a/erpnext/education/doctype/fees/fees.py +++ b/erpnext/education/doctype/fees/fees.py @@ -3,14 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document -import frappe, erpnext + +import frappe from frappe import _ +from frappe.model.document import Document from frappe.utils import money_in_words -from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request from frappe.utils.csvutils import getlink -from erpnext.controllers.accounts_controller import AccountsController + +import erpnext +from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request from erpnext.accounts.general_ledger import make_reverse_gl_entries +from erpnext.controllers.accounts_controller import AccountsController class Fees(AccountsController): diff --git a/erpnext/education/doctype/fees/test_fees.py b/erpnext/education/doctype/fees/test_fees.py index c6bb704b4127..fbf7a571fe82 100644 --- a/erpnext/education/doctype/fees/test_fees.py +++ b/erpnext/education/doctype/fees/test_fees.py @@ -3,10 +3,12 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import nowdate from frappe.utils.make_random import get_random + from erpnext.education.doctype.program.test_program import make_program_and_linked_courses test_dependencies = ['Company'] diff --git a/erpnext/education/doctype/grading_scale/grading_scale.py b/erpnext/education/doctype/grading_scale/grading_scale.py index 0e7329716192..ed75f31d8417 100644 --- a/erpnext/education/doctype/grading_scale/grading_scale.py +++ b/erpnext/education/doctype/grading_scale/grading_scale.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cint from frappe.model.document import Document +from frappe.utils import cint + class GradingScale(Document): def validate(self): diff --git a/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py b/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py index 2a3f13b156db..268871a04e8e 100644 --- a/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py +++ b/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'grading_scale', diff --git a/erpnext/education/doctype/grading_scale/test_grading_scale.py b/erpnext/education/doctype/grading_scale/test_grading_scale.py index 5364d7c8879e..043d0f1d4308 100644 --- a/erpnext/education/doctype/grading_scale/test_grading_scale.py +++ b/erpnext/education/doctype/grading_scale/test_grading_scale.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Grading Scale') class TestGradingScale(unittest.TestCase): diff --git a/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py index 41ac5ffd5c00..7c6533e1b4ac 100644 --- a/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py +++ b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class GradingScaleInterval(Document): pass diff --git a/erpnext/education/doctype/guardian/guardian.py b/erpnext/education/doctype/guardian/guardian.py index e82cc546af40..f79e1310345d 100644 --- a/erpnext/education/doctype/guardian/guardian.py +++ b/erpnext/education/doctype/guardian/guardian.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils.csvutils import getlink + class Guardian(Document): def __setup__(self): self.onload() diff --git a/erpnext/education/doctype/guardian/test_guardian.py b/erpnext/education/doctype/guardian/test_guardian.py index 61420f6cec51..4dba6a248da0 100644 --- a/erpnext/education/doctype/guardian/test_guardian.py +++ b/erpnext/education/doctype/guardian/test_guardian.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Guardian') class TestGuardian(unittest.TestCase): diff --git a/erpnext/education/doctype/guardian_interest/guardian_interest.py b/erpnext/education/doctype/guardian_interest/guardian_interest.py index f5c4cf1d49c6..5a909c6ed599 100644 --- a/erpnext/education/doctype/guardian_interest/guardian_interest.py +++ b/erpnext/education/doctype/guardian_interest/guardian_interest.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class GuardianInterest(Document): pass diff --git a/erpnext/education/doctype/guardian_student/guardian_student.py b/erpnext/education/doctype/guardian_student/guardian_student.py index bf6f5c137304..758da58cb2ad 100644 --- a/erpnext/education/doctype/guardian_student/guardian_student.py +++ b/erpnext/education/doctype/guardian_student/guardian_student.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class GuardianStudent(Document): pass diff --git a/erpnext/education/doctype/instructor/instructor.py b/erpnext/education/doctype/instructor/instructor.py index b1bfcbb2f104..92fb8b04b909 100644 --- a/erpnext/education/doctype/instructor/instructor.py +++ b/erpnext/education/doctype/instructor/instructor.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.model.naming import set_name_by_naming_series + class Instructor(Document): def autoname(self): naming_method = frappe.db.get_value("Education Settings", None, "instructor_created_by") diff --git a/erpnext/education/doctype/instructor/instructor_dashboard.py b/erpnext/education/doctype/instructor/instructor_dashboard.py index c19c85947d67..bb08a54903c6 100644 --- a/erpnext/education/doctype/instructor/instructor_dashboard.py +++ b/erpnext/education/doctype/instructor/instructor_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/education/doctype/instructor/test_instructor.py b/erpnext/education/doctype/instructor/test_instructor.py index 4061422a74dc..cf5aa1021910 100644 --- a/erpnext/education/doctype/instructor/test_instructor.py +++ b/erpnext/education/doctype/instructor/test_instructor.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Instructor') class TestInstructor(unittest.TestCase): diff --git a/erpnext/education/doctype/instructor_log/instructor_log.py b/erpnext/education/doctype/instructor_log/instructor_log.py index 75217b22f67c..b1198260ddc6 100644 --- a/erpnext/education/doctype/instructor_log/instructor_log.py +++ b/erpnext/education/doctype/instructor_log/instructor_log.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class InstructorLog(Document): pass diff --git a/erpnext/education/doctype/options/options.py b/erpnext/education/doctype/options/options.py index a11d77afb236..98d80659ead6 100644 --- a/erpnext/education/doctype/options/options.py +++ b/erpnext/education/doctype/options/options.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Options(Document): pass diff --git a/erpnext/education/doctype/program/program.py b/erpnext/education/doctype/program/program.py index 9d886b7b9e61..7de34cf30fb4 100644 --- a/erpnext/education/doctype/program/program.py +++ b/erpnext/education/doctype/program/program.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Program(Document): def get_course_list(self): diff --git a/erpnext/education/doctype/program/program_dashboard.py b/erpnext/education/doctype/program/program_dashboard.py index 6c503e1bf1fd..66960767f162 100644 --- a/erpnext/education/doctype/program/program_dashboard.py +++ b/erpnext/education/doctype/program/program_dashboard.py @@ -1,5 +1,6 @@ from frappe import _ + def get_data(): return { 'fieldname': 'program', diff --git a/erpnext/education/doctype/program/test_program.py b/erpnext/education/doctype/program/test_program.py index 204f2961e7fb..3222aa6004b3 100644 --- a/erpnext/education/doctype/program/test_program.py +++ b/erpnext/education/doctype/program/test_program.py @@ -2,13 +2,14 @@ # Copyright (c) 2015, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals -from erpnext.education.doctype.course.test_course import make_course -from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content -from erpnext.education.doctype.course.test_course import make_course_and_linked_topic -import frappe import unittest +import frappe + +from erpnext.education.doctype.course.test_course import make_course, make_course_and_linked_topic +from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content + test_data = { "program_name": "_Test Program", "description": "_Test Program", diff --git a/erpnext/education/doctype/program_course/program_course.py b/erpnext/education/doctype/program_course/program_course.py index 684b6fade768..3bc95c33dad9 100644 --- a/erpnext/education/doctype/program_course/program_course.py +++ b/erpnext/education/doctype/program_course/program_course.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProgramCourse(Document): pass diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index dd4aa576ac00..1a417d4a4a65 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -3,13 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint +from frappe.desk.reportview import get_filters_cond, get_match_cond from frappe.model.document import Document -from frappe.desk.reportview import get_match_cond, get_filters_cond from frappe.utils import comma_and, get_link_to_form, getdate + import erpnext.www.lms as lms + class ProgramEnrollment(Document): def validate(self): self.validate_duplication() diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py b/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py index c47f86668980..f829276dac92 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'program_enrollment', diff --git a/erpnext/education/doctype/program_enrollment/test_program_enrollment.py b/erpnext/education/doctype/program_enrollment/test_program_enrollment.py index 497ee288aacd..a3ebec58ab62 100644 --- a/erpnext/education/doctype/program_enrollment/test_program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/test_program_enrollment.py @@ -3,13 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.education.doctype.student.test_student import create_student -from erpnext.education.doctype.student.test_student import get_student -from erpnext.education.doctype.program.test_program import make_program_and_linked_courses +import frappe + from erpnext.education.doctype.course_activity.test_course_activity import make_course_activity +from erpnext.education.doctype.program.test_program import make_program_and_linked_courses +from erpnext.education.doctype.student.test_student import create_student, get_student + class TestProgramEnrollment(unittest.TestCase): diff --git a/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py index e1f564eff0f8..c1741f60b454 100644 --- a/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py +++ b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProgramEnrollmentCourse(Document): pass diff --git a/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py index 03a311e16403..4b96836503d9 100644 --- a/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py +++ b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProgramEnrollmentFee(Document): pass diff --git a/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py index 5833b67f9bb8..69fa66558d35 100644 --- a/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py +++ b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from erpnext.education.api import enroll_student from frappe.utils import cint +from erpnext.education.api import enroll_student + + class ProgramEnrollmentTool(Document): def onload(self): academic_term_reqd = cint(frappe.db.get_single_value('Education Settings', 'academic_term_reqd')) diff --git a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py index f22b3b1c8d4d..7e0a45fcdd8c 100644 --- a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py +++ b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestProgramEnrollmentTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py index 38dc1c8437ab..921c4054f384 100644 --- a/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py +++ b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProgramEnrollmentToolStudent(Document): pass diff --git a/erpnext/education/doctype/program_fee/program_fee.py b/erpnext/education/doctype/program_fee/program_fee.py index cadcc4eeb80f..c6f0449f52d7 100644 --- a/erpnext/education/doctype/program_fee/program_fee.py +++ b/erpnext/education/doctype/program_fee/program_fee.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProgramFee(Document): pass diff --git a/erpnext/education/doctype/question/question.py b/erpnext/education/doctype/question/question.py index fb3b50478c81..e74aa93ad8e3 100644 --- a/erpnext/education/doctype/question/question.py +++ b/erpnext/education/doctype/question/question.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class Question(Document): def validate(self): diff --git a/erpnext/education/doctype/question/test_question.py b/erpnext/education/doctype/question/test_question.py index 552872e15fba..34c8c12bdbbb 100644 --- a/erpnext/education/doctype/question/test_question.py +++ b/erpnext/education/doctype/question/test_question.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQuestion(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz/quiz.py b/erpnext/education/doctype/quiz/quiz.py index a128e1f34273..6ba8c7c42e8c 100644 --- a/erpnext/education/doctype/quiz/quiz.py +++ b/erpnext/education/doctype/quiz/quiz.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ from frappe.model.document import Document + class Quiz(Document): def validate(self): if self.passing_score > 100: diff --git a/erpnext/education/doctype/quiz/test_quiz.py b/erpnext/education/doctype/quiz/test_quiz.py index 344fd544ee84..234bf4f041fd 100644 --- a/erpnext/education/doctype/quiz/test_quiz.py +++ b/erpnext/education/doctype/quiz/test_quiz.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQuiz(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz_activity/quiz_activity.py b/erpnext/education/doctype/quiz_activity/quiz_activity.py index 24c7175397d5..4245ac04671f 100644 --- a/erpnext/education/doctype/quiz_activity/quiz_activity.py +++ b/erpnext/education/doctype/quiz_activity/quiz_activity.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QuizActivity(Document): pass diff --git a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py index fb0425d8096a..9b815ded07c2 100644 --- a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py +++ b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQuizActivity(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz_question/quiz_question.py b/erpnext/education/doctype/quiz_question/quiz_question.py index 317e75b2cb2a..f228f50e2562 100644 --- a/erpnext/education/doctype/quiz_question/quiz_question.py +++ b/erpnext/education/doctype/quiz_question/quiz_question.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QuizQuestion(Document): pass diff --git a/erpnext/education/doctype/quiz_result/quiz_result.py b/erpnext/education/doctype/quiz_result/quiz_result.py index a4fd9f062f3e..64436bc5d55f 100644 --- a/erpnext/education/doctype/quiz_result/quiz_result.py +++ b/erpnext/education/doctype/quiz_result/quiz_result.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QuizResult(Document): pass diff --git a/erpnext/education/doctype/quiz_result/test_quiz_result.py b/erpnext/education/doctype/quiz_result/test_quiz_result.py index 86ee52d87d3b..e5a2108e7008 100644 --- a/erpnext/education/doctype/quiz_result/test_quiz_result.py +++ b/erpnext/education/doctype/quiz_result/test_quiz_result.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQuizResult(unittest.TestCase): pass diff --git a/erpnext/education/doctype/room/room.py b/erpnext/education/doctype/room/room.py index f26e9c4b45bc..1b28268ff467 100644 --- a/erpnext/education/doctype/room/room.py +++ b/erpnext/education/doctype/room/room.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Room(Document): pass diff --git a/erpnext/education/doctype/room/room_dashboard.py b/erpnext/education/doctype/room/room_dashboard.py index 7bcb97f709fa..6a43b6037f8b 100644 --- a/erpnext/education/doctype/room/room_dashboard.py +++ b/erpnext/education/doctype/room/room_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'room', diff --git a/erpnext/education/doctype/room/test_room.py b/erpnext/education/doctype/room/test_room.py index 33ffd9173e1f..317781c291bf 100644 --- a/erpnext/education/doctype/room/test_room.py +++ b/erpnext/education/doctype/room/test_room.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Room') class TestRoom(unittest.TestCase): diff --git a/erpnext/education/doctype/school_house/school_house.py b/erpnext/education/doctype/school_house/school_house.py index 8751e5c646c2..129c61b3fac1 100644 --- a/erpnext/education/doctype/school_house/school_house.py +++ b/erpnext/education/doctype/school_house/school_house.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SchoolHouse(Document): pass diff --git a/erpnext/education/doctype/school_house/test_school_house.py b/erpnext/education/doctype/school_house/test_school_house.py index 5cf96d5daa23..53153af9a425 100644 --- a/erpnext/education/doctype/school_house/test_school_house.py +++ b/erpnext/education/doctype/school_house/test_school_house.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSchoolHouse(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py index 6be9e7104b25..ae498ba57dbb 100644 --- a/erpnext/education/doctype/student/student.py +++ b/erpnext/education/doctype/student/student.py @@ -3,12 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document -from frappe.utils import getdate,today from frappe import _ from frappe.desk.form.linked_with import get_linked_doctypes +from frappe.model.document import Document +from frappe.utils import getdate, today + from erpnext.education.utils import check_content_completion, check_quiz_completion + + class Student(Document): def validate(self): self.title = " ".join(filter(None, [self.first_name, self.middle_name, self.last_name])) diff --git a/erpnext/education/doctype/student/student_dashboard.py b/erpnext/education/doctype/student/student_dashboard.py index d2614628b107..efff2e64907b 100644 --- a/erpnext/education/doctype/student/student_dashboard.py +++ b/erpnext/education/doctype/student/student_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/education/doctype/student/test_student.py b/erpnext/education/doctype/student/test_student.py index fcb2b5fb9303..a6e4423dd37c 100644 --- a/erpnext/education/doctype/student/test_student.py +++ b/erpnext/education/doctype/student/test_student.py @@ -2,13 +2,15 @@ # Copyright (c) 2015, Frappe Technologies and Contributors # See license.txt from __future__ import unicode_literals -from frappe.test_runner import make_test_records -from erpnext.education.doctype.program.test_program import make_program_and_linked_courses -from erpnext.education.doctype.course.test_course import make_course -import frappe import unittest +import frappe +from frappe.test_runner import make_test_records + +from erpnext.education.doctype.course.test_course import make_course +from erpnext.education.doctype.program.test_program import make_program_and_linked_courses + test_records = frappe.get_test_records('Student') class TestStudent(unittest.TestCase): def setUp(self): diff --git a/erpnext/education/doctype/student_admission/student_admission.py b/erpnext/education/doctype/student_admission/student_admission.py index 0febb96aebbc..67ef67b4aa22 100644 --- a/erpnext/education/doctype/student_admission/student_admission.py +++ b/erpnext/education/doctype/student_admission/student_admission.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import nowdate diff --git a/erpnext/education/doctype/student_admission/test_student_admission.py b/erpnext/education/doctype/student_admission/test_student_admission.py index 748c7ae1b391..918d3689201e 100644 --- a/erpnext/education/doctype/student_admission/test_student_admission.py +++ b/erpnext/education/doctype/student_admission/test_student_admission.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Admission') class TestStudentAdmission(unittest.TestCase): diff --git a/erpnext/education/doctype/student_admission_program/student_admission_program.py b/erpnext/education/doctype/student_admission_program/student_admission_program.py index 406027ca2cb7..2377d2648daf 100644 --- a/erpnext/education/doctype/student_admission_program/student_admission_program.py +++ b/erpnext/education/doctype/student_admission_program/student_admission_program.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class StudentAdmissionProgram(Document): pass diff --git a/erpnext/education/doctype/student_applicant/student_applicant.py b/erpnext/education/doctype/student_applicant/student_applicant.py index 193b6d329778..36a0757531ba 100644 --- a/erpnext/education/doctype/student_applicant/student_applicant.py +++ b/erpnext/education/doctype/student_applicant/student_applicant.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import print_function, unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import getdate, add_years, nowdate, date_diff +from frappe.utils import add_years, date_diff, getdate, nowdate + class StudentApplicant(Document): def autoname(self): diff --git a/erpnext/education/doctype/student_applicant/test_student_applicant.py b/erpnext/education/doctype/student_applicant/test_student_applicant.py index 9734a88b9354..adea988c4e93 100644 --- a/erpnext/education/doctype/student_applicant/test_student_applicant.py +++ b/erpnext/education/doctype/student_applicant/test_student_applicant.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Applicant') class TestStudentApplicant(unittest.TestCase): diff --git a/erpnext/education/doctype/student_attendance/student_attendance.py b/erpnext/education/doctype/student_attendance/student_attendance.py index 2e9e6cf8d655..3826afb04928 100644 --- a/erpnext/education/doctype/student_attendance/student_attendance.py +++ b/erpnext/education/doctype/student_attendance/student_attendance.py @@ -3,14 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import get_link_to_form, getdate, formatdate +from frappe.model.document import Document +from frappe.utils import formatdate, get_link_to_form, getdate + from erpnext import get_default_company from erpnext.education.api import get_student_group_students from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday + class StudentAttendance(Document): def validate(self): self.validate_mandatory() diff --git a/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py b/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py index e405b8aed9d1..489f64d68049 100644 --- a/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py +++ b/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'reports': [ diff --git a/erpnext/education/doctype/student_attendance/test_student_attendance.py b/erpnext/education/doctype/student_attendance/test_student_attendance.py index 9f4153845b5d..b662404a9654 100644 --- a/erpnext/education/doctype/student_attendance/test_student_attendance.py +++ b/erpnext/education/doctype/student_attendance/test_student_attendance.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Attendance') class TestStudentAttendance(unittest.TestCase): diff --git a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py index 972973fbadb4..96767deb6d28 100644 --- a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py +++ b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentAttendanceTool(Document): pass diff --git a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py index ffc42af47493..fdf8b8a92196 100644 --- a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py +++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestStudentAttendanceTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_batch_name/student_batch_name.py b/erpnext/education/doctype/student_batch_name/student_batch_name.py index e6d38ea2545f..f4a9cb69a555 100644 --- a/erpnext/education/doctype/student_batch_name/student_batch_name.py +++ b/erpnext/education/doctype/student_batch_name/student_batch_name.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentBatchName(Document): pass diff --git a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py index 09534f355c91..816c36ac16d3 100644 --- a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py +++ b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Batch Name') class TestStudentBatchName(unittest.TestCase): diff --git a/erpnext/education/doctype/student_category/student_category.py b/erpnext/education/doctype/student_category/student_category.py index bd3a83588986..c5dfe3c352c9 100644 --- a/erpnext/education/doctype/student_category/student_category.py +++ b/erpnext/education/doctype/student_category/student_category.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentCategory(Document): pass diff --git a/erpnext/education/doctype/student_category/student_category_dashboard.py b/erpnext/education/doctype/student_category/student_category_dashboard.py index f31c34bd9416..923862378835 100644 --- a/erpnext/education/doctype/student_category/student_category_dashboard.py +++ b/erpnext/education/doctype/student_category/student_category_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'student_category', diff --git a/erpnext/education/doctype/student_category/test_student_category.py b/erpnext/education/doctype/student_category/test_student_category.py index 756cab87eb88..b34d9376fc07 100644 --- a/erpnext/education/doctype/student_category/test_student_category.py +++ b/erpnext/education/doctype/student_category/test_student_category.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Category') class TestStudentCategory(unittest.TestCase): diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index 3d4572abf700..2347d3173172 100644 --- a/erpnext/education/doctype/student_group/student_group.py +++ b/erpnext/education/doctype/student_group/student_group.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from erpnext.education.utils import validate_duplicate_student +from frappe.model.document import Document from frappe.utils import cint +from erpnext.education.utils import validate_duplicate_student + + class StudentGroup(Document): def validate(self): self.validate_mandatory_fields() diff --git a/erpnext/education/doctype/student_group/student_group_dashboard.py b/erpnext/education/doctype/student_group/student_group_dashboard.py index d37445f7b98d..36329bd8d85c 100644 --- a/erpnext/education/doctype/student_group/student_group_dashboard.py +++ b/erpnext/education/doctype/student_group/student_group_dashboard.py @@ -1,8 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'student_group', diff --git a/erpnext/education/doctype/student_group/test_student_group.py b/erpnext/education/doctype/student_group/test_student_group.py index 8b9b47d9cebc..06022511e5ba 100644 --- a/erpnext/education/doctype/student_group/test_student_group.py +++ b/erpnext/education/doctype/student_group/test_student_group.py @@ -3,10 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + import erpnext.education + def get_random_group(): doc = frappe.get_doc({ "doctype": "Student Group", diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py index 28ff7d618c17..2007f8aa7ccf 100644 --- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py +++ b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + from erpnext.education.doctype.student_group.student_group import get_students + class StudentGroupCreationTool(Document): @frappe.whitelist() def get_courses(self): diff --git a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py index 9ca56588f2ca..a2fd0a368d3f 100644 --- a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py +++ b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestStudentGroupCreationTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py index b3411ea7c55f..000b51685c58 100644 --- a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py +++ b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentGroupCreationToolCourse(Document): pass diff --git a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py index b6cc588b673b..5ec6c52e9499 100644 --- a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py +++ b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentGroupInstructor(Document): pass diff --git a/erpnext/education/doctype/student_group_student/student_group_student.py b/erpnext/education/doctype/student_group_student/student_group_student.py index 1fe4ea1dc352..2737d538a14d 100644 --- a/erpnext/education/doctype/student_group_student/student_group_student.py +++ b/erpnext/education/doctype/student_group_student/student_group_student.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentGroupStudent(Document): pass diff --git a/erpnext/education/doctype/student_guardian/student_guardian.py b/erpnext/education/doctype/student_guardian/student_guardian.py index 04445bcc5943..cef740551b50 100644 --- a/erpnext/education/doctype/student_guardian/student_guardian.py +++ b/erpnext/education/doctype/student_guardian/student_guardian.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentGuardian(Document): pass diff --git a/erpnext/education/doctype/student_language/student_language.py b/erpnext/education/doctype/student_language/student_language.py index be6d5debe4bb..65a6bc5c90f6 100644 --- a/erpnext/education/doctype/student_language/student_language.py +++ b/erpnext/education/doctype/student_language/student_language.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentLanguage(Document): pass diff --git a/erpnext/education/doctype/student_language/test_student_language.py b/erpnext/education/doctype/student_language/test_student_language.py index 592b94a4fc22..8cc25c3a7807 100644 --- a/erpnext/education/doctype/student_language/test_student_language.py +++ b/erpnext/education/doctype/student_language/test_student_language.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Language') class TestStudentLanguage(unittest.TestCase): diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application.py b/erpnext/education/doctype/student_leave_application/student_leave_application.py index ef670124c319..50c14aae22b1 100644 --- a/erpnext/education/doctype/student_leave_application/student_leave_application.py +++ b/erpnext/education/doctype/student_leave_application/student_leave_application.py @@ -3,13 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from datetime import timedelta + import frappe from frappe import _ -from datetime import timedelta -from frappe.utils import get_link_to_form, getdate, date_diff, flt -from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday -from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list from frappe.model.document import Document +from frappe.utils import date_diff, flt, get_link_to_form, getdate + +from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list +from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday + class StudentLeaveApplication(Document): def validate(self): diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py b/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py index 0ff6d1a76ead..2674f5415d96 100644 --- a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py +++ b/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'leave_application', diff --git a/erpnext/education/doctype/student_leave_application/test_student_leave_application.py b/erpnext/education/doctype/student_leave_application/test_student_leave_application.py index 9cae25774819..506dc738d887 100644 --- a/erpnext/education/doctype/student_leave_application/test_student_leave_application.py +++ b/erpnext/education/doctype/student_leave_application/test_student_leave_application.py @@ -3,12 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import getdate, add_days, add_months + +import frappe +from frappe.utils import add_days, add_months, getdate + from erpnext import get_default_company -from erpnext.education.doctype.student_group.test_student_group import get_random_group from erpnext.education.doctype.student.test_student import create_student +from erpnext.education.doctype.student_group.test_student_group import get_random_group + class TestStudentLeaveApplication(unittest.TestCase): def setUp(self): diff --git a/erpnext/education/doctype/student_log/student_log.py b/erpnext/education/doctype/student_log/student_log.py index 8b12886863c6..d90b2866d350 100644 --- a/erpnext/education/doctype/student_log/student_log.py +++ b/erpnext/education/doctype/student_log/student_log.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentLog(Document): pass diff --git a/erpnext/education/doctype/student_log/test_student_log.py b/erpnext/education/doctype/student_log/test_student_log.py index 1fe191fe9558..bb7b8787a505 100644 --- a/erpnext/education/doctype/student_log/test_student_log.py +++ b/erpnext/education/doctype/student_log/test_student_log.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Student Log') class TestStudentLog(unittest.TestCase): diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py index 17bc3678266c..ff9b9052c9fd 100644 --- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py +++ b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ from frappe.model.document import Document -from erpnext.education.api import get_grade from frappe.utils.pdf import get_pdf -from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import get_formatted_result -from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import get_child_assessment_groups + +from erpnext.education.api import get_grade +from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import ( + get_child_assessment_groups, + get_formatted_result, +) class StudentReportGenerationTool(Document): diff --git a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py index 417816642ec0..11832f85a92b 100644 --- a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py +++ b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestStudentReportGenerationTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_sibling/student_sibling.py b/erpnext/education/doctype/student_sibling/student_sibling.py index 4adc3f35baea..bc9ddedaa488 100644 --- a/erpnext/education/doctype/student_sibling/student_sibling.py +++ b/erpnext/education/doctype/student_sibling/student_sibling.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentSibling(Document): pass diff --git a/erpnext/education/doctype/student_siblings/student_siblings.py b/erpnext/education/doctype/student_siblings/student_siblings.py index 4e20d84ae71d..ed731a1555ce 100644 --- a/erpnext/education/doctype/student_siblings/student_siblings.py +++ b/erpnext/education/doctype/student_siblings/student_siblings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StudentSiblings(Document): pass diff --git a/erpnext/education/doctype/topic/test_topic.py b/erpnext/education/doctype/topic/test_topic.py index d03db1cb93a8..b6c6c7516fa1 100644 --- a/erpnext/education/doctype/topic/test_topic.py +++ b/erpnext/education/doctype/topic/test_topic.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTopic(unittest.TestCase): def setUp(self): make_topic_and_linked_content("_Test Topic 1", [{"type":"Article", "name": "_Test Article 1"}]) diff --git a/erpnext/education/doctype/topic/topic.py b/erpnext/education/doctype/topic/topic.py index fb680d725b04..1834b2e060c6 100644 --- a/erpnext/education/doctype/topic/topic.py +++ b/erpnext/education/doctype/topic/topic.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ from frappe.model.document import Document + class Topic(Document): def get_contents(self): try: diff --git a/erpnext/education/doctype/topic_content/test_topic_content.py b/erpnext/education/doctype/topic_content/test_topic_content.py index cf304f60bc3d..2ff50fa66b92 100644 --- a/erpnext/education/doctype/topic_content/test_topic_content.py +++ b/erpnext/education/doctype/topic_content/test_topic_content.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTopicContent(unittest.TestCase): pass diff --git a/erpnext/education/doctype/topic_content/topic_content.py b/erpnext/education/doctype/topic_content/topic_content.py index 9b2c90bb4f2a..984b1ae322f8 100644 --- a/erpnext/education/doctype/topic_content/topic_content.py +++ b/erpnext/education/doctype/topic_content/topic_content.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TopicContent(Document): pass diff --git a/erpnext/education/report/absent_student_report/absent_student_report.py b/erpnext/education/report/absent_student_report/absent_student_report.py index c3487ccaffbe..d5b66757fcd9 100644 --- a/erpnext/education/report/absent_student_report/absent_student_report.py +++ b/erpnext/education/report/absent_student_report/absent_student_report.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe import _, msgprint from frappe.utils import formatdate -from frappe import msgprint, _ + from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/education/report/assessment_plan_status/assessment_plan_status.py b/erpnext/education/report/assessment_plan_status/assessment_plan_status.py index 21184a637ca1..64ceb42731ae 100644 --- a/erpnext/education/report/assessment_plan_status/assessment_plan_status.py +++ b/erpnext/education/report/assessment_plan_status/assessment_plan_status.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from itertools import groupby + import frappe from frappe import _ -from itertools import groupby from frappe.utils import cint DOCSTATUS = { diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py index 1043e5bd45b6..4a43912f6d98 100644 --- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py +++ b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from collections import OrderedDict, defaultdict + import frappe from frappe import _ from frappe.utils import flt -from collections import defaultdict, OrderedDict + from erpnext.education.api import get_grade diff --git a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py b/erpnext/education/report/final_assessment_grades/final_assessment_grades.py index e6e0ba2ebc21..ae7f34b5e1c0 100644 --- a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py +++ b/erpnext/education/report/final_assessment_grades/final_assessment_grades.py @@ -2,12 +2,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from collections import defaultdict + import frappe from frappe import _ -from collections import defaultdict -from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import get_formatted_result -from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import get_chart_data +from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import ( + get_chart_data, + get_formatted_result, +) def execute(filters=None): diff --git a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py b/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py index c0ec0357cc65..1717ed55aecf 100644 --- a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py +++ b/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py index 5bebd4385c6d..a21a93686ef9 100644 --- a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +++ b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py @@ -2,6 +2,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ diff --git a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py index e2576a0c7106..b65350f1b22b 100644 --- a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py +++ b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe import _, msgprint from frappe.utils import formatdate -from frappe import msgprint, _ + from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py index 04dc8c0e5637..7abdc64e8e7e 100644 --- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py +++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py @@ -2,14 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import cstr, cint, getdate, get_first_day, get_last_day, date_diff, add_days -from frappe import msgprint, _ + from calendar import monthrange + +import frappe +from frappe import _, msgprint +from frappe.utils import add_days, cint, cstr, date_diff, get_first_day, get_last_day, getdate + from erpnext.education.api import get_student_group_students from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list from erpnext.support.doctype.issue.issue import get_holidays + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/education/setup.py b/erpnext/education/setup.py index 5c4092849a76..faa4e39b4001 100644 --- a/erpnext/education/setup.py +++ b/erpnext/education/setup.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe + from erpnext.setup.utils import insert_record diff --git a/erpnext/education/utils.py b/erpnext/education/utils.py index 7ce821225375..33394e179639 100644 --- a/erpnext/education/utils.py +++ b/erpnext/education/utils.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors -from __future__ import unicode_literals, division +from __future__ import division, unicode_literals + import frappe from frappe import _ + class OverlapError(frappe.ValidationError): pass def validate_overlap_for(doc, doctype, fieldname, value=None): diff --git a/erpnext/education/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/education/web_form/student_applicant/student_applicant.py +++ b/erpnext/education/web_form/student_applicant/student_applicant.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/erpnext_integrations/connectors/github_connection.py b/erpnext/erpnext_integrations/connectors/github_connection.py index ab7708df305b..1d3fced12010 100644 --- a/erpnext/erpnext_integrations/connectors/github_connection.py +++ b/erpnext/erpnext_integrations/connectors/github_connection.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals + import frappe from frappe.data_migration.doctype.data_migration_connector.connectors.base import BaseConnection from github import Github + class GithubConnection(BaseConnection): def __init__(self, connector): self.connector = connector diff --git a/erpnext/erpnext_integrations/connectors/shopify_connection.py b/erpnext/erpnext_integrations/connectors/shopify_connection.py index 912674ff1a26..ff91b09f18eb 100644 --- a/erpnext/erpnext_integrations/connectors/shopify_connection.py +++ b/erpnext/erpnext_integrations/connectors/shopify_connection.py @@ -1,14 +1,26 @@ from __future__ import unicode_literals + +import json + import frappe from frappe import _ -import json -from frappe.utils import cstr, cint, nowdate, getdate, flt, get_request_session, get_datetime +from frappe.utils import cint, cstr, flt, get_datetime, get_request_session, getdate, nowdate + +from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import ( + dump_request_data, + make_shopify_log, +) +from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import ( + get_header, + get_shopify_url, +) +from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer +from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import ( + sync_item_from_shopify, +) from erpnext.erpnext_integrations.utils import validate_webhooks_request from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice -from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import sync_item_from_shopify -from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer -from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import make_shopify_log, dump_request_data -from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header + @frappe.whitelist(allow_guest=True) @validate_webhooks_request("Shopify Settings", 'X-Shopify-Hmac-Sha256', secret_key='shared_secret') diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py index a505ee09d289..192ec147e362 100644 --- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py +++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py @@ -1,8 +1,15 @@ from __future__ import unicode_literals -import frappe, base64, hashlib, hmac, json -from frappe.utils import cstr + +import base64 +import hashlib +import hmac +import json + +import frappe from frappe import _ +from frappe.utils import cstr + def verify_request(): woocommerce_settings = frappe.get_doc("Woocommerce Settings") diff --git a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py index aeb5352a2203..5a4a57c2e25a 100644 --- a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py +++ b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def pre_process(issue): project = frappe.db.get_value('Project', filters={'project_name': issue.milestone}) diff --git a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py index 9d3f02eaaf68..bab8031e024a 100644 --- a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py +++ b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def pre_process(milestone): return { 'title': milestone.title, diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py index 148c1a6a1662..a757a43b59c1 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py @@ -3,10 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, time, dateutil, math, csv + +import csv +import math +import time + +import dateutil +import frappe +from frappe import _ from six import StringIO + import erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_api as mws -from frappe import _ + #Get and Create Products def get_products_details(): diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py index 7fd3b34fd5da..03c05570bc84 100755 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py @@ -6,24 +6,27 @@ # Extended to include finances object from __future__ import unicode_literals -import urllib -from urllib.parse import quote +import base64 import hashlib import hmac -import base64 +import re +import urllib +from urllib.parse import quote + import six + from erpnext.erpnext_integrations.doctype.amazon_mws_settings import xml_utils -import re + try: from xml.etree.ElementTree import ParseError as XMLError except ImportError: from xml.parsers.expat import ExpatError as XMLError -from time import strftime, gmtime + +from time import gmtime, strftime from requests import request from requests.exceptions import HTTPError - __all__ = [ 'Feeds', 'Inventory', diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py index 9c5984014927..ac59eb7925c9 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe.model.document import Document + import dateutil +import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields +from frappe.model.document import Document + from erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_methods import get_orders + class AmazonMWSSettings(Document): def validate(self): if self.enable_amazon == 1: diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/test_amazon_mws_settings.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/test_amazon_mws_settings.py index 7b40014c5210..844df59576a9 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/test_amazon_mws_settings.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/test_amazon_mws_settings.py @@ -5,5 +5,6 @@ import unittest + class TestAmazonMWSSettings(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py index 52ba0239bb55..88ef64d307c6 100644 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py @@ -8,8 +8,8 @@ """ from __future__ import unicode_literals -import xml.etree.ElementTree as ET import re +import xml.etree.ElementTree as ET class object_dict(dict): diff --git a/erpnext/erpnext_integrations/doctype/exotel_settings/exotel_settings.py b/erpnext/erpnext_integrations/doctype/exotel_settings/exotel_settings.py index bff928c1c960..f1314fc122f1 100644 --- a/erpnext/erpnext_integrations/doctype/exotel_settings/exotel_settings.py +++ b/erpnext/erpnext_integrations/doctype/exotel_settings/exotel_settings.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document -import requests + import frappe +import requests from frappe import _ +from frappe.model.document import Document + class ExotelSettings(Document): def validate(self): diff --git a/erpnext/erpnext_integrations/doctype/gocardless_mandate/gocardless_mandate.py b/erpnext/erpnext_integrations/doctype/gocardless_mandate/gocardless_mandate.py index 9c9df653145b..b416ce8808f4 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_mandate/gocardless_mandate.py +++ b/erpnext/erpnext_integrations/doctype/gocardless_mandate/gocardless_mandate.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class GoCardlessMandate(Document): pass diff --git a/erpnext/erpnext_integrations/doctype/gocardless_mandate/test_gocardless_mandate.py b/erpnext/erpnext_integrations/doctype/gocardless_mandate/test_gocardless_mandate.py index d77a352cdb1f..1b76ee5afc79 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_mandate/test_gocardless_mandate.py +++ b/erpnext/erpnext_integrations/doctype/gocardless_mandate/test_gocardless_mandate.py @@ -5,5 +5,6 @@ import unittest + class TestGoCardlessMandate(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/gocardless_settings/__init__.py b/erpnext/erpnext_integrations/doctype/gocardless_settings/__init__.py index 25784a5620af..d003edb9b0e6 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_settings/__init__.py +++ b/erpnext/erpnext_integrations/doctype/gocardless_settings/__init__.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -import json -import hmac + import hashlib +import hmac +import json + +import frappe + @frappe.whitelist(allow_guest=True) def webhooks(): diff --git a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py index c65e3cefeeb0..6484973106a5 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py +++ b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py @@ -3,13 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document import gocardless_pro from frappe import _ +from frappe.integrations.utils import create_payment_gateway, create_request_log +from frappe.model.document import Document +from frappe.utils import call_hook_method, cint, flt, get_url from six.moves.urllib.parse import urlencode -from frappe.utils import get_url, call_hook_method, flt, cint -from frappe.integrations.utils import create_request_log, create_payment_gateway + class GoCardlessSettings(Document): supported_currencies = ["EUR", "DKK", "GBP", "SEK"] diff --git a/erpnext/erpnext_integrations/doctype/gocardless_settings/test_gocardless_settings.py b/erpnext/erpnext_integrations/doctype/gocardless_settings/test_gocardless_settings.py index e377f3482cbe..b17aef509861 100644 --- a/erpnext/erpnext_integrations/doctype/gocardless_settings/test_gocardless_settings.py +++ b/erpnext/erpnext_integrations/doctype/gocardless_settings/test_gocardless_settings.py @@ -5,5 +5,6 @@ import unittest + class TestGoCardlessSettings(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_connector.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_connector.py index d1adeeee0728..6d46a1c884ae 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_connector.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_connector.py @@ -1,7 +1,9 @@ import base64 +import datetime + import requests from requests.auth import HTTPBasicAuth -import datetime + class MpesaConnector(): def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url="https://sandbox.safaricom.co.ke", diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_custom_fields.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_custom_fields.py index 139e2fb192b1..368139b872f7 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_custom_fields.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_custom_fields.py @@ -1,6 +1,7 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def create_custom_pos_fields(): """Create custom fields corresponding to POS Settings and POS Invoice.""" pos_field = { diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py index de933578613f..4ce85e58a616 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py @@ -4,17 +4,21 @@ from __future__ import unicode_literals -from json import loads, dumps + +from json import dumps, loads import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import call_hook_method, fmt_money -from frappe.integrations.utils import create_request_log, create_payment_gateway -from frappe.utils import get_request_site_address -from erpnext.erpnext_integrations.utils import create_mode_of_payment +from frappe.integrations.utils import create_payment_gateway, create_request_log +from frappe.model.document import Document +from frappe.utils import call_hook_method, fmt_money, get_request_site_address + from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_connector import MpesaConnector -from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_custom_fields import create_custom_pos_fields +from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_custom_fields import ( + create_custom_pos_fields, +) +from erpnext.erpnext_integrations.utils import create_mode_of_payment + class MpesaSettings(Document): supported_currencies = ["KES"] @@ -39,7 +43,9 @@ def request_for_payment(self, **kwargs): for i, amount in enumerate(request_amounts): args.request_amount = amount if frappe.flags.in_test: - from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import get_payment_request_response_payload + from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import ( + get_payment_request_response_payload, + ) response = frappe._dict(get_payment_request_response_payload(amount)) else: response = frappe._dict(generate_stk_push(**args)) @@ -71,7 +77,9 @@ def get_account_balance_info(self): ) if frappe.flags.in_test: - from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import get_test_account_balance_response + from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import ( + get_test_account_balance_response, + ) response = frappe._dict(get_test_account_balance_response()) else: response = frappe._dict(get_account_balance(payload)) diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py index d4cb6b982bbd..de81b8213217 100644 --- a/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py +++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/test_mpesa_settings.py @@ -2,13 +2,20 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + +import unittest from json import dumps + import frappe -import unittest -from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_settings import process_balance_info, verify_transaction + from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice +from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_settings import ( + process_balance_info, + verify_transaction, +) from erpnext.erpnext_integrations.utils import create_mode_of_payment + class TestMpesaSettings(unittest.TestCase): def setUp(self): # create payment gateway in setup diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py index 73f5927df400..d4cf56af6b28 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py @@ -2,12 +2,11 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt +import frappe import plaid import requests -from plaid.errors import APIError, ItemError, InvalidRequestError - -import frappe from frappe import _ +from plaid.errors import APIError, InvalidRequestError, ItemError class PlaidConnector(): diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py index eddcb3401f61..d2748c2faadc 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py @@ -5,15 +5,16 @@ import json import frappe -from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account -from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_connector import PlaidConnector from frappe import _ from frappe.desk.doctype.tag.tag import add_tag from frappe.model.document import Document from frappe.utils import add_months, formatdate, getdate, today - from plaid.errors import ItemError +from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account +from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_connector import PlaidConnector + + class PlaidSettings(Document): @staticmethod @frappe.whitelist() diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py index e2243eabde0d..32b5b8f2657f 100644 --- a/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py +++ b/erpnext/erpnext_integrations/doctype/plaid_settings/test_plaid_settings.py @@ -6,11 +6,16 @@ import unittest import frappe +from frappe.utils.response import json_handler + from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings import ( - add_account_subtype, add_account_type, add_bank_accounts, - new_bank_transaction, get_plaid_configuration) -from frappe.utils.response import json_handler + add_account_subtype, + add_account_type, + add_bank_accounts, + get_plaid_configuration, + new_bank_transaction, +) class TestPlaidSettings(unittest.TestCase): diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py index 866ea662788f..39b9bb232e00 100644 --- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py +++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/quickbooks_migrator.py @@ -3,15 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json +import traceback + import frappe +import requests from frappe import _ from frappe.model.document import Document from requests_oauthlib import OAuth2Session -import json -import requests -import traceback + from erpnext import encode_company_abbr + # QuickBooks requires a redirect URL, User will be redirect to this URL # This will be a GET request # Request parameters will have two parameters `code` and `realmId` @@ -253,8 +257,9 @@ def _create_fiscal_years(self): try: # Assumes that exactly one fiscal year has been created so far # Creates fiscal years till oldest ledger entry date is covered - from frappe.utils.data import add_years, getdate from itertools import chain + + from frappe.utils.data import add_years, getdate smallest_ledger_entry_date = getdate(min(entry["date"] for entry in chain(*self.gl_entries.values()) if entry["date"])) oldest_fiscal_year = frappe.get_all("Fiscal Year", fields=["year_start_date", "year_end_date"], diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py index 6ce7c92ae8eb..d6077ae136f6 100644 --- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py +++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQuickBooksMigrator(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py b/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py index a2b6af99b215..b000c8319473 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py +++ b/erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe.model.document import Document + from erpnext.erpnext_integrations.utils import get_webhook_address + class ShopifyLog(Document): pass diff --git a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py index 5892e1d6c4e4..a1ac2e2726d5 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py +++ b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Shopify Log') class TestShopifyLog(unittest.TestCase): diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py index 381c5e5dec4e..8844148ee716 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py @@ -3,15 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.model.document import Document from frappe.utils import get_request_session from requests.exceptions import HTTPError -from frappe.custom.doctype.custom_field.custom_field import create_custom_fields -from erpnext.erpnext_integrations.utils import get_webhook_address + from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import make_shopify_log +from erpnext.erpnext_integrations.utils import get_webhook_address + class ShopifySettings(Document): def validate(self): diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py index 2af57f4c8915..8b188516c220 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe import _ + def create_customer(shopify_customer, shopify_settings): import frappe.utils.nestedset diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py index 16efb6caee1a..860546340148 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py @@ -1,9 +1,14 @@ from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.utils import cint, cstr, get_request_session + from erpnext import get_default_company -from frappe.utils import cstr, cint, get_request_session -from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header +from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import ( + get_header, + get_shopify_url, +) shopify_variants_attr_list = ["option1", "option2", "option3"] diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/test_shopify_settings.py b/erpnext/erpnext_integrations/doctype/shopify_settings/test_shopify_settings.py index 6bec301b8e75..0e0fa6a7270a 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/test_shopify_settings.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/test_shopify_settings.py @@ -2,14 +2,18 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + +import json +import os +import unittest + import frappe +from frappe.core.doctype.data_import.data_import import import_doc +from frappe.utils import cint, cstr -import unittest, os, json -from frappe.utils import cstr, cint from erpnext.erpnext_integrations.connectors.shopify_connection import create_order -from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import make_item from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer -from frappe.core.doctype.data_import.data_import import import_doc +from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import make_item class ShopifySettings(unittest.TestCase): diff --git a/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py b/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py index 74c13c0f6ccf..dd0a7d61b4a9 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py +++ b/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ShopifyTaxAccount(Document): pass diff --git a/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py b/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py index e127989ce34f..bf43b0638de4 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py +++ b/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ShopifyWebhookDetail(Document): pass diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py index 77dba8beea21..83b521e61693 100644 --- a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py +++ b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py @@ -11,19 +11,20 @@ import zipfile from decimal import Decimal -from bs4 import BeautifulSoup as bs - import frappe -from erpnext import encode_company_abbr -from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts -from erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer import unset_existing_data - +from bs4 import BeautifulSoup as bs from frappe import _ from frappe.custom.doctype.custom_field.custom_field import create_custom_field from frappe.model.document import Document from frappe.model.naming import getseries, revert_series_if_last from frappe.utils.data import format_datetime +from erpnext import encode_company_abbr +from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts +from erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer import ( + unset_existing_data, +) + PRIMARY_ACCOUNT = "Primary" VOUCHER_CHUNK_SIZE = 500 diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py index 9f67e55ca165..4e88549dd59d 100644 --- a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py +++ b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTallyMigration(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.py b/erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.py index 7f5f0f0e7a87..9dd481747ec7 100644 --- a/erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.py +++ b/erpnext/erpnext_integrations/doctype/taxjar_settings/taxjar_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TaxJarSettings(Document): pass diff --git a/erpnext/erpnext_integrations/doctype/taxjar_settings/test_taxjar_settings.py b/erpnext/erpnext_integrations/doctype/taxjar_settings/test_taxjar_settings.py index 7cdfd009561d..c871b05642b7 100644 --- a/erpnext/erpnext_integrations/doctype/taxjar_settings/test_taxjar_settings.py +++ b/erpnext/erpnext_integrations/doctype/taxjar_settings/test_taxjar_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestTaxJarSettings(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/woocommerce_settings/test_woocommerce_settings.py b/erpnext/erpnext_integrations/doctype/woocommerce_settings/test_woocommerce_settings.py index 458a23fae295..3d1845843616 100644 --- a/erpnext/erpnext_integrations/doctype/woocommerce_settings/test_woocommerce_settings.py +++ b/erpnext/erpnext_integrations/doctype/woocommerce_settings/test_woocommerce_settings.py @@ -5,5 +5,6 @@ import unittest + class TestWoocommerceSettings(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py index 45f261007f87..2e15fab0d3f1 100644 --- a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py +++ b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py @@ -3,12 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils.nestedset import get_root_of +from frappe.custom.doctype.custom_field.custom_field import create_custom_field from frappe.model.document import Document +from frappe.utils.nestedset import get_root_of from six.moves.urllib.parse import urlparse -from frappe.custom.doctype.custom_field.custom_field import create_custom_field + class WoocommerceSettings(Document): def validate(self): diff --git a/erpnext/erpnext_integrations/stripe_integration.py b/erpnext/erpnext_integrations/stripe_integration.py index 820c7405328d..f0315eb7eef3 100644 --- a/erpnext/erpnext_integrations/stripe_integration.py +++ b/erpnext/erpnext_integrations/stripe_integration.py @@ -2,9 +2,8 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import stripe - import frappe +import stripe from frappe import _ from frappe.integrations.utils import create_request_log diff --git a/erpnext/erpnext_integrations/taxjar_integration.py b/erpnext/erpnext_integrations/taxjar_integration.py index f960998c3c98..c7237f68f967 100644 --- a/erpnext/erpnext_integrations/taxjar_integration.py +++ b/erpnext/erpnext_integrations/taxjar_integration.py @@ -1,12 +1,12 @@ import traceback -import taxjar - import frappe -from erpnext import get_default_company +import taxjar from frappe import _ from frappe.contacts.doctype.address.address import get_company_address +from erpnext import get_default_company + TAX_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "tax_account_head") SHIP_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "shipping_account_head") TAXJAR_CREATE_TRANSACTIONS = frappe.db.get_single_value("TaxJar Settings", "taxjar_create_transactions") diff --git a/erpnext/erpnext_integrations/utils.py b/erpnext/erpnext_integrations/utils.py index caafc0821e11..bb5c0c2dd102 100644 --- a/erpnext/erpnext_integrations/utils.py +++ b/erpnext/erpnext_integrations/utils.py @@ -1,10 +1,16 @@ from __future__ import unicode_literals + +import base64 +import hashlib +import hmac + import frappe from frappe import _ -import base64, hashlib, hmac from six.moves.urllib.parse import urlparse + from erpnext import get_default_company + def validate_webhooks_request(doctype, hmac_key, secret_key='secret'): def innerfn(fn): settings = frappe.get_doc(doctype) diff --git a/erpnext/exceptions.py b/erpnext/exceptions.py index 04291cd5bd1c..9c6b13f80359 100644 --- a/erpnext/exceptions.py +++ b/erpnext/exceptions.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + # accounts class PartyFrozen(frappe.ValidationError): pass class InvalidAccountCurrency(frappe.ValidationError): pass diff --git a/erpnext/healthcare/dashboard_chart_source/department_wise_patient_appointments/department_wise_patient_appointments.py b/erpnext/healthcare/dashboard_chart_source/department_wise_patient_appointments/department_wise_patient_appointments.py index eca7143e689d..9c71ce86ac4b 100644 --- a/erpnext/healthcare/dashboard_chart_source/department_wise_patient_appointments/department_wise_patient_appointments.py +++ b/erpnext/healthcare/dashboard_chart_source/department_wise_patient_appointments/department_wise_patient_appointments.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils.dashboard import cache_source + @frappe.whitelist() @cache_source def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None, diff --git a/erpnext/healthcare/doctype/antibiotic/antibiotic.py b/erpnext/healthcare/doctype/antibiotic/antibiotic.py index 8236c8ab73a0..6a4b7648b960 100644 --- a/erpnext/healthcare/doctype/antibiotic/antibiotic.py +++ b/erpnext/healthcare/doctype/antibiotic/antibiotic.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Antibiotic(Document): pass diff --git a/erpnext/healthcare/doctype/antibiotic/test_antibiotic.py b/erpnext/healthcare/doctype/antibiotic/test_antibiotic.py index 6ac4f4f9fc00..b6ec79f7ff46 100644 --- a/erpnext/healthcare/doctype/antibiotic/test_antibiotic.py +++ b/erpnext/healthcare/doctype/antibiotic/test_antibiotic.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestAntibiotic(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/appointment_type/appointment_type.py b/erpnext/healthcare/doctype/appointment_type/appointment_type.py index 67a24f31e03a..94d023f2c3d9 100644 --- a/erpnext/healthcare/doctype/appointment_type/appointment_type.py +++ b/erpnext/healthcare/doctype/appointment_type/appointment_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + import frappe +from frappe.model.document import Document + class AppointmentType(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/appointment_type/appointment_type_dashboard.py b/erpnext/healthcare/doctype/appointment_type/appointment_type_dashboard.py index 845e4466c118..b9c6edbb19cc 100644 --- a/erpnext/healthcare/doctype/appointment_type/appointment_type_dashboard.py +++ b/erpnext/healthcare/doctype/appointment_type/appointment_type_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'appointment_type', diff --git a/erpnext/healthcare/doctype/appointment_type_service_item/appointment_type_service_item.py b/erpnext/healthcare/doctype/appointment_type_service_item/appointment_type_service_item.py index b2e0e82bad02..026d5d79fd9e 100644 --- a/erpnext/healthcare/doctype/appointment_type_service_item/appointment_type_service_item.py +++ b/erpnext/healthcare/doctype/appointment_type_service_item/appointment_type_service_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AppointmentTypeServiceItem(Document): pass diff --git a/erpnext/healthcare/doctype/body_part/body_part.py b/erpnext/healthcare/doctype/body_part/body_part.py index 300493a52b65..77e8dd90a07d 100644 --- a/erpnext/healthcare/doctype/body_part/body_part.py +++ b/erpnext/healthcare/doctype/body_part/body_part.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class BodyPart(Document): pass diff --git a/erpnext/healthcare/doctype/body_part/test_body_part.py b/erpnext/healthcare/doctype/body_part/test_body_part.py index cb3a61150efd..a81ba179bfea 100644 --- a/erpnext/healthcare/doctype/body_part/test_body_part.py +++ b/erpnext/healthcare/doctype/body_part/test_body_part.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestBodyPart(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/body_part_link/body_part_link.py b/erpnext/healthcare/doctype/body_part_link/body_part_link.py index 037152976922..07488f011770 100644 --- a/erpnext/healthcare/doctype/body_part_link/body_part_link.py +++ b/erpnext/healthcare/doctype/body_part_link/body_part_link.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class BodyPartLink(Document): pass diff --git a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py index cbf89ee3bde5..ba78fddd8e02 100644 --- a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py +++ b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py @@ -3,15 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, nowdate, nowtime, cstr +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cstr, flt, nowdate, nowtime + from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account from erpnext.healthcare.doctype.lab_test.lab_test import create_sample_doc -from erpnext.stock.stock_ledger import get_previous_sle from erpnext.stock.get_item_details import get_item_details -from frappe.model.mapper import get_mapped_doc +from erpnext.stock.stock_ledger import get_previous_sle + class ClinicalProcedure(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/clinical_procedure/test_clinical_procedure.py b/erpnext/healthcare/doctype/clinical_procedure/test_clinical_procedure.py index 0326e5e9da7d..b5c3744204a9 100644 --- a/erpnext/healthcare/doctype/clinical_procedure/test_clinical_procedure.py +++ b/erpnext/healthcare/doctype/clinical_procedure/test_clinical_procedure.py @@ -4,8 +4,13 @@ from __future__ import unicode_literals import unittest + import frappe -from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_healthcare_docs, create_clinical_procedure_template + +from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import ( + create_clinical_procedure_template, + create_healthcare_docs, +) test_dependencies = ['Item'] diff --git a/erpnext/healthcare/doctype/clinical_procedure_item/clinical_procedure_item.py b/erpnext/healthcare/doctype/clinical_procedure_item/clinical_procedure_item.py index d59e51759720..16c5369cfe52 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_item/clinical_procedure_item.py +++ b/erpnext/healthcare/doctype/clinical_procedure_item/clinical_procedure_item.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class ClinicalProcedureItem(Document): pass diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py index 58194f10a8c3..16e0969ae40c 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py +++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ from frappe.model.document import Document from frappe.model.rename_doc import rename_doc + class ClinicalProcedureTemplate(Document): def validate(self): self.enable_disable_item() diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template_dashboard.py b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template_dashboard.py index 9aab5216e1ea..a69899d3eadc 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template_dashboard.py +++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'procedure_template', diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/test_clinical_procedure_template.py b/erpnext/healthcare/doctype/clinical_procedure_template/test_clinical_procedure_template.py index 62e138b8ed29..f754c76341fe 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/test_clinical_procedure_template.py +++ b/erpnext/healthcare/doctype/clinical_procedure_template/test_clinical_procedure_template.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, earthians and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestClinicalProcedureTemplate(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/codification_table/codification_table.py b/erpnext/healthcare/doctype/codification_table/codification_table.py index ae29c03bbbda..232d92ca9dff 100644 --- a/erpnext/healthcare/doctype/codification_table/codification_table.py +++ b/erpnext/healthcare/doctype/codification_table/codification_table.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class CodificationTable(Document): pass diff --git a/erpnext/healthcare/doctype/complaint/complaint.py b/erpnext/healthcare/doctype/complaint/complaint.py index 717f9dbb4ae0..20e00f6b0293 100644 --- a/erpnext/healthcare/doctype/complaint/complaint.py +++ b/erpnext/healthcare/doctype/complaint/complaint.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Complaint(Document): pass diff --git a/erpnext/healthcare/doctype/complaint/test_complaint.py b/erpnext/healthcare/doctype/complaint/test_complaint.py index 2b9273a96756..d3e10692b033 100644 --- a/erpnext/healthcare/doctype/complaint/test_complaint.py +++ b/erpnext/healthcare/doctype/complaint/test_complaint.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestComplaint(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/descriptive_test_result/descriptive_test_result.py b/erpnext/healthcare/doctype/descriptive_test_result/descriptive_test_result.py index 7ccf6b57aa56..c08604694ab4 100644 --- a/erpnext/healthcare/doctype/descriptive_test_result/descriptive_test_result.py +++ b/erpnext/healthcare/doctype/descriptive_test_result/descriptive_test_result.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DescriptiveTestResult(Document): pass diff --git a/erpnext/healthcare/doctype/descriptive_test_template/descriptive_test_template.py b/erpnext/healthcare/doctype/descriptive_test_template/descriptive_test_template.py index 281f32db7ffd..84184fbcca55 100644 --- a/erpnext/healthcare/doctype/descriptive_test_template/descriptive_test_template.py +++ b/erpnext/healthcare/doctype/descriptive_test_template/descriptive_test_template.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DescriptiveTestTemplate(Document): pass diff --git a/erpnext/healthcare/doctype/diagnosis/diagnosis.py b/erpnext/healthcare/doctype/diagnosis/diagnosis.py index f56e79062a57..05add1b53006 100644 --- a/erpnext/healthcare/doctype/diagnosis/diagnosis.py +++ b/erpnext/healthcare/doctype/diagnosis/diagnosis.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Diagnosis(Document): pass diff --git a/erpnext/healthcare/doctype/dosage_form/dosage_form.py b/erpnext/healthcare/doctype/dosage_form/dosage_form.py index 046af08094cf..6b2d88b61b8f 100644 --- a/erpnext/healthcare/doctype/dosage_form/dosage_form.py +++ b/erpnext/healthcare/doctype/dosage_form/dosage_form.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DosageForm(Document): pass diff --git a/erpnext/healthcare/doctype/dosage_form/test_dosage_form.py b/erpnext/healthcare/doctype/dosage_form/test_dosage_form.py index 81cfcf6f7de3..0161b82ba3b9 100644 --- a/erpnext/healthcare/doctype/dosage_form/test_dosage_form.py +++ b/erpnext/healthcare/doctype/dosage_form/test_dosage_form.py @@ -5,5 +5,6 @@ import unittest + class TestDosageForm(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/dosage_strength/dosage_strength.py b/erpnext/healthcare/doctype/dosage_strength/dosage_strength.py index e36a0160cf30..9e74743a7c6e 100644 --- a/erpnext/healthcare/doctype/dosage_strength/dosage_strength.py +++ b/erpnext/healthcare/doctype/dosage_strength/dosage_strength.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DosageStrength(Document): pass diff --git a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.py b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.py index 68a2dc5d3c35..744bdb03ef56 100755 --- a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.py +++ b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DrugPrescription(Document): def get_quantity(self): quantity = 0 diff --git a/erpnext/healthcare/doctype/exercise/exercise.py b/erpnext/healthcare/doctype/exercise/exercise.py index efd89997fecc..5d2b1f1a96d0 100644 --- a/erpnext/healthcare/doctype/exercise/exercise.py +++ b/erpnext/healthcare/doctype/exercise/exercise.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class Exercise(Document): pass diff --git a/erpnext/healthcare/doctype/exercise_difficulty_level/exercise_difficulty_level.py b/erpnext/healthcare/doctype/exercise_difficulty_level/exercise_difficulty_level.py index 17e97b89609b..bbb297275f93 100644 --- a/erpnext/healthcare/doctype/exercise_difficulty_level/exercise_difficulty_level.py +++ b/erpnext/healthcare/doctype/exercise_difficulty_level/exercise_difficulty_level.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ExerciseDifficultyLevel(Document): pass diff --git a/erpnext/healthcare/doctype/exercise_difficulty_level/test_exercise_difficulty_level.py b/erpnext/healthcare/doctype/exercise_difficulty_level/test_exercise_difficulty_level.py index 80ef3a7de89d..dcaea08aba33 100644 --- a/erpnext/healthcare/doctype/exercise_difficulty_level/test_exercise_difficulty_level.py +++ b/erpnext/healthcare/doctype/exercise_difficulty_level/test_exercise_difficulty_level.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestExerciseDifficultyLevel(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/exercise_type/exercise_type.py b/erpnext/healthcare/doctype/exercise_type/exercise_type.py index ae44a2b77b51..48eb6ba2d81b 100644 --- a/erpnext/healthcare/doctype/exercise_type/exercise_type.py +++ b/erpnext/healthcare/doctype/exercise_type/exercise_type.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ExerciseType(Document): def autoname(self): if self.difficulty_level: diff --git a/erpnext/healthcare/doctype/exercise_type/test_exercise_type.py b/erpnext/healthcare/doctype/exercise_type/test_exercise_type.py index bf217e893a6a..583aea911aef 100644 --- a/erpnext/healthcare/doctype/exercise_type/test_exercise_type.py +++ b/erpnext/healthcare/doctype/exercise_type/test_exercise_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestExerciseType(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/exercise_type_step/exercise_type_step.py b/erpnext/healthcare/doctype/exercise_type_step/exercise_type_step.py index 13d7e5732f66..412ef3225ed1 100644 --- a/erpnext/healthcare/doctype/exercise_type_step/exercise_type_step.py +++ b/erpnext/healthcare/doctype/exercise_type_step/exercise_type_step.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ExerciseTypeStep(Document): pass diff --git a/erpnext/healthcare/doctype/fee_validity/fee_validity.py b/erpnext/healthcare/doctype/fee_validity/fee_validity.py index 59586e0c31b1..aa30becd337e 100644 --- a/erpnext/healthcare/doctype/fee_validity/fee_validity.py +++ b/erpnext/healthcare/doctype/fee_validity/fee_validity.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + +import datetime + import frappe +from frappe.model.document import Document from frappe.utils import getdate -import datetime + class FeeValidity(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py index 957f85211de5..ce1947f5bade 100644 --- a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py +++ b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py @@ -3,11 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, add_days -from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_healthcare_docs, create_appointment, create_healthcare_service_items + +import frappe +from frappe.utils import add_days, nowdate + from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import ( + create_appointment, + create_healthcare_docs, + create_healthcare_service_items, +) test_dependencies = ["Company"] diff --git a/erpnext/healthcare/doctype/fee_validity_reference/fee_validity_reference.py b/erpnext/healthcare/doctype/fee_validity_reference/fee_validity_reference.py index c81928083204..c03978aad117 100644 --- a/erpnext/healthcare/doctype/fee_validity_reference/fee_validity_reference.py +++ b/erpnext/healthcare/doctype/fee_validity_reference/fee_validity_reference.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class FeeValidityReference(Document): pass diff --git a/erpnext/healthcare/doctype/healthcare.py b/erpnext/healthcare/doctype/healthcare.py index 6fd2015fa2e8..f8e008e7d38e 100644 --- a/erpnext/healthcare/doctype/healthcare.py +++ b/erpnext/healthcare/doctype/healthcare.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return [] diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py index 5da5a0657c6f..314700ab1cee 100644 --- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py +++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from erpnext.accounts.party import validate_party_accounts -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address -from frappe.model.naming import append_number_if_name_exists +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.desk.reportview import build_match_conditions, get_filters_cond +from frappe.model.document import Document +from frappe.model.naming import append_number_if_name_exists + +from erpnext.accounts.party import validate_party_accounts + class HealthcarePractitioner(Document): def onload(self): diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py index bcee44430acb..8e0292e97c23 100644 --- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py +++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py index de8201b15171..214bcd287aad 100644 --- a/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py +++ b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py @@ -2,7 +2,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestHealthcarePractitioner(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py index e58ea53c2cd0..721da24adc58 100644 --- a/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py +++ b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class HealthcareScheduleTimeSlot(Document): pass diff --git a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py index 5e76ed7284fd..550b9fbff272 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.py @@ -4,11 +4,12 @@ from __future__ import unicode_literals -from frappe.utils.nestedset import NestedSet -from frappe.utils import cint, cstr +import json + import frappe from frappe import _ -import json +from frappe.utils import cint, cstr +from frappe.utils.nestedset import NestedSet class HealthcareServiceUnit(NestedSet): diff --git a/erpnext/healthcare/doctype/healthcare_service_unit/test_healthcare_service_unit.py b/erpnext/healthcare/doctype/healthcare_service_unit/test_healthcare_service_unit.py index bced2fe1f63b..84197e56c564 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit/test_healthcare_service_unit.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit/test_healthcare_service_unit.py @@ -5,5 +5,6 @@ import unittest + class TestHealthcareServiceUnit(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py index a318e506003c..181cb529fc23 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.model.rename_doc import rename_doc + class HealthcareServiceUnitType(Document): def validate(self): if self.allow_appointments and self.inpatient_occupancy: diff --git a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type_dashboard.py b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type_dashboard.py index 0ac548b3ffdf..7421ec3b89cd 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type_dashboard.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'service_unit_type', diff --git a/erpnext/healthcare/doctype/healthcare_service_unit_type/test_healthcare_service_unit_type.py b/erpnext/healthcare/doctype/healthcare_service_unit_type/test_healthcare_service_unit_type.py index 3ee3377b0041..839e1d6a4db4 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit_type/test_healthcare_service_unit_type.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit_type/test_healthcare_service_unit_type.py @@ -2,9 +2,12 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + import frappe + class TestHealthcareServiceUnitType(unittest.TestCase): def test_item_creation(self): unit_type = get_unit_type() diff --git a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py index a16fceb74dda..9ab888176610 100644 --- a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py +++ b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json + import frappe from frappe import _ -from frappe.model.document import Document from frappe.core.doctype.sms_settings.sms_settings import send_sms -import json +from frappe.model.document import Document + class HealthcareSettings(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py b/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py index 1b620d5f5daf..af2f2b4c4f5d 100644 --- a/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py +++ b/erpnext/healthcare/doctype/healthcare_settings/test_healthcare_settings.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestHealthcareSettings(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py index 3a299eda2623..538062bec843 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py +++ b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import flt, get_link_to_form, getdate, nowtime -from erpnext.stock.utils import get_latest_stock_qty + from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account +from erpnext.stock.utils import get_latest_stock_qty + class InpatientMedicationEntry(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry_dashboard.py b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry_dashboard.py index a4bec45596f5..ca9364d66a1b 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry_dashboard.py +++ b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'against_imoe', diff --git a/erpnext/healthcare/doctype/inpatient_medication_entry/test_inpatient_medication_entry.py b/erpnext/healthcare/doctype/inpatient_medication_entry/test_inpatient_medication_entry.py index 0c463ddc0292..dec3b7e0ead5 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_entry/test_inpatient_medication_entry.py +++ b/erpnext/healthcare/doctype/inpatient_medication_entry/test_inpatient_medication_entry.py @@ -3,14 +3,32 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import add_days, getdate, now_datetime -from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import create_patient, create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy -from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge -from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import create_ipmo, create_ipme -from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_drug_shortage_map, make_difference_stock_entry + from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account +from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import ( + get_drug_shortage_map, + make_difference_stock_entry, +) +from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import ( + create_ipme, + create_ipmo, +) +from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, +) +from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import ( + create_inpatient, + create_patient, + get_healthcare_service_unit, + mark_invoiced_inpatient_occupancy, +) + class TestInpatientMedicationEntry(unittest.TestCase): def setUp(self): diff --git a/erpnext/healthcare/doctype/inpatient_medication_entry_detail/inpatient_medication_entry_detail.py b/erpnext/healthcare/doctype/inpatient_medication_entry_detail/inpatient_medication_entry_detail.py index 644898d9edc3..91734312d4a8 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_entry_detail/inpatient_medication_entry_detail.py +++ b/erpnext/healthcare/doctype/inpatient_medication_entry_detail/inpatient_medication_entry_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class InpatientMedicationEntryDetail(Document): pass diff --git a/erpnext/healthcare/doctype/inpatient_medication_order/inpatient_medication_order.py b/erpnext/healthcare/doctype/inpatient_medication_order/inpatient_medication_order.py index b379e98fe131..2e6d73208f75 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_order/inpatient_medication_order.py +++ b/erpnext/healthcare/doctype/inpatient_medication_order/inpatient_medication_order.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import cstr + from erpnext.healthcare.doctype.patient_encounter.patient_encounter import get_prescription_dates + class InpatientMedicationOrder(Document): def validate(self): self.validate_inpatient() diff --git a/erpnext/healthcare/doctype/inpatient_medication_order/test_inpatient_medication_order.py b/erpnext/healthcare/doctype/inpatient_medication_order/test_inpatient_medication_order.py index ec1a28034e3b..14ea1205f413 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_order/test_inpatient_medication_order.py +++ b/erpnext/healthcare/doctype/inpatient_medication_order/test_inpatient_medication_order.py @@ -3,11 +3,23 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import add_days, getdate, now_datetime -from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import create_patient, create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy -from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge + +from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, +) +from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import ( + create_inpatient, + create_patient, + get_healthcare_service_unit, + mark_invoiced_inpatient_occupancy, +) + class TestInpatientMedicationOrder(unittest.TestCase): def setUp(self): diff --git a/erpnext/healthcare/doctype/inpatient_medication_order_entry/inpatient_medication_order_entry.py b/erpnext/healthcare/doctype/inpatient_medication_order_entry/inpatient_medication_order_entry.py index ebfe366346ea..15800ad15f6f 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_order_entry/inpatient_medication_order_entry.py +++ b/erpnext/healthcare/doctype/inpatient_medication_order_entry/inpatient_medication_order_entry.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class InpatientMedicationOrderEntry(Document): pass diff --git a/erpnext/healthcare/doctype/inpatient_occupancy/inpatient_occupancy.py b/erpnext/healthcare/doctype/inpatient_occupancy/inpatient_occupancy.py index 52de25b45716..c8f3296d0db5 100644 --- a/erpnext/healthcare/doctype/inpatient_occupancy/inpatient_occupancy.py +++ b/erpnext/healthcare/doctype/inpatient_occupancy/inpatient_occupancy.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class InpatientOccupancy(Document): pass diff --git a/erpnext/healthcare/doctype/inpatient_record/inpatient_record.py b/erpnext/healthcare/doctype/inpatient_record/inpatient_record.py index 2cdfa04d5c08..9cede8a2f694 100644 --- a/erpnext/healthcare/doctype/inpatient_record/inpatient_record.py +++ b/erpnext/healthcare/doctype/inpatient_record/inpatient_record.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ -from frappe.utils import today, now_datetime, getdate, get_datetime, get_link_to_form -from frappe.model.document import Document from frappe.desk.reportview import get_match_cond +from frappe.model.document import Document +from frappe.utils import get_datetime, get_link_to_form, getdate, now_datetime, today + class InpatientRecord(Document): def after_insert(self): diff --git a/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py b/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py index 92cc6103f450..0f4adce4edf4 100644 --- a/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py +++ b/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'inpatient_record', diff --git a/erpnext/healthcare/doctype/inpatient_record/test_inpatient_record.py b/erpnext/healthcare/doctype/inpatient_record/test_inpatient_record.py index 9b5cd717a0c9..a778890f4a20 100644 --- a/erpnext/healthcare/doctype/inpatient_record/test_inpatient_record.py +++ b/erpnext/healthcare/doctype/inpatient_record/test_inpatient_record.py @@ -3,14 +3,21 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import now_datetime, today from frappe.utils.make_random import get_random -from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge + +from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, +) from erpnext.healthcare.doctype.lab_test.test_lab_test import create_patient_encounter from erpnext.healthcare.utils import get_encounters_to_invoice + class TestInpatientRecord(unittest.TestCase): def test_admit_and_discharge(self): frappe.db.sql("""delete from `tabInpatient Record`""") diff --git a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.py b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.py index b788a0db7e7e..a3f9aa24c489 100644 --- a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.py +++ b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class LabPrescription(Document): pass diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py index 03e16f557555..f9c47a9ef1e1 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/lab_test.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import getdate, cstr, get_link_to_form +from frappe.utils import cstr, get_link_to_form, getdate + class LabTest(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/lab_test/test_lab_test.py b/erpnext/healthcare/doctype/lab_test/test_lab_test.py index c9f0029ed80e..da10bd86bdfc 100644 --- a/erpnext/healthcare/doctype/lab_test/test_lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/test_lab_test.py @@ -2,13 +2,22 @@ # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals + import unittest + import frappe from frappe.utils import getdate, nowtime -from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient + +from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import ( + get_income_account, + get_receivable_account, +) from erpnext.healthcare.doctype.lab_test.lab_test import create_multiple -from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account -from erpnext.healthcare.doctype.patient_medical_record.test_patient_medical_record import create_lab_test_template as create_blood_test_template +from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient +from erpnext.healthcare.doctype.patient_medical_record.test_patient_medical_record import ( + create_lab_test_template as create_blood_test_template, +) + class TestLabTest(unittest.TestCase): def test_lab_test_item(self): diff --git a/erpnext/healthcare/doctype/lab_test_group_template/lab_test_group_template.py b/erpnext/healthcare/doctype/lab_test_group_template/lab_test_group_template.py index 1e2cef4e18b4..2e3c4093c7c8 100644 --- a/erpnext/healthcare/doctype/lab_test_group_template/lab_test_group_template.py +++ b/erpnext/healthcare/doctype/lab_test_group_template/lab_test_group_template.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class LabTestGroupTemplate(Document): pass diff --git a/erpnext/healthcare/doctype/lab_test_sample/lab_test_sample.py b/erpnext/healthcare/doctype/lab_test_sample/lab_test_sample.py index 4c66b7276b68..3a765fe2436b 100644 --- a/erpnext/healthcare/doctype/lab_test_sample/lab_test_sample.py +++ b/erpnext/healthcare/doctype/lab_test_sample/lab_test_sample.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class LabTestSample(Document): pass diff --git a/erpnext/healthcare/doctype/lab_test_sample/test_lab_test_sample.py b/erpnext/healthcare/doctype/lab_test_sample/test_lab_test_sample.py index 2bc56bd3241e..8896572d783f 100644 --- a/erpnext/healthcare/doctype/lab_test_sample/test_lab_test_sample.py +++ b/erpnext/healthcare/doctype/lab_test_sample/test_lab_test_sample.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestLabTestSample(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py index 543dee27ebc7..c052693d044c 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py @@ -3,10 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe +from frappe import _ from frappe.model.document import Document from frappe.model.rename_doc import rename_doc -from frappe import _ + class LabTestTemplate(Document): def after_insert(self): diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template_dashboard.py b/erpnext/healthcare/doctype/lab_test_template/lab_test_template_dashboard.py index 94dfeea7a42e..a4f9d4b714ee 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template_dashboard.py +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'template', diff --git a/erpnext/healthcare/doctype/lab_test_template/test_lab_test_template.py b/erpnext/healthcare/doctype/lab_test_template/test_lab_test_template.py index 4c9f55a839e7..8d8ac6475005 100644 --- a/erpnext/healthcare/doctype/lab_test_template/test_lab_test_template.py +++ b/erpnext/healthcare/doctype/lab_test_template/test_lab_test_template.py @@ -2,6 +2,7 @@ # Copyright (c) 2015, ESS and Contributors # See license.txt from __future__ import unicode_literals + import unittest # test_records = frappe.get_test_records('Lab Test Template') diff --git a/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.py b/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.py index 7ce8d2d1c811..ce11c0ffce36 100644 --- a/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.py +++ b/erpnext/healthcare/doctype/lab_test_uom/lab_test_uom.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class LabTestUOM(Document): pass diff --git a/erpnext/healthcare/doctype/lab_test_uom/test_lab_test_uom.py b/erpnext/healthcare/doctype/lab_test_uom/test_lab_test_uom.py index 0b3f516497d9..9fe2de51a6d7 100644 --- a/erpnext/healthcare/doctype/lab_test_uom/test_lab_test_uom.py +++ b/erpnext/healthcare/doctype/lab_test_uom/test_lab_test_uom.py @@ -2,6 +2,7 @@ # Copyright (c) 2015, ESS and Contributors # See license.txt from __future__ import unicode_literals + import unittest # test_records = frappe.get_test_records('Lab Test UOM') diff --git a/erpnext/healthcare/doctype/medical_code/medical_code.py b/erpnext/healthcare/doctype/medical_code/medical_code.py index 0deaac38ca3f..4ed3d31e9076 100644 --- a/erpnext/healthcare/doctype/medical_code/medical_code.py +++ b/erpnext/healthcare/doctype/medical_code/medical_code.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class MedicalCode(Document): def autoname(self): self.name = self.medical_code_standard+" "+self.code diff --git a/erpnext/healthcare/doctype/medical_code/test_medical_code.py b/erpnext/healthcare/doctype/medical_code/test_medical_code.py index b1e04027907c..7584b050a652 100644 --- a/erpnext/healthcare/doctype/medical_code/test_medical_code.py +++ b/erpnext/healthcare/doctype/medical_code/test_medical_code.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestMedicalCode(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/medical_code_standard/medical_code_standard.py b/erpnext/healthcare/doctype/medical_code_standard/medical_code_standard.py index 7b2731c1def2..be0ea8922ed7 100644 --- a/erpnext/healthcare/doctype/medical_code_standard/medical_code_standard.py +++ b/erpnext/healthcare/doctype/medical_code_standard/medical_code_standard.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class MedicalCodeStandard(Document): pass diff --git a/erpnext/healthcare/doctype/medical_code_standard/test_medical_code_standard.py b/erpnext/healthcare/doctype/medical_code_standard/test_medical_code_standard.py index fde095d8098f..3b046e360f39 100644 --- a/erpnext/healthcare/doctype/medical_code_standard/test_medical_code_standard.py +++ b/erpnext/healthcare/doctype/medical_code_standard/test_medical_code_standard.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestMedicalCodeStandard(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/medical_department/medical_department.py b/erpnext/healthcare/doctype/medical_department/medical_department.py index 0f2d4fc5f91a..7be5a1ade343 100644 --- a/erpnext/healthcare/doctype/medical_department/medical_department.py +++ b/erpnext/healthcare/doctype/medical_department/medical_department.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class MedicalDepartment(Document): pass diff --git a/erpnext/healthcare/doctype/medical_department/test_medical_department.py b/erpnext/healthcare/doctype/medical_department/test_medical_department.py index 543750a7e7d5..6435a23e9284 100644 --- a/erpnext/healthcare/doctype/medical_department/test_medical_department.py +++ b/erpnext/healthcare/doctype/medical_department/test_medical_department.py @@ -2,6 +2,7 @@ # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals + import unittest # test_records = frappe.get_test_records('Medical Department') diff --git a/erpnext/healthcare/doctype/normal_test_result/normal_test_result.py b/erpnext/healthcare/doctype/normal_test_result/normal_test_result.py index 63abf0297e78..e72f7269fc36 100644 --- a/erpnext/healthcare/doctype/normal_test_result/normal_test_result.py +++ b/erpnext/healthcare/doctype/normal_test_result/normal_test_result.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class NormalTestResult(Document): pass diff --git a/erpnext/healthcare/doctype/normal_test_template/normal_test_template.py b/erpnext/healthcare/doctype/normal_test_template/normal_test_template.py index bc2c99148467..9df48559cde6 100644 --- a/erpnext/healthcare/doctype/normal_test_template/normal_test_template.py +++ b/erpnext/healthcare/doctype/normal_test_template/normal_test_template.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class NormalTestTemplate(Document): pass diff --git a/erpnext/healthcare/doctype/organism/organism.py b/erpnext/healthcare/doctype/organism/organism.py index 1ead762c2fea..dfb9c0dd0d48 100644 --- a/erpnext/healthcare/doctype/organism/organism.py +++ b/erpnext/healthcare/doctype/organism/organism.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Organism(Document): pass diff --git a/erpnext/healthcare/doctype/organism/test_organism.py b/erpnext/healthcare/doctype/organism/test_organism.py index ecb96650e117..9d7ea0ba33dc 100644 --- a/erpnext/healthcare/doctype/organism/test_organism.py +++ b/erpnext/healthcare/doctype/organism/test_organism.py @@ -2,7 +2,9 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestOrganism(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/organism_test_item/organism_test_item.py b/erpnext/healthcare/doctype/organism_test_item/organism_test_item.py index 019a55b396ca..6bb8e8f4c079 100644 --- a/erpnext/healthcare/doctype/organism_test_item/organism_test_item.py +++ b/erpnext/healthcare/doctype/organism_test_item/organism_test_item.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class OrganismTestItem(Document): pass diff --git a/erpnext/healthcare/doctype/organism_test_result/organism_test_result.py b/erpnext/healthcare/doctype/organism_test_result/organism_test_result.py index 02393c270046..3428403e3c0c 100644 --- a/erpnext/healthcare/doctype/organism_test_result/organism_test_result.py +++ b/erpnext/healthcare/doctype/organism_test_result/organism_test_result.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class OrganismTestResult(Document): pass diff --git a/erpnext/healthcare/doctype/patient/patient.py b/erpnext/healthcare/doctype/patient/patient.py index 95cce73f231a..961a8be3691f 100644 --- a/erpnext/healthcare/doctype/patient/patient.py +++ b/erpnext/healthcare/doctype/patient/patient.py @@ -3,18 +3,25 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import dateutil import frappe from frappe import _ -from frappe.model.document import Document -from frappe.utils import cint, cstr, getdate -import dateutil from frappe.contacts.address_and_contact import load_address_and_contact from frappe.contacts.doctype.contact.contact import get_default_contact +from frappe.model.document import Document from frappe.model.naming import set_name_by_naming_series +from frappe.utils import cint, cstr, getdate from frappe.utils.nestedset import get_root_of + from erpnext import get_default_currency -from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account, send_registration_sms from erpnext.accounts.party import get_dashboard_info +from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import ( + get_income_account, + get_receivable_account, + send_registration_sms, +) + class Patient(Document): def onload(self): diff --git a/erpnext/healthcare/doctype/patient/patient_dashboard.py b/erpnext/healthcare/doctype/patient/patient_dashboard.py index 7f7cfa8e5b97..a388b74f61a9 100644 --- a/erpnext/healthcare/doctype/patient/patient_dashboard.py +++ b/erpnext/healthcare/doctype/patient/patient_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/healthcare/doctype/patient/test_patient.py b/erpnext/healthcare/doctype/patient/test_patient.py index 9274b6f5e85c..4b8c7326468a 100644 --- a/erpnext/healthcare/doctype/patient/test_patient.py +++ b/erpnext/healthcare/doctype/patient/test_patient.py @@ -4,9 +4,12 @@ from __future__ import unicode_literals import unittest + import frappe + from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient + class TestPatient(unittest.TestCase): def test_customer_created(self): frappe.db.sql("""delete from `tabPatient`""") diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py index f0d5af934166..dcbcda09d815 100755 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py @@ -3,17 +3,28 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe.model.document import Document + +import datetime import json -from frappe.utils import getdate, get_time, flt, get_link_to_form -from frappe.model.mapper import get_mapped_doc + +import frappe from frappe import _ -import datetime from frappe.core.doctype.sms_settings.sms_settings import send_sms +from frappe.model.document import Document +from frappe.model.mapper import get_mapped_doc +from frappe.utils import flt, get_link_to_form, get_time, getdate + +from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import ( + get_income_account, + get_receivable_account, +) +from erpnext.healthcare.utils import ( + check_fee_validity, + get_service_item_and_practitioner_charge, + manage_fee_validity, +) from erpnext.hr.doctype.employee.employee import is_holiday -from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account -from erpnext.healthcare.utils import check_fee_validity, get_service_item_and_practitioner_charge, manage_fee_validity + class MaximumCapacityError(frappe.ValidationError): pass @@ -100,7 +111,9 @@ def validate_overlaps(self): def validate_service_unit(self): if self.inpatient_record and self.service_unit: - from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_current_healthcare_service_unit + from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import ( + get_current_healthcare_service_unit, + ) is_inpatient_occupancy_unit = frappe.db.get_value('Healthcare Service Unit', self.service_unit, 'inpatient_occupancy') diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py index 085c4f6cbf83..43c63c96e6d3 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'appointment', diff --git a/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py index d0db3226326e..15fe764e1963 100644 --- a/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py @@ -2,12 +2,20 @@ # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals + import unittest + import frappe -from erpnext.healthcare.doctype.patient_appointment.patient_appointment import update_status, make_encounter, check_payment_fields_reqd, check_is_new_patient -from frappe.utils import nowdate, add_days, now_datetime +from frappe.utils import add_days, now_datetime, nowdate from frappe.utils.make_random import get_random + from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.healthcare.doctype.patient_appointment.patient_appointment import ( + check_is_new_patient, + check_payment_fields_reqd, + make_encounter, + update_status, +) class TestPatientAppointment(unittest.TestCase): @@ -131,9 +139,16 @@ def test_appointment_cancel(self): self.assertEqual(frappe.db.get_value('Sales Invoice', sales_invoice_name, 'status'), 'Cancelled') def test_appointment_booking_for_admission_service_unit(self): - from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge - from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import \ - create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy + from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, + ) + from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import ( + create_inpatient, + get_healthcare_service_unit, + mark_invoiced_inpatient_occupancy, + ) frappe.db.sql("""delete from `tabInpatient Record`""") patient, practitioner = create_healthcare_docs() @@ -157,9 +172,16 @@ def test_appointment_booking_for_admission_service_unit(self): discharge_patient(ip_record1, now_datetime()) def test_invalid_healthcare_service_unit_validation(self): - from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge - from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import \ - create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy + from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, + ) + from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import ( + create_inpatient, + get_healthcare_service_unit, + mark_invoiced_inpatient_occupancy, + ) frappe.db.sql("""delete from `tabInpatient Record`""") patient, practitioner = create_healthcare_docs() @@ -238,7 +260,10 @@ def test_overlap_appointment(self): self.assertRaises(OverlapError, appointment.save) def test_service_unit_capacity(self): - from erpnext.healthcare.doctype.patient_appointment.patient_appointment import MaximumCapacityError, OverlapError + from erpnext.healthcare.doctype.patient_appointment.patient_appointment import ( + MaximumCapacityError, + OverlapError, + ) practitioner = create_practitioner() capacity = 3 overlap_service_unit_type = create_service_unit_type(id=10, allow_appointments=1, overlap_appointments=1) diff --git a/erpnext/healthcare/doctype/patient_assessment/patient_assessment.py b/erpnext/healthcare/doctype/patient_assessment/patient_assessment.py index 7bad20dffdcb..90cb30035d4d 100644 --- a/erpnext/healthcare/doctype/patient_assessment/patient_assessment.py +++ b/erpnext/healthcare/doctype/patient_assessment/patient_assessment.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc + class PatientAssessment(Document): def validate(self): self.set_total_score() diff --git a/erpnext/healthcare/doctype/patient_assessment/test_patient_assessment.py b/erpnext/healthcare/doctype/patient_assessment/test_patient_assessment.py index 3fda8550f6c2..0ffbd1f50499 100644 --- a/erpnext/healthcare/doctype/patient_assessment/test_patient_assessment.py +++ b/erpnext/healthcare/doctype/patient_assessment/test_patient_assessment.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestPatientAssessment(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_detail/patient_assessment_detail.py b/erpnext/healthcare/doctype/patient_assessment_detail/patient_assessment_detail.py index 0519599ac0c7..4da679b8892c 100644 --- a/erpnext/healthcare/doctype/patient_assessment_detail/patient_assessment_detail.py +++ b/erpnext/healthcare/doctype/patient_assessment_detail/patient_assessment_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientAssessmentDetail(Document): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_parameter/patient_assessment_parameter.py b/erpnext/healthcare/doctype/patient_assessment_parameter/patient_assessment_parameter.py index b8e00747171c..783c53784813 100644 --- a/erpnext/healthcare/doctype/patient_assessment_parameter/patient_assessment_parameter.py +++ b/erpnext/healthcare/doctype/patient_assessment_parameter/patient_assessment_parameter.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientAssessmentParameter(Document): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_parameter/test_patient_assessment_parameter.py b/erpnext/healthcare/doctype/patient_assessment_parameter/test_patient_assessment_parameter.py index e722f9905ec7..f06fffb1ef43 100644 --- a/erpnext/healthcare/doctype/patient_assessment_parameter/test_patient_assessment_parameter.py +++ b/erpnext/healthcare/doctype/patient_assessment_parameter/test_patient_assessment_parameter.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestPatientAssessmentParameter(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_sheet/patient_assessment_sheet.py b/erpnext/healthcare/doctype/patient_assessment_sheet/patient_assessment_sheet.py index 40da76301329..4686e9e2617e 100644 --- a/erpnext/healthcare/doctype/patient_assessment_sheet/patient_assessment_sheet.py +++ b/erpnext/healthcare/doctype/patient_assessment_sheet/patient_assessment_sheet.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientAssessmentSheet(Document): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_template/patient_assessment_template.py b/erpnext/healthcare/doctype/patient_assessment_template/patient_assessment_template.py index 083cab5d017a..e0d8fca37f74 100644 --- a/erpnext/healthcare/doctype/patient_assessment_template/patient_assessment_template.py +++ b/erpnext/healthcare/doctype/patient_assessment_template/patient_assessment_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientAssessmentTemplate(Document): pass diff --git a/erpnext/healthcare/doctype/patient_assessment_template/test_patient_assessment_template.py b/erpnext/healthcare/doctype/patient_assessment_template/test_patient_assessment_template.py index 86dbd5438cd3..7d639cb6af44 100644 --- a/erpnext/healthcare/doctype/patient_assessment_template/test_patient_assessment_template.py +++ b/erpnext/healthcare/doctype/patient_assessment_template/test_patient_assessment_template.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestPatientAssessmentTemplate(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py index c935274070f3..d32611b96500 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py @@ -3,11 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cstr, getdate, add_days from frappe.model.mapper import get_mapped_doc +from frappe.utils import add_days, cstr, getdate class PatientEncounter(Document): diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py index 39e54f5b35c5..3b64d988715c 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'encounter', diff --git a/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py index 96976821a716..fa643a31d8e3 100644 --- a/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py +++ b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py @@ -2,9 +2,11 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest import frappe + from erpnext.healthcare.doctype.patient_encounter.patient_encounter import PatientEncounter diff --git a/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py index 34b0cf8a5805..e4d2069a50e6 100644 --- a/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py +++ b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientEncounterDiagnosis(Document): pass diff --git a/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py index bdb7bb218eb3..47f2a2be7e97 100644 --- a/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py +++ b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientEncounterSymptom(Document): pass diff --git a/erpnext/healthcare/doctype/patient_history_custom_document_type/patient_history_custom_document_type.py b/erpnext/healthcare/doctype/patient_history_custom_document_type/patient_history_custom_document_type.py index f0a1f929f452..34e15dc46a23 100644 --- a/erpnext/healthcare/doctype/patient_history_custom_document_type/patient_history_custom_document_type.py +++ b/erpnext/healthcare/doctype/patient_history_custom_document_type/patient_history_custom_document_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientHistoryCustomDocumentType(Document): pass diff --git a/erpnext/healthcare/doctype/patient_history_settings/patient_history_settings.py b/erpnext/healthcare/doctype/patient_history_settings/patient_history_settings.py index 9e0d3c3e2786..b763591d3ac6 100644 --- a/erpnext/healthcare/doctype/patient_history_settings/patient_history_settings.py +++ b/erpnext/healthcare/doctype/patient_history_settings/patient_history_settings.py @@ -3,13 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ -from frappe.utils import cstr, cint from frappe.model.document import Document +from frappe.utils import cint, cstr + from erpnext.healthcare.page.patient_history.patient_history import get_patient_history_doctypes + class PatientHistorySettings(Document): def validate(self): self.validate_submittable_doctypes() diff --git a/erpnext/healthcare/doctype/patient_history_settings/test_patient_history_settings.py b/erpnext/healthcare/doctype/patient_history_settings/test_patient_history_settings.py index 9169ea642b96..c37a2adc368e 100644 --- a/erpnext/healthcare/doctype/patient_history_settings/test_patient_history_settings.py +++ b/erpnext/healthcare/doctype/patient_history_settings/test_patient_history_settings.py @@ -3,12 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe -import unittest import json +import unittest + +import frappe from frappe.utils import getdate, strip_html + from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient + class TestPatientHistorySettings(unittest.TestCase): def setUp(self): dt = create_custom_doctype() diff --git a/erpnext/healthcare/doctype/patient_history_standard_document_type/patient_history_standard_document_type.py b/erpnext/healthcare/doctype/patient_history_standard_document_type/patient_history_standard_document_type.py index 2d94911855a6..b7dd09bc10c8 100644 --- a/erpnext/healthcare/doctype/patient_history_standard_document_type/patient_history_standard_document_type.py +++ b/erpnext/healthcare/doctype/patient_history_standard_document_type/patient_history_standard_document_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PatientHistoryStandardDocumentType(Document): pass diff --git a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.py b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.py index 35e42bd6bd51..ac2cffa3e89d 100644 --- a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.py +++ b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PatientMedicalRecord(Document): def after_insert(self): if self.reference_doctype == "Patient Medical Record" : diff --git a/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py b/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py index 5b7d8d62c835..099146c7ee77 100644 --- a/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py +++ b/erpnext/healthcare/doctype/patient_medical_record/test_patient_medical_record.py @@ -2,11 +2,20 @@ # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals + import unittest + import frappe from frappe.utils import nowdate -from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_encounter, create_healthcare_docs, create_appointment, create_medical_department + from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile +from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import ( + create_appointment, + create_encounter, + create_healthcare_docs, + create_medical_department, +) + class TestPatientMedicalRecord(unittest.TestCase): def setUp(self): diff --git a/erpnext/healthcare/doctype/patient_relation/patient_relation.py b/erpnext/healthcare/doctype/patient_relation/patient_relation.py index 150b96200d08..17bc20940d6b 100644 --- a/erpnext/healthcare/doctype/patient_relation/patient_relation.py +++ b/erpnext/healthcare/doctype/patient_relation/patient_relation.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class PatientRelation(Document): pass diff --git a/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py index 8bd0937948b5..7fa31e5fb67e 100644 --- a/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py +++ b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class PractitionerSchedule(Document): def autoname(self): self.name = self.schedule_name diff --git a/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py index 52638cb618e5..1ecaa47248ac 100644 --- a/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py +++ b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py @@ -2,7 +2,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestPractitionerSchedule(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py index c18a4406cabb..4eba1fbf6b41 100644 --- a/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py +++ b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class PractitionerServiceUnitSchedule(Document): pass diff --git a/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.py b/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.py index dea263dca09e..19f9b70bb61d 100644 --- a/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.py +++ b/erpnext/healthcare/doctype/prescription_dosage/prescription_dosage.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class PrescriptionDosage(Document): pass diff --git a/erpnext/healthcare/doctype/prescription_dosage/test_prescription_dosage.py b/erpnext/healthcare/doctype/prescription_dosage/test_prescription_dosage.py index e61a41889664..cabfd35e23d2 100644 --- a/erpnext/healthcare/doctype/prescription_dosage/test_prescription_dosage.py +++ b/erpnext/healthcare/doctype/prescription_dosage/test_prescription_dosage.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestPrescriptionDosage(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py b/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py index 96ddf8dafe89..988276da7481 100644 --- a/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py +++ b/erpnext/healthcare/doctype/prescription_duration/prescription_duration.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document from frappe.utils import cstr + class PrescriptionDuration(Document): def autoname(self): self.name = " ".join(filter(None, diff --git a/erpnext/healthcare/doctype/prescription_duration/test_prescription_duration.py b/erpnext/healthcare/doctype/prescription_duration/test_prescription_duration.py index fe5524c5aa7b..197bb3e7fb97 100644 --- a/erpnext/healthcare/doctype/prescription_duration/test_prescription_duration.py +++ b/erpnext/healthcare/doctype/prescription_duration/test_prescription_duration.py @@ -2,7 +2,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestPrescriptionDuration(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.py b/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.py index 62ea9f1a4003..f4d29fa6a309 100644 --- a/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.py +++ b/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class ProcedurePrescription(Document): pass diff --git a/erpnext/healthcare/doctype/sample_collection/sample_collection.py b/erpnext/healthcare/doctype/sample_collection/sample_collection.py index 461f8095076e..7de6ac08ca1d 100644 --- a/erpnext/healthcare/doctype/sample_collection/sample_collection.py +++ b/erpnext/healthcare/doctype/sample_collection/sample_collection.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from frappe import _ from frappe.model.document import Document from frappe.utils import flt -from frappe import _ + class SampleCollection(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/sensitivity/sensitivity.py b/erpnext/healthcare/doctype/sensitivity/sensitivity.py index bf7c36b9d28e..f61781d3f868 100644 --- a/erpnext/healthcare/doctype/sensitivity/sensitivity.py +++ b/erpnext/healthcare/doctype/sensitivity/sensitivity.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Sensitivity(Document): pass diff --git a/erpnext/healthcare/doctype/sensitivity/test_sensitivity.py b/erpnext/healthcare/doctype/sensitivity/test_sensitivity.py index 1616d2decbb0..c772c72faf0d 100644 --- a/erpnext/healthcare/doctype/sensitivity/test_sensitivity.py +++ b/erpnext/healthcare/doctype/sensitivity/test_sensitivity.py @@ -2,6 +2,7 @@ # Copyright (c) 2015, ESS and Contributors # See license.txt from __future__ import unicode_literals + import unittest # test_records = frappe.get_test_records('Sensitivity') diff --git a/erpnext/healthcare/doctype/sensitivity_test_result/sensitivity_test_result.py b/erpnext/healthcare/doctype/sensitivity_test_result/sensitivity_test_result.py index 64f1e6ca2557..53f7acc4af0e 100644 --- a/erpnext/healthcare/doctype/sensitivity_test_result/sensitivity_test_result.py +++ b/erpnext/healthcare/doctype/sensitivity_test_result/sensitivity_test_result.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SensitivityTestResult(Document): pass diff --git a/erpnext/healthcare/doctype/therapy_plan/test_therapy_plan.py b/erpnext/healthcare/doctype/therapy_plan/test_therapy_plan.py index 54e00ea48eea..4f96f6a7066b 100644 --- a/erpnext/healthcare/doctype/therapy_plan/test_therapy_plan.py +++ b/erpnext/healthcare/doctype/therapy_plan/test_therapy_plan.py @@ -3,13 +3,23 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import getdate, flt, nowdate + +import frappe +from frappe.utils import flt, getdate, nowdate + +from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import ( + create_appointment, + create_healthcare_docs, + create_medical_department, + create_patient, +) +from erpnext.healthcare.doctype.therapy_plan.therapy_plan import ( + make_sales_invoice, + make_therapy_session, +) from erpnext.healthcare.doctype.therapy_type.test_therapy_type import create_therapy_type -from erpnext.healthcare.doctype.therapy_plan.therapy_plan import make_therapy_session, make_sales_invoice -from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import \ - create_healthcare_docs, create_patient, create_appointment, create_medical_department + class TestTherapyPlan(unittest.TestCase): def test_creation_on_encounter_submission(self): diff --git a/erpnext/healthcare/doctype/therapy_plan/therapy_plan.py b/erpnext/healthcare/doctype/therapy_plan/therapy_plan.py index e20966043447..6d63f3918959 100644 --- a/erpnext/healthcare/doctype/therapy_plan/therapy_plan.py +++ b/erpnext/healthcare/doctype/therapy_plan/therapy_plan.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.utils import flt, today + class TherapyPlan(Document): def validate(self): self.set_totals() diff --git a/erpnext/healthcare/doctype/therapy_plan/therapy_plan_dashboard.py b/erpnext/healthcare/doctype/therapy_plan/therapy_plan_dashboard.py index 6526acda1537..25c8df1d6b73 100644 --- a/erpnext/healthcare/doctype/therapy_plan/therapy_plan_dashboard.py +++ b/erpnext/healthcare/doctype/therapy_plan/therapy_plan_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'therapy_plan', diff --git a/erpnext/healthcare/doctype/therapy_plan_detail/therapy_plan_detail.py b/erpnext/healthcare/doctype/therapy_plan_detail/therapy_plan_detail.py index 44211f32e3a9..1842fc2197b1 100644 --- a/erpnext/healthcare/doctype/therapy_plan_detail/therapy_plan_detail.py +++ b/erpnext/healthcare/doctype/therapy_plan_detail/therapy_plan_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TherapyPlanDetail(Document): pass diff --git a/erpnext/healthcare/doctype/therapy_plan_template/test_therapy_plan_template.py b/erpnext/healthcare/doctype/therapy_plan_template/test_therapy_plan_template.py index 33ee29db7d73..cd3d5686bc0e 100644 --- a/erpnext/healthcare/doctype/therapy_plan_template/test_therapy_plan_template.py +++ b/erpnext/healthcare/doctype/therapy_plan_template/test_therapy_plan_template.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestTherapyPlanTemplate(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template.py b/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template.py index 635d4beb8dfc..f5512be207f4 100644 --- a/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template.py +++ b/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.utils import cint, flt + from erpnext.healthcare.doctype.therapy_type.therapy_type import make_item_price + class TherapyPlanTemplate(Document): def after_insert(self): self.create_item_from_template() diff --git a/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template_dashboard.py b/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template_dashboard.py index c748fbfcb7c1..def5c482d152 100644 --- a/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template_dashboard.py +++ b/erpnext/healthcare/doctype/therapy_plan_template/therapy_plan_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'therapy_plan_template', diff --git a/erpnext/healthcare/doctype/therapy_plan_template_detail/therapy_plan_template_detail.py b/erpnext/healthcare/doctype/therapy_plan_template_detail/therapy_plan_template_detail.py index 7b979fe9fc8d..104c1bf28bd5 100644 --- a/erpnext/healthcare/doctype/therapy_plan_template_detail/therapy_plan_template_detail.py +++ b/erpnext/healthcare/doctype/therapy_plan_template_detail/therapy_plan_template_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TherapyPlanTemplateDetail(Document): pass diff --git a/erpnext/healthcare/doctype/therapy_session/test_therapy_session.py b/erpnext/healthcare/doctype/therapy_session/test_therapy_session.py index 75bb8df19633..e4afacf3f0ab 100644 --- a/erpnext/healthcare/doctype/therapy_session/test_therapy_session.py +++ b/erpnext/healthcare/doctype/therapy_session/test_therapy_session.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestTherapySession(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/therapy_session/therapy_session.py b/erpnext/healthcare/doctype/therapy_session/therapy_session.py index 51f267f94969..dcc739c46174 100644 --- a/erpnext/healthcare/doctype/therapy_session/therapy_session.py +++ b/erpnext/healthcare/doctype/therapy_session/therapy_session.py @@ -3,14 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import datetime + +import frappe +from frappe import _ from frappe.model.document import Document -from frappe.utils import get_time, flt from frappe.model.mapper import get_mapped_doc -from frappe import _ -from frappe.utils import cstr, getdate, get_link_to_form -from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account +from frappe.utils import cstr, flt, get_link_to_form, get_time, getdate + +from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import ( + get_income_account, + get_receivable_account, +) + class TherapySession(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/therapy_session/therapy_session_dashboard.py b/erpnext/healthcare/doctype/therapy_session/therapy_session_dashboard.py index 9de7e293238f..b8a37820ba09 100644 --- a/erpnext/healthcare/doctype/therapy_session/therapy_session_dashboard.py +++ b/erpnext/healthcare/doctype/therapy_session/therapy_session_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'therapy_session', diff --git a/erpnext/healthcare/doctype/therapy_type/test_therapy_type.py b/erpnext/healthcare/doctype/therapy_type/test_therapy_type.py index 80fc83fd6ce4..23d542236b85 100644 --- a/erpnext/healthcare/doctype/therapy_type/test_therapy_type.py +++ b/erpnext/healthcare/doctype/therapy_type/test_therapy_type.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTherapyType(unittest.TestCase): def test_therapy_type_item(self): therapy_type = create_therapy_type() diff --git a/erpnext/healthcare/doctype/therapy_type/therapy_type.py b/erpnext/healthcare/doctype/therapy_type/therapy_type.py index 3f6a36a96862..3517ef2c5ad5 100644 --- a/erpnext/healthcare/doctype/therapy_type/therapy_type.py +++ b/erpnext/healthcare/doctype/therapy_type/therapy_type.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ -from frappe.utils import cint from frappe.model.document import Document from frappe.model.rename_doc import rename_doc +from frappe.utils import cint + class TherapyType(Document): def validate(self): diff --git a/erpnext/healthcare/doctype/treatment_plan_template/test_treatment_plan_template.py b/erpnext/healthcare/doctype/treatment_plan_template/test_treatment_plan_template.py index 21ede7129f13..b8a1dd77869a 100644 --- a/erpnext/healthcare/doctype/treatment_plan_template/test_treatment_plan_template.py +++ b/erpnext/healthcare/doctype/treatment_plan_template/test_treatment_plan_template.py @@ -4,5 +4,6 @@ # import frappe import unittest + class TestTreatmentPlanTemplate(unittest.TestCase): pass diff --git a/erpnext/healthcare/doctype/treatment_plan_template/treatment_plan_template.py b/erpnext/healthcare/doctype/treatment_plan_template/treatment_plan_template.py index a92e2668fe85..dbe0e9ae5f4b 100644 --- a/erpnext/healthcare/doctype/treatment_plan_template/treatment_plan_template.py +++ b/erpnext/healthcare/doctype/treatment_plan_template/treatment_plan_template.py @@ -5,6 +5,7 @@ from frappe import _ from frappe.model.document import Document + class TreatmentPlanTemplate(Document): def validate(self): self.validate_age() diff --git a/erpnext/healthcare/doctype/treatment_plan_template_item/treatment_plan_template_item.py b/erpnext/healthcare/doctype/treatment_plan_template_item/treatment_plan_template_item.py index 5f58b06af603..8b8d89f07f3e 100644 --- a/erpnext/healthcare/doctype/treatment_plan_template_item/treatment_plan_template_item.py +++ b/erpnext/healthcare/doctype/treatment_plan_template_item/treatment_plan_template_item.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class TreatmentPlanTemplateItem(Document): pass diff --git a/erpnext/healthcare/doctype/treatment_plan_template_practitioner/treatment_plan_template_practitioner.py b/erpnext/healthcare/doctype/treatment_plan_template_practitioner/treatment_plan_template_practitioner.py index 6d34568e15c0..c2d08bcc1ab9 100644 --- a/erpnext/healthcare/doctype/treatment_plan_template_practitioner/treatment_plan_template_practitioner.py +++ b/erpnext/healthcare/doctype/treatment_plan_template_practitioner/treatment_plan_template_practitioner.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class TreatmentPlanTemplatePractitioner(Document): pass diff --git a/erpnext/healthcare/doctype/vital_signs/test_vital_signs.py b/erpnext/healthcare/doctype/vital_signs/test_vital_signs.py index 5d3e00740f90..22b52fb48220 100644 --- a/erpnext/healthcare/doctype/vital_signs/test_vital_signs.py +++ b/erpnext/healthcare/doctype/vital_signs/test_vital_signs.py @@ -2,6 +2,7 @@ # Copyright (c) 2015, ESS LLP and Contributors # See license.txt from __future__ import unicode_literals + import unittest # test_records = frappe.get_test_records('Vital Signs') diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py index 4bb3940ae0f4..d4dd3590b24a 100644 --- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py +++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from frappe import _ from frappe.model.document import Document from frappe.utils import cstr -from frappe import _ + class VitalSigns(Document): def validate(self): diff --git a/erpnext/healthcare/page/patient_history/patient_history.py b/erpnext/healthcare/page/patient_history/patient_history.py index 4cdfd64a697b..11d47f546e58 100644 --- a/erpnext/healthcare/page/patient_history/patient_history.py +++ b/erpnext/healthcare/page/patient_history/patient_history.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe.utils import cint + from erpnext.healthcare.utils import render_docs_as_html + @frappe.whitelist() def get_feed(name, document_types=None, date_range=None, start=0, page_length=20): """get feed""" diff --git a/erpnext/healthcare/page/patient_progress/patient_progress.py b/erpnext/healthcare/page/patient_progress/patient_progress.py index 46bfb3db5d40..c17f10574a9c 100644 --- a/erpnext/healthcare/page/patient_progress/patient_progress.py +++ b/erpnext/healthcare/page/patient_progress/patient_progress.py @@ -1,8 +1,10 @@ -import frappe +import json from datetime import datetime + +import frappe from frappe import _ -from frappe.utils import getdate, get_timespan_date_range -import json +from frappe.utils import get_timespan_date_range, getdate + @frappe.whitelist() def get_therapy_sessions_count(patient): diff --git a/erpnext/healthcare/report/inpatient_medication_orders/inpatient_medication_orders.py b/erpnext/healthcare/report/inpatient_medication_orders/inpatient_medication_orders.py index 28b60bdcc921..2e809fb66b06 100644 --- a/erpnext/healthcare/report/inpatient_medication_orders/inpatient_medication_orders.py +++ b/erpnext/healthcare/report/inpatient_medication_orders/inpatient_medication_orders.py @@ -2,8 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_current_healthcare_service_unit + +from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import ( + get_current_healthcare_service_unit, +) + def execute(filters=None): columns = get_columns() diff --git a/erpnext/healthcare/report/inpatient_medication_orders/test_inpatient_medication_orders.py b/erpnext/healthcare/report/inpatient_medication_orders/test_inpatient_medication_orders.py index 0a538fdff0d8..7c4b326c8e58 100644 --- a/erpnext/healthcare/report/inpatient_medication_orders/test_inpatient_medication_orders.py +++ b/erpnext/healthcare/report/inpatient_medication_orders/test_inpatient_medication_orders.py @@ -2,14 +2,32 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import datetime import unittest + import frappe -import datetime from frappe.utils import getdate, now_datetime -from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import create_patient, create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy -from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge -from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import create_ipmo, create_ipme -from erpnext.healthcare.report.inpatient_medication_orders.inpatient_medication_orders import execute + +from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import ( + create_ipme, + create_ipmo, +) +from erpnext.healthcare.doctype.inpatient_record.inpatient_record import ( + admit_patient, + discharge_patient, + schedule_discharge, +) +from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import ( + create_inpatient, + create_patient, + get_healthcare_service_unit, + mark_invoiced_inpatient_occupancy, +) +from erpnext.healthcare.report.inpatient_medication_orders.inpatient_medication_orders import ( + execute, +) + class TestInpatientMedicationOrders(unittest.TestCase): @classmethod diff --git a/erpnext/healthcare/report/lab_test_report/lab_test_report.py b/erpnext/healthcare/report/lab_test_report/lab_test_report.py index ba4ca4172dcf..e2a53bb1e46f 100644 --- a/erpnext/healthcare/report/lab_test_report/lab_test_report.py +++ b/erpnext/healthcare/report/lab_test_report/lab_test_report.py @@ -2,8 +2,10 @@ # License: See license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py b/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py index 9a4840acfeae..1afb5da1fb42 100644 --- a/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py +++ b/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import getdate, flt, add_to_date, add_days -from frappe import _ , scrub +from frappe import _, scrub +from frappe.utils import add_days, add_to_date, flt, getdate from six import iteritems + from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): return Analytics(filters).run() @@ -26,7 +29,7 @@ def run(self): return self.columns, self.data, None, self.chart def get_period_date_ranges(self): - from dateutil.relativedelta import relativedelta, MO + from dateutil.relativedelta import MO, relativedelta from_date, to_date = getdate(self.filters.from_date), getdate(self.filters.to_date) increment = { diff --git a/erpnext/healthcare/setup.py b/erpnext/healthcare/setup.py index 891272ddf813..167f24399cd0 100644 --- a/erpnext/healthcare/setup.py +++ b/erpnext/healthcare/setup.py @@ -1,9 +1,11 @@ from __future__ import unicode_literals -import frappe +import frappe from frappe import _ + from erpnext.setup.utils import insert_record + def setup_healthcare(): if frappe.db.exists('Medical Department', 'Cardiology'): # already setup diff --git a/erpnext/healthcare/utils.py b/erpnext/healthcare/utils.py index 7c80bdb73ce7..cae3008ca829 100644 --- a/erpnext/healthcare/utils.py +++ b/erpnext/healthcare/utils.py @@ -3,16 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json import math + import frappe -import json from frappe import _ +from frappe.utils import cstr, rounded, time_diff_in_hours from frappe.utils.formatters import format_value -from frappe.utils import time_diff_in_hours, rounded, cstr -from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_income_account + from erpnext.healthcare.doctype.fee_validity.fee_validity import create_fee_validity +from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_income_account from erpnext.healthcare.doctype.lab_test.lab_test import create_multiple + @frappe.whitelist() def get_healthcare_services_to_invoice(patient, company): patient = frappe.get_doc('Patient', patient) @@ -339,7 +343,9 @@ def get_service_item_and_practitioner_charge(doc): def get_appointment_type_service_item(appointment_type, department, is_inpatient): - from erpnext.healthcare.doctype.appointment_type.appointment_type import get_service_item_based_on_department + from erpnext.healthcare.doctype.appointment_type.appointment_type import ( + get_service_item_based_on_department, + ) item_list = get_service_item_based_on_department(appointment_type, department) service_item = None diff --git a/erpnext/healthcare/web_form/lab_test/lab_test.py b/erpnext/healthcare/web_form/lab_test/lab_test.py index 5a8c8a421cdb..ec08985b1918 100644 --- a/erpnext/healthcare/web_form/lab_test/lab_test.py +++ b/erpnext/healthcare/web_form/lab_test/lab_test.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): context.read_only = 1 diff --git a/erpnext/healthcare/web_form/patient_appointments/patient_appointments.py b/erpnext/healthcare/web_form/patient_appointments/patient_appointments.py index 09bcb42b5794..80c12fd21445 100644 --- a/erpnext/healthcare/web_form/patient_appointments/patient_appointments.py +++ b/erpnext/healthcare/web_form/patient_appointments/patient_appointments.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): context.read_only = 1 diff --git a/erpnext/healthcare/web_form/patient_registration/patient_registration.py b/erpnext/healthcare/web_form/patient_registration/patient_registration.py index 1bc4d1874c89..f57de916dd17 100644 --- a/erpnext/healthcare/web_form/patient_registration/patient_registration.py +++ b/erpnext/healthcare/web_form/patient_registration/patient_registration.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_context(context): # do your magic here pass diff --git a/erpnext/healthcare/web_form/prescription/prescription.py b/erpnext/healthcare/web_form/prescription/prescription.py index efdeaa906aea..f6f273ad5806 100644 --- a/erpnext/healthcare/web_form/prescription/prescription.py +++ b/erpnext/healthcare/web_form/prescription/prescription.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): context.read_only = 1 diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 5c05b25b1b65..fa64baa74893 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from frappe import _ app_name = "erpnext" diff --git a/erpnext/hotels/doctype/hotel_room/hotel_room.py b/erpnext/hotels/doctype/hotel_room/hotel_room.py index 6a2fc02574fd..93a62c98e799 100644 --- a/erpnext/hotels/doctype/hotel_room/hotel_room.py +++ b/erpnext/hotels/doctype/hotel_room/hotel_room.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoom(Document): def validate(self): if not self.capacity: diff --git a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py index e307b5ac37ad..918d0dc11261 100644 --- a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py +++ b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + test_dependencies = ["Hotel Room Package"] test_records = [ dict(doctype="Hotel Room", name="1001", diff --git a/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py b/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py index 69da007fc6b0..aa86d0c1c075 100644 --- a/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py +++ b/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomAmenity(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_package/hotel_room_package.py b/erpnext/hotels/doctype/hotel_room_package/hotel_room_package.py index 8a62eea8fa1a..1864081842dd 100644 --- a/erpnext/hotels/doctype/hotel_room_package/hotel_room_package.py +++ b/erpnext/hotels/doctype/hotel_room_package/hotel_room_package.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomPackage(Document): def validate(self): if not self.item: diff --git a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py index ebf7f2b7e9ff..f369031dc145 100644 --- a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py +++ b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + test_records = [ dict(doctype='Item', item_code='Breakfast', item_group='Products', is_stock_item=0), diff --git a/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py b/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py index 8eee0f24c5cb..90696cfbc986 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py +++ b/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomPricing(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py index b73fd44cd5e0..a3298ebf04a6 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py +++ b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + test_dependencies = ["Hotel Room Package"] test_records = [ dict(doctype="Hotel Room Pricing", enabled=1, diff --git a/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py b/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py index 6bf01bf941b6..ccc02ee96e10 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomPricingItem(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py b/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py index 9ae9fcfaf83f..e12a2a52612d 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomPricingPackage(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py index fec1c86ad02d..186527a2b5d5 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestHotelRoomPricingPackage(unittest.TestCase): pass diff --git a/erpnext/hotels/doctype/hotel_room_reservation/hotel_room_reservation.py b/erpnext/hotels/doctype/hotel_room_reservation/hotel_room_reservation.py index a8ebe8610ec8..4944862284a0 100644 --- a/erpnext/hotels/doctype/hotel_room_reservation/hotel_room_reservation.py +++ b/erpnext/hotels/doctype/hotel_room_reservation/hotel_room_reservation.py @@ -3,10 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json -from frappe.model.document import Document + +import json + +import frappe from frappe import _ -from frappe.utils import date_diff, add_days, flt +from frappe.model.document import Document +from frappe.utils import add_days, date_diff, flt + class HotelRoomUnavailableError(frappe.ValidationError): pass class HotelRoomPricingNotSetError(frappe.ValidationError): pass diff --git a/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py b/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py index d4979968e61e..e03005cf0428 100644 --- a/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py +++ b/erpnext/hotels/doctype/hotel_room_reservation/test_hotel_room_reservation.py @@ -3,9 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.hotels.doctype.hotel_room_reservation.hotel_room_reservation import HotelRoomPricingNotSetError, HotelRoomUnavailableError + +import frappe + +from erpnext.hotels.doctype.hotel_room_reservation.hotel_room_reservation import ( + HotelRoomPricingNotSetError, + HotelRoomUnavailableError, +) + test_dependencies = ["Hotel Room Package", "Hotel Room Pricing", "Hotel Room"] class TestHotelRoomReservation(unittest.TestCase): diff --git a/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py b/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py index 3406faea0e65..04679910a39e 100644 --- a/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py +++ b/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomReservationItem(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py b/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py index 1fc1303f3930..5793077acbea 100644 --- a/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py +++ b/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelRoomType(Document): pass diff --git a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py index 3b243e95669a..05148177e74e 100644 --- a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py +++ b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestHotelRoomType(unittest.TestCase): pass diff --git a/erpnext/hotels/doctype/hotel_settings/hotel_settings.py b/erpnext/hotels/doctype/hotel_settings/hotel_settings.py index d78bca149df2..4d16a9d3502f 100644 --- a/erpnext/hotels/doctype/hotel_settings/hotel_settings.py +++ b/erpnext/hotels/doctype/hotel_settings/hotel_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HotelSettings(Document): pass diff --git a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py index a081acc0e08f..90ddd1660eb3 100644 --- a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py +++ b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestHotelSettings(unittest.TestCase): pass diff --git a/erpnext/hotels/report/hotel_room_occupancy/hotel_room_occupancy.py b/erpnext/hotels/report/hotel_room_occupancy/hotel_room_occupancy.py index 259edb9c06d1..f02baebdf6f6 100644 --- a/erpnext/hotels/report/hotel_room_occupancy/hotel_room_occupancy.py +++ b/erpnext/hotels/report/hotel_room_occupancy/hotel_room_occupancy.py @@ -2,12 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import add_days, date_diff from erpnext.hotels.doctype.hotel_room_reservation.hotel_room_reservation import get_rooms_booked + def execute(filters=None): columns = get_columns(filters) data = get_data(filters) diff --git a/erpnext/hr/doctype/appointment_letter/appointment_letter.py b/erpnext/hr/doctype/appointment_letter/appointment_letter.py index 85b82c501450..b9a8ec630172 100644 --- a/erpnext/hr/doctype/appointment_letter/appointment_letter.py +++ b/erpnext/hr/doctype/appointment_letter/appointment_letter.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class AppointmentLetter(Document): pass diff --git a/erpnext/hr/doctype/appointment_letter/test_appointment_letter.py b/erpnext/hr/doctype/appointment_letter/test_appointment_letter.py index b9ce9819c5a4..88637b9fe930 100644 --- a/erpnext/hr/doctype/appointment_letter/test_appointment_letter.py +++ b/erpnext/hr/doctype/appointment_letter/test_appointment_letter.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestAppointmentLetter(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/appointment_letter_content/appointment_letter_content.py b/erpnext/hr/doctype/appointment_letter_content/appointment_letter_content.py index a1a49e536b62..f4db456af38d 100644 --- a/erpnext/hr/doctype/appointment_letter_content/appointment_letter_content.py +++ b/erpnext/hr/doctype/appointment_letter_content/appointment_letter_content.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AppointmentLettercontent(Document): pass diff --git a/erpnext/hr/doctype/appointment_letter_template/appointment_letter_template.py b/erpnext/hr/doctype/appointment_letter_template/appointment_letter_template.py index c23881f80070..acb5c1f69240 100644 --- a/erpnext/hr/doctype/appointment_letter_template/appointment_letter_template.py +++ b/erpnext/hr/doctype/appointment_letter_template/appointment_letter_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class AppointmentLetterTemplate(Document): pass diff --git a/erpnext/hr/doctype/appointment_letter_template/test_appointment_letter_template.py b/erpnext/hr/doctype/appointment_letter_template/test_appointment_letter_template.py index 3d061ac8e936..46dd3e12727d 100644 --- a/erpnext/hr/doctype/appointment_letter_template/test_appointment_letter_template.py +++ b/erpnext/hr/doctype/appointment_letter_template/test_appointment_letter_template.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestAppointmentLetterTemplate(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py index c2ed4579844e..96a4ffa524a5 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.py +++ b/erpnext/hr/doctype/appraisal/appraisal.py @@ -2,15 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe - -from frappe.utils import flt, getdate +import frappe from frappe import _ -from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document +from frappe.model.mapper import get_mapped_doc +from frappe.utils import flt, getdate + from erpnext.hr.utils import set_employee_name, validate_active_employee + class Appraisal(Document): def validate(self): if not self.status: diff --git a/erpnext/hr/doctype/appraisal/test_appraisal.py b/erpnext/hr/doctype/appraisal/test_appraisal.py index f70dc481c803..93b50e00f5ae 100644 --- a/erpnext/hr/doctype/appraisal/test_appraisal.py +++ b/erpnext/hr/doctype/appraisal/test_appraisal.py @@ -2,9 +2,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Appraisal') class TestAppraisal(unittest.TestCase): diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py index 11d9f3944d52..f73d035495ab 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class AppraisalGoal(Document): pass diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py index d0dfad4be313..d10a0de3bce0 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint, flt from frappe import _ - from frappe.model.document import Document +from frappe.utils import cint, flt + class AppraisalTemplate(Document): def validate(self): diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py index 392b370e6c3c..3b29b3e04940 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'kra_template', diff --git a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py index e3029d980a09..d84370eb1318 100644 --- a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py @@ -2,9 +2,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Appraisal Template') class TestAppraisalTemplate(unittest.TestCase): diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py index b3c5704fa53d..baeae62b5201 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class AppraisalTemplateGoal(Document): pass diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index c1a7c8f88a5c..a2d2af64e08f 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -2,14 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import getdate, nowdate +import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cstr, get_datetime, formatdate +from frappe.utils import cstr, formatdate, get_datetime, getdate, nowdate + from erpnext.hr.utils import validate_active_employee + class Attendance(Document): def validate(self): from erpnext.controllers.status_updater import validate_status diff --git a/erpnext/hr/doctype/attendance/attendance_dashboard.py b/erpnext/hr/doctype/attendance/attendance_dashboard.py index 5dd9403674e4..ca9fb9d47bb3 100644 --- a/erpnext/hr/doctype/attendance/attendance_dashboard.py +++ b/erpnext/hr/doctype/attendance/attendance_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'attendance', diff --git a/erpnext/hr/doctype/attendance/test_attendance.py b/erpnext/hr/doctype/attendance/test_attendance.py index 838b704c5a51..ab443774212c 100644 --- a/erpnext/hr/doctype/attendance/test_attendance.py +++ b/erpnext/hr/doctype/attendance/test_attendance.py @@ -2,8 +2,9 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import nowdate test_records = frappe.get_test_records('Attendance') diff --git a/erpnext/hr/doctype/attendance_request/attendance_request.py b/erpnext/hr/doctype/attendance_request/attendance_request.py index 7f88fed73a2e..1e7429656d27 100644 --- a/erpnext/hr/doctype/attendance_request/attendance_request.py +++ b/erpnext/hr/doctype/attendance_request/attendance_request.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import date_diff, add_days, getdate +from frappe.utils import add_days, date_diff, getdate + from erpnext.hr.doctype.employee.employee import is_holiday -from erpnext.hr.utils import validate_dates, validate_active_employee +from erpnext.hr.utils import validate_active_employee, validate_dates + class AttendanceRequest(Document): def validate(self): diff --git a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py index 2d3eb0001196..8feb6f2f23e5 100644 --- a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py +++ b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'attendance_request', diff --git a/erpnext/hr/doctype/attendance_request/test_attendance_request.py b/erpnext/hr/doctype/attendance_request/test_attendance_request.py index 9e668aa72fb3..a9db74cbf758 100644 --- a/erpnext/hr/doctype/attendance_request/test_attendance_request.py +++ b/erpnext/hr/doctype/attendance_request/test_attendance_request.py @@ -3,11 +3,12 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate from datetime import date +import frappe +from frappe.utils import nowdate + test_dependencies = ["Employee"] class TestAttendanceRequest(unittest.TestCase): diff --git a/erpnext/hr/doctype/branch/branch.py b/erpnext/hr/doctype/branch/branch.py index a847c8e21748..ae987a39036b 100644 --- a/erpnext/hr/doctype/branch/branch.py +++ b/erpnext/hr/doctype/branch/branch.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class Branch(Document): pass diff --git a/erpnext/hr/doctype/branch/test_branch.py b/erpnext/hr/doctype/branch/test_branch.py index 807698ba0a2e..7bf9b3953084 100644 --- a/erpnext/hr/doctype/branch/test_branch.py +++ b/erpnext/hr/doctype/branch/test_branch.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Branch') diff --git a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py index 3db81654a65c..f24483bf827b 100644 --- a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py +++ b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py @@ -3,12 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import date_diff, add_days, getdate, cint, format_date from frappe.model.document import Document -from erpnext.hr.utils import validate_dates, validate_overlap, get_leave_period, validate_active_employee, \ - create_additional_leave_ledger_entry, get_holiday_dates_for_employee +from frappe.utils import add_days, cint, date_diff, format_date, getdate + +from erpnext.hr.utils import ( + create_additional_leave_ledger_entry, + get_holiday_dates_for_employee, + get_leave_period, + validate_active_employee, + validate_dates, + validate_overlap, +) + class CompensatoryLeaveRequest(Document): diff --git a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py index 3b99c57051a6..95bdd514ef38 100644 --- a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py +++ b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py @@ -3,12 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import today, add_months, add_days + +import frappe +from frappe.utils import add_days, add_months, today + from erpnext.hr.doctype.attendance_request.test_attendance_request import get_employee -from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period from erpnext.hr.doctype.leave_application.leave_application import get_leave_balance_on +from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period test_dependencies = ["Employee"] diff --git a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py index 76c7a14693b6..8be8bd6c80c4 100644 --- a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +++ b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py @@ -3,14 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document -from frappe import _ from email_reply_parser import EmailReplyParser -from erpnext.hr.doctype.employee.employee import is_holiday +from frappe import _ +from frappe.model.document import Document from frappe.utils import global_date_format from six import string_types +from erpnext.hr.doctype.employee.employee import is_holiday + class DailyWorkSummary(Document): def send_mails(self, dws_group, emails): diff --git a/erpnext/hr/doctype/daily_work_summary/test_daily_work_summary.py b/erpnext/hr/doctype/daily_work_summary/test_daily_work_summary.py index 38684799763b..bed12e31eaa0 100644 --- a/erpnext/hr/doctype/daily_work_summary/test_daily_work_summary.py +++ b/erpnext/hr/doctype/daily_work_summary/test_daily_work_summary.py @@ -4,8 +4,9 @@ from __future__ import unicode_literals import os -import frappe import unittest + +import frappe import frappe.utils # test_records = frappe.get_test_records('Daily Work Summary') @@ -64,8 +65,7 @@ def setup_and_prepare_test(self, hour=None): filters=dict(email=('!=', 'test@example.com'))) self.setup_groups(hour) - from erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group \ - import trigger_emails + from erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group import trigger_emails trigger_emails() # check if emails are created diff --git a/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py b/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py index ece331aa718b..152b1a9c7c5a 100644 --- a/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py +++ b/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py @@ -3,13 +3,16 @@ # # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document import frappe.utils from frappe import _ +from frappe.model.document import Document + from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_user_emails_from_group from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday + class DailyWorkSummaryGroup(Document): def validate(self): if self.users: diff --git a/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py b/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py index eefcc0c3a65c..65fa5b4ee6da 100644 --- a/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py +++ b/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DailyWorkSummaryGroupUser(Document): pass diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py index 539a360269f9..a606708fbb6c 100644 --- a/erpnext/hr/doctype/department/department.py +++ b/erpnext/hr/doctype/department/department.py @@ -2,10 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe.model.document import Document from frappe.utils.nestedset import NestedSet, get_root_of + from erpnext.utilities.transaction_base import delete_events -from frappe.model.document import Document + class Department(NestedSet): nsm_parent_field = 'parent_department' diff --git a/erpnext/hr/doctype/department/test_department.py b/erpnext/hr/doctype/department/test_department.py index e4f6645ee420..2fb3b95ef436 100644 --- a/erpnext/hr/doctype/department/test_department.py +++ b/erpnext/hr/doctype/department/test_department.py @@ -1,9 +1,11 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import unittest +import frappe + test_ignore = ["Leave Block List"] class TestDepartment(unittest.TestCase): def test_remove_department_data(self): diff --git a/erpnext/hr/doctype/department_approver/department_approver.py b/erpnext/hr/doctype/department_approver/department_approver.py index d337959d534a..113ea1887fcf 100644 --- a/erpnext/hr/doctype/department_approver/department_approver.py +++ b/erpnext/hr/doctype/department_approver/department_approver.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class DepartmentApprover(Document): pass diff --git a/erpnext/hr/doctype/designation/designation.py b/erpnext/hr/doctype/designation/designation.py index a3f84aab5f02..f2e0893bff64 100644 --- a/erpnext/hr/doctype/designation/designation.py +++ b/erpnext/hr/doctype/designation/designation.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class Designation(Document): pass diff --git a/erpnext/hr/doctype/designation/test_designation.py b/erpnext/hr/doctype/designation/test_designation.py index 2778862a1c2f..33aa2433ceeb 100644 --- a/erpnext/hr/doctype/designation/test_designation.py +++ b/erpnext/hr/doctype/designation/test_designation.py @@ -2,8 +2,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + # test_records = frappe.get_test_records('Designation') def create_designation(**args): diff --git a/erpnext/hr/doctype/designation_skill/designation_skill.py b/erpnext/hr/doctype/designation_skill/designation_skill.py index c37d21f454e9..2074dc9df514 100644 --- a/erpnext/hr/doctype/designation_skill/designation_skill.py +++ b/erpnext/hr/doctype/designation_skill/designation_skill.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DesignationSkill(Document): pass diff --git a/erpnext/hr/doctype/driver/driver.py b/erpnext/hr/doctype/driver/driver.py index 2cd22cd54802..5c428b57fc93 100644 --- a/erpnext/hr/doctype/driver/driver.py +++ b/erpnext/hr/doctype/driver/driver.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class Driver(Document): pass diff --git a/erpnext/hr/doctype/driver/test_driver.py b/erpnext/hr/doctype/driver/test_driver.py index 4bc4a8fd57b8..fa3623745baf 100644 --- a/erpnext/hr/doctype/driver/test_driver.py +++ b/erpnext/hr/doctype/driver/test_driver.py @@ -5,5 +5,6 @@ import unittest + class TestDriver(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/driving_license_category/driving_license_category.py b/erpnext/hr/doctype/driving_license_category/driving_license_category.py index 33ba138e27cd..63ac4184bd9f 100644 --- a/erpnext/hr/doctype/driving_license_category/driving_license_category.py +++ b/erpnext/hr/doctype/driving_license_category/driving_license_category.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DrivingLicenseCategory(Document): pass diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 643f3da2ff78..79e8f6140aa8 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -1,15 +1,21 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe - -from frappe.utils import getdate, validate_email_address, today, add_years, cstr +from frappe import _, scrub, throw from frappe.model.naming import set_name_by_naming_series -from frappe import throw, _, scrub -from frappe.permissions import add_user_permission, remove_user_permission, \ - set_user_permission_if_allowed, has_permission, get_doc_permissions -from erpnext.utilities.transaction_base import delete_events +from frappe.permissions import ( + add_user_permission, + get_doc_permissions, + has_permission, + remove_user_permission, + set_user_permission_if_allowed, +) +from frappe.utils import add_years, cstr, getdate, today, validate_email_address from frappe.utils.nestedset import NestedSet +from erpnext.utilities.transaction_base import delete_events + + class EmployeeUserDisabledError(frappe.ValidationError): pass class InactiveEmployeeStatusError(frappe.ValidationError): diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index e853bee69f2f..ce307be60e83 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/hr/doctype/employee/employee_reminders.py b/erpnext/hr/doctype/employee/employee_reminders.py index 2155c027a9b8..fc018664b466 100644 --- a/erpnext/hr/doctype/employee/employee_reminders.py +++ b/erpnext/hr/doctype/employee/employee_reminders.py @@ -3,10 +3,12 @@ import frappe from frappe import _ -from frappe.utils import comma_sep, getdate, today, add_months, add_days +from frappe.utils import add_days, add_months, comma_sep, getdate, today + from erpnext.hr.doctype.employee.employee import get_all_employee_emails, get_employee_email from erpnext.hr.utils import get_holidays_for_employee + # ----------------- # HOLIDAY REMINDERS # ----------------- diff --git a/erpnext/hr/doctype/employee/test_employee.py b/erpnext/hr/doctype/employee/test_employee.py index 5feb6de8f2bc..8d6dfa2c1d26 100644 --- a/erpnext/hr/doctype/employee/test_employee.py +++ b/erpnext/hr/doctype/employee/test_employee.py @@ -1,10 +1,12 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import frappe -import erpnext import unittest + +import frappe import frappe.utils + +import erpnext from erpnext.hr.doctype.employee.employee import InactiveEmployeeStatusError test_records = frappe.get_test_records('Employee') @@ -23,9 +25,9 @@ def test_employee_status_left(self): self.assertRaises(InactiveEmployeeStatusError, employee1_doc.save) def test_employee_status_inactive(self): - from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure - from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_holiday_list + from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip + from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure employee = make_employee("test_employee_status@company.com") employee_doc = frappe.get_doc("Employee", employee) diff --git a/erpnext/hr/doctype/employee/test_employee_reminders.py b/erpnext/hr/doctype/employee/test_employee_reminders.py index f46a3d1f6251..52c00982443d 100644 --- a/erpnext/hr/doctype/employee/test_employee_reminders.py +++ b/erpnext/hr/doctype/employee/test_employee_reminders.py @@ -1,11 +1,12 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import frappe import unittest +from datetime import timedelta +import frappe from frappe.utils import getdate -from datetime import timedelta + from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.hr_settings.hr_settings import set_proceed_with_frequency_change @@ -84,7 +85,10 @@ def test_birthday_reminders(self): employee.company = "_Test Company" employee.save() - from erpnext.hr.doctype.employee.employee_reminders import get_employees_who_are_born_today, send_birthday_reminders + from erpnext.hr.doctype.employee.employee_reminders import ( + get_employees_who_are_born_today, + send_birthday_reminders, + ) employees_born_today = get_employees_who_are_born_today() self.assertTrue(employees_born_today.get("_Test Company")) @@ -105,7 +109,10 @@ def test_work_anniversary_reminders(self): employee.company = "_Test Company" employee.save() - from erpnext.hr.doctype.employee.employee_reminders import get_employees_having_an_event_today, send_work_anniversary_reminders + from erpnext.hr.doctype.employee.employee_reminders import ( + get_employees_having_an_event_today, + send_work_anniversary_reminders, + ) employees_having_work_anniversary = get_employees_having_an_event_today('work_anniversary') self.assertTrue(employees_having_work_anniversary.get("_Test Company")) @@ -120,8 +127,8 @@ def test_work_anniversary_reminders(self): self.assertTrue("Subject: Work Anniversary Reminder" in email_queue[0].message) def test_send_holidays_reminder_in_advance(self): - from erpnext.hr.utils import get_holidays_for_employee from erpnext.hr.doctype.employee.employee_reminders import send_holidays_reminder_in_advance + from erpnext.hr.utils import get_holidays_for_employee # Get HR settings and enable advance holiday reminders hr_settings = frappe.get_doc("HR Settings", "HR Settings") @@ -147,6 +154,7 @@ def test_send_holidays_reminder_in_advance(self): def test_advance_holiday_reminders_monthly(self): from erpnext.hr.doctype.employee.employee_reminders import send_reminders_in_advance_monthly + # Get HR settings and enable advance holiday reminders hr_settings = frappe.get_doc("HR Settings", "HR Settings") hr_settings.send_holiday_reminders = 1 @@ -161,6 +169,7 @@ def test_advance_holiday_reminders_monthly(self): def test_advance_holiday_reminders_weekly(self): from erpnext.hr.doctype.employee.employee_reminders import send_reminders_in_advance_weekly + # Get HR settings and enable advance holiday reminders hr_settings = frappe.get_doc("HR Settings", "HR Settings") hr_settings.send_holiday_reminders = 1 diff --git a/erpnext/hr/doctype/employee_advance/employee_advance.py b/erpnext/hr/doctype/employee_advance/employee_advance.py index cbb3cc813b4d..87d42d34e398 100644 --- a/erpnext/hr/doctype/employee_advance/employee_advance.py +++ b/erpnext/hr/doctype/employee_advance/employee_advance.py @@ -3,13 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import flt, nowdate + +import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account from erpnext.hr.utils import validate_active_employee + class EmployeeAdvanceOverPayment(frappe.ValidationError): pass diff --git a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py index 2f493e2d4e6c..06c05d5c1c5a 100644 --- a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py +++ b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'employee_advance', diff --git a/erpnext/hr/doctype/employee_advance/test_employee_advance.py b/erpnext/hr/doctype/employee_advance/test_employee_advance.py index 100968bb7aa5..f8e5f535cb5a 100644 --- a/erpnext/hr/doctype/employee_advance/test_employee_advance.py +++ b/erpnext/hr/doctype/employee_advance/test_employee_advance.py @@ -3,12 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe, erpnext import unittest + +import frappe from frappe.utils import nowdate -from erpnext.hr.doctype.employee_advance.employee_advance import make_bank_entry -from erpnext.hr.doctype.employee_advance.employee_advance import EmployeeAdvanceOverPayment + +import erpnext from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.hr.doctype.employee_advance.employee_advance import ( + EmployeeAdvanceOverPayment, + make_bank_entry, +) + class TestEmployeeAdvance(unittest.TestCase): def test_paid_amount_and_status(self): diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py index 16c1a32b9b5c..7c751a47a6b3 100644 --- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py +++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe.model.document import Document from frappe.utils import getdate diff --git a/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py b/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py index 496f1653ba04..cfc50a1dbadf 100644 --- a/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py +++ b/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeBoardingActivity(Document): pass diff --git a/erpnext/hr/doctype/employee_checkin/employee_checkin.py b/erpnext/hr/doctype/employee_checkin/employee_checkin.py index 6c0cd4f963bf..98ead42c17d8 100644 --- a/erpnext/hr/doctype/employee_checkin/employee_checkin.py +++ b/erpnext/hr/doctype/employee_checkin/employee_checkin.py @@ -3,14 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import now, cint, get_datetime -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document +from frappe.utils import cint, get_datetime, now -from erpnext.hr.doctype.shift_assignment.shift_assignment import get_actual_start_end_datetime_of_shift +from erpnext.hr.doctype.shift_assignment.shift_assignment import ( + get_actual_start_end_datetime_of_shift, +) from erpnext.hr.utils import validate_active_employee + class EmployeeCheckin(Document): def validate(self): validate_active_employee(self.employee) diff --git a/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py b/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py index 7ba511f08d55..7e3637e6f454 100644 --- a/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py +++ b/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py @@ -3,13 +3,19 @@ # See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import now_datetime, nowdate, to_timedelta import unittest from datetime import timedelta -from erpnext.hr.doctype.employee_checkin.employee_checkin import add_log_based_on_employee_field, mark_attendance_and_link_log, calculate_working_hours +import frappe +from frappe.utils import now_datetime, nowdate, to_timedelta + from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.hr.doctype.employee_checkin.employee_checkin import ( + add_log_based_on_employee_field, + calculate_working_hours, + mark_attendance_and_link_log, +) + class TestEmployeeCheckin(unittest.TestCase): def test_add_log_based_on_employee_field(self): diff --git a/erpnext/hr/doctype/employee_education/employee_education.py b/erpnext/hr/doctype/employee_education/employee_education.py index f0a76172b2c2..6229ad2f74b6 100644 --- a/erpnext/hr/doctype/employee_education/employee_education.py +++ b/erpnext/hr/doctype/employee_education/employee_education.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class EmployeeEducation(Document): pass diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py index 517ef57be85e..aa616eb709cb 100644 --- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py +++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class EmployeeExternalWorkHistory(Document): pass diff --git a/erpnext/hr/doctype/employee_grade/employee_grade.py b/erpnext/hr/doctype/employee_grade/employee_grade.py index 42a9f161359c..9c464201856c 100644 --- a/erpnext/hr/doctype/employee_grade/employee_grade.py +++ b/erpnext/hr/doctype/employee_grade/employee_grade.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeGrade(Document): pass diff --git a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py index df6791041854..92d9fa082c95 100644 --- a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py +++ b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'transactions': [ diff --git a/erpnext/hr/doctype/employee_grade/test_employee_grade.py b/erpnext/hr/doctype/employee_grade/test_employee_grade.py index 93058cf10838..2490f4ef50a6 100644 --- a/erpnext/hr/doctype/employee_grade/test_employee_grade.py +++ b/erpnext/hr/doctype/employee_grade/test_employee_grade.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeGrade(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_grievance/employee_grievance.py b/erpnext/hr/doctype/employee_grievance/employee_grievance.py index 17055829efbe..fd9a33b37715 100644 --- a/erpnext/hr/doctype/employee_grievance/employee_grievance.py +++ b/erpnext/hr/doctype/employee_grievance/employee_grievance.py @@ -5,6 +5,7 @@ from frappe import _, bold from frappe.model.document import Document + class EmployeeGrievance(Document): def on_submit(self): if self.status not in ["Invalid", "Resolved"]: diff --git a/erpnext/hr/doctype/employee_grievance/test_employee_grievance.py b/erpnext/hr/doctype/employee_grievance/test_employee_grievance.py index ed897ee10326..e2d0002aa62e 100644 --- a/erpnext/hr/doctype/employee_grievance/test_employee_grievance.py +++ b/erpnext/hr/doctype/employee_grievance/test_employee_grievance.py @@ -1,10 +1,14 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt -import frappe import unittest + +import frappe from frappe.utils import today + from erpnext.hr.doctype.employee.test_employee import make_employee + + class TestEmployeeGrievance(unittest.TestCase): def test_create_employee_grievance(self): create_employee_grievance() diff --git a/erpnext/hr/doctype/employee_group/employee_group.py b/erpnext/hr/doctype/employee_group/employee_group.py index 3025877b8e10..b2fe5eb3ad61 100644 --- a/erpnext/hr/doctype/employee_group/employee_group.py +++ b/erpnext/hr/doctype/employee_group/employee_group.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class EmployeeGroup(Document): pass diff --git a/erpnext/hr/doctype/employee_group/test_employee_group.py b/erpnext/hr/doctype/employee_group/test_employee_group.py index 26a61c407b25..053e840740a6 100644 --- a/erpnext/hr/doctype/employee_group/test_employee_group.py +++ b/erpnext/hr/doctype/employee_group/test_employee_group.py @@ -2,10 +2,14 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe + import unittest + +import frappe + from erpnext.hr.doctype.employee.test_employee import make_employee + class TestEmployeeGroup(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_group_table/employee_group_table.py b/erpnext/hr/doctype/employee_group_table/employee_group_table.py index 816611d018d0..d9407a96fa6d 100644 --- a/erpnext/hr/doctype/employee_group_table/employee_group_table.py +++ b/erpnext/hr/doctype/employee_group_table/employee_group_table.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class EmployeeGroupTable(Document): pass diff --git a/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py b/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py index abc01ef8d4bf..15a752e8c121 100644 --- a/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py +++ b/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeHealthInsurance(Document): pass diff --git a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py index f0787f52d200..030e5dba0f0b 100644 --- a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py +++ b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeHealthInsurance(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py index 2f385a8113ee..d37ab908729f 100644 --- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py +++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class EmployeeInternalWorkHistory(Document): pass diff --git a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py index 0cb50475bf8c..7421e17ca849 100644 --- a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py +++ b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.hr.utils import EmployeeBoardingController from frappe.model.mapper import get_mapped_doc +from erpnext.hr.utils import EmployeeBoardingController + + class IncompleteTaskError(frappe.ValidationError): pass class EmployeeOnboarding(EmployeeBoardingController): diff --git a/erpnext/hr/doctype/employee_onboarding/test_employee_onboarding.py b/erpnext/hr/doctype/employee_onboarding/test_employee_onboarding.py index 336e13c9b773..33cad7b7e9b3 100644 --- a/erpnext/hr/doctype/employee_onboarding/test_employee_onboarding.py +++ b/erpnext/hr/doctype/employee_onboarding/test_employee_onboarding.py @@ -3,13 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import nowdate -from erpnext.hr.doctype.employee_onboarding.employee_onboarding import make_employee -from erpnext.hr.doctype.employee_onboarding.employee_onboarding import IncompleteTaskError + +from erpnext.hr.doctype.employee_onboarding.employee_onboarding import ( + IncompleteTaskError, + make_employee, +) from erpnext.hr.doctype.job_offer.test_job_offer import create_job_offer + class TestEmployeeOnboarding(unittest.TestCase): def test_employee_onboarding_incomplete_task(self): if frappe.db.exists('Employee Onboarding', {'employee_name': 'Test Researcher'}): diff --git a/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py b/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py index d17063181918..830b0e4d7532 100644 --- a/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py +++ b/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeOnboardingActivity(Document): pass diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py index 6f1c31673153..fdf0d0d4bdd0 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeOnboardingTemplate(Document): pass diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py index ab0eb2f5dce4..cb9951c1a61b 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'employee_onboarding_template', diff --git a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py index f4b5b8834289..f317f4c4a776 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py +++ b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeOnboardingTemplate(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.py b/erpnext/hr/doctype/employee_promotion/employee_promotion.py index a3a61834c8c4..164d48b89523 100644 --- a/erpnext/hr/doctype/employee_promotion/employee_promotion.py +++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import getdate + from erpnext.hr.utils import update_employee, validate_active_employee + class EmployeePromotion(Document): def validate(self): validate_active_employee(self.employee) diff --git a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py index 9e7d3186b883..39af6ff7cc7e 100644 --- a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py +++ b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import getdate, add_days + +import frappe +from frappe.utils import add_days, getdate + from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee + class TestEmployeePromotion(unittest.TestCase): def setUp(self): self.employee = make_employee("employee@promotions.com") diff --git a/erpnext/hr/doctype/employee_property_history/employee_property_history.py b/erpnext/hr/doctype/employee_property_history/employee_property_history.py index fb67852d164c..613828752d41 100644 --- a/erpnext/hr/doctype/employee_property_history/employee_property_history.py +++ b/erpnext/hr/doctype/employee_property_history/employee_property_history.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeePropertyHistory(Document): pass diff --git a/erpnext/hr/doctype/employee_referral/employee_referral.py b/erpnext/hr/doctype/employee_referral/employee_referral.py index 547a95e3bdf4..5cb5bb5fd3a2 100644 --- a/erpnext/hr/doctype/employee_referral/employee_referral.py +++ b/erpnext/hr/doctype/employee_referral/employee_referral.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import get_link_to_form from frappe.model.document import Document +from frappe.utils import get_link_to_form + from erpnext.hr.utils import validate_active_employee + class EmployeeReferral(Document): def validate(self): validate_active_employee(self.referrer) @@ -56,6 +59,7 @@ def create_job_applicant(source_name, target_doc=None): @frappe.whitelist() def create_additional_salary(doc): import json + from six import string_types if isinstance(doc, string_types): diff --git a/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py b/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py index caca2961a1a4..85d6c2089b88 100644 --- a/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py +++ b/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'employee_referral', diff --git a/erpnext/hr/doctype/employee_referral/test_employee_referral.py b/erpnext/hr/doctype/employee_referral/test_employee_referral.py index 599f3262240d..d0ee2fcdea77 100644 --- a/erpnext/hr/doctype/employee_referral/test_employee_referral.py +++ b/erpnext/hr/doctype/employee_referral/test_employee_referral.py @@ -3,12 +3,18 @@ # See license.txt from __future__ import unicode_literals +import unittest + import frappe from frappe.utils import today + from erpnext.hr.doctype.designation.test_designation import create_designation -from erpnext.hr.doctype.employee_referral.employee_referral import create_job_applicant, create_additional_salary from erpnext.hr.doctype.employee.test_employee import make_employee -import unittest +from erpnext.hr.doctype.employee_referral.employee_referral import ( + create_additional_salary, + create_job_applicant, +) + class TestEmployeeReferral(unittest.TestCase): def test_workflow_and_status_sync(self): diff --git a/erpnext/hr/doctype/employee_separation/employee_separation.py b/erpnext/hr/doctype/employee_separation/employee_separation.py index b64668157b0b..140115bcf0fc 100644 --- a/erpnext/hr/doctype/employee_separation/employee_separation.py +++ b/erpnext/hr/doctype/employee_separation/employee_separation.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + from erpnext.hr.utils import EmployeeBoardingController + class EmployeeSeparation(EmployeeBoardingController): def validate(self): super(EmployeeSeparation, self).validate() diff --git a/erpnext/hr/doctype/employee_separation/test_employee_separation.py b/erpnext/hr/doctype/employee_separation/test_employee_separation.py index 0b72efa1378b..0489e71305bf 100644 --- a/erpnext/hr/doctype/employee_separation/test_employee_separation.py +++ b/erpnext/hr/doctype/employee_separation/test_employee_separation.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_dependencies = ["Employee Onboarding"] class TestEmployeeSeparation(unittest.TestCase): diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py index 0508fc462e21..1c91d9603647 100644 --- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeSeparationTemplate(Document): pass diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py index 75f985cec397..acd525637b3f 100644 --- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'employee_separation_template', diff --git a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py index 3fd3d398bd12..d246f484762d 100644 --- a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py +++ b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeSeparationTemplate(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_skill/employee_skill.py b/erpnext/hr/doctype/employee_skill/employee_skill.py index ac05fba624bd..6f860c6c599b 100644 --- a/erpnext/hr/doctype/employee_skill/employee_skill.py +++ b/erpnext/hr/doctype/employee_skill/employee_skill.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeSkill(Document): pass diff --git a/erpnext/hr/doctype/employee_skill_map/employee_skill_map.py b/erpnext/hr/doctype/employee_skill_map/employee_skill_map.py index 073f02fa2583..d93c22f2ab89 100644 --- a/erpnext/hr/doctype/employee_skill_map/employee_skill_map.py +++ b/erpnext/hr/doctype/employee_skill_map/employee_skill_map.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeSkillMap(Document): pass diff --git a/erpnext/hr/doctype/employee_training/employee_training.py b/erpnext/hr/doctype/employee_training/employee_training.py index 810796d66cf2..068116a77f63 100644 --- a/erpnext/hr/doctype/employee_training/employee_training.py +++ b/erpnext/hr/doctype/employee_training/employee_training.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeTraining(Document): pass diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.py b/erpnext/hr/doctype/employee_transfer/employee_transfer.py index c2007747fb3d..b1f66098f0da 100644 --- a/erpnext/hr/doctype/employee_transfer/employee_transfer.py +++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import getdate + from erpnext.hr.utils import update_employee + class EmployeeTransfer(Document): def before_submit(self): if getdate(self.transfer_date) > getdate(): diff --git a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py index 93fc7a270569..ad2f3ade0547 100644 --- a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py +++ b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import getdate, add_days + +import frappe +from frappe.utils import add_days, getdate + from erpnext.hr.doctype.employee.test_employee import make_employee + class TestEmployeeTransfer(unittest.TestCase): def setUp(self): make_employee("employee2@transfers.com") diff --git a/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py b/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py index 1a665dc10080..fa9a635b53a8 100644 --- a/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py +++ b/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeTransferProperty(Document): pass diff --git a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py index 39c20a6f7160..e22604db8eee 100644 --- a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py +++ b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeTransferProperty(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employment_type/employment_type.py b/erpnext/hr/doctype/employment_type/employment_type.py index 00aa6bb9bc46..995d8e2021b4 100644 --- a/erpnext/hr/doctype/employment_type/employment_type.py +++ b/erpnext/hr/doctype/employment_type/employment_type.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class EmploymentType(Document): pass diff --git a/erpnext/hr/doctype/employment_type/test_employment_type.py b/erpnext/hr/doctype/employment_type/test_employment_type.py index 0297ffa01a3e..2ba4e8c1a46b 100644 --- a/erpnext/hr/doctype/employment_type/test_employment_type.py +++ b/erpnext/hr/doctype/employment_type/test_employment_type.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Employment Type') diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index 4dc089cb1d27..fc903c526ab4 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -2,17 +2,21 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import get_fullname, flt, cstr, get_link_to_form from frappe.model.document import Document -from erpnext.hr.utils import set_employee_name, share_doc_with_approver, validate_active_employee -from erpnext.accounts.party import get_party_account -from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import cstr, flt, get_fullname, get_link_to_form from frappe.utils.csvutils import getlink + +import erpnext +from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account +from erpnext.accounts.general_ledger import make_gl_entries +from erpnext.accounts.party import get_party_account from erpnext.accounts.utils import get_account_currency +from erpnext.controllers.accounts_controller import AccountsController +from erpnext.hr.utils import set_employee_name, share_doc_with_approver, validate_active_employee + class InvalidExpenseApproverError(frappe.ValidationError): pass class ExpenseApproverIdentityError(frappe.ValidationError): pass diff --git a/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py b/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py index fe9735070194..a5682dc1e951 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'reference_name', diff --git a/erpnext/hr/doctype/expense_claim/test_expense_claim.py b/erpnext/hr/doctype/expense_claim/test_expense_claim.py index 27c17ee94a89..e54c1457244a 100644 --- a/erpnext/hr/doctype/expense_claim/test_expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/test_expense_claim.py @@ -2,12 +2,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import random_string, nowdate, flt -from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry + +import frappe +from frappe.utils import flt, nowdate, random_string + from erpnext.accounts.doctype.account.test_account import create_account from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry test_records = frappe.get_test_records('Expense Claim') test_dependencies = ['Employee'] diff --git a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py index f34633cf58b1..4dbf7ac0379a 100644 --- a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py +++ b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ExpenseClaimAccount(Document): pass diff --git a/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py b/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py index c4e7b026e3bb..d773119b8094 100644 --- a/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py +++ b/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ExpenseClaimAdvance(Document): pass diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py index 5d48990c5ce0..2e8551e9f6d5 100644 --- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py +++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ExpenseClaimDetail(Document): pass diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py index a637a5402130..101461c54b13 100644 --- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py +++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class ExpenseClaimType(Document): def validate(self): self.validate_accounts() diff --git a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py index 1d894308d3ab..997f2e89eb87 100644 --- a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py +++ b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Expense Claim Type') class TestExpenseClaimType(unittest.TestCase): diff --git a/erpnext/hr/doctype/expense_taxes_and_charges/expense_taxes_and_charges.py b/erpnext/hr/doctype/expense_taxes_and_charges/expense_taxes_and_charges.py index 4103bef1ffe7..596e8c719a4b 100644 --- a/erpnext/hr/doctype/expense_taxes_and_charges/expense_taxes_and_charges.py +++ b/erpnext/hr/doctype/expense_taxes_and_charges/expense_taxes_and_charges.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ExpenseTaxesandCharges(Document): pass diff --git a/erpnext/hr/doctype/grievance_type/grievance_type.py b/erpnext/hr/doctype/grievance_type/grievance_type.py index 618cf0a0318c..5d8d41cb73d0 100644 --- a/erpnext/hr/doctype/grievance_type/grievance_type.py +++ b/erpnext/hr/doctype/grievance_type/grievance_type.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class GrievanceType(Document): pass diff --git a/erpnext/hr/doctype/grievance_type/test_grievance_type.py b/erpnext/hr/doctype/grievance_type/test_grievance_type.py index a02a34d41fa6..481f4e58a798 100644 --- a/erpnext/hr/doctype/grievance_type/test_grievance_type.py +++ b/erpnext/hr/doctype/grievance_type/test_grievance_type.py @@ -4,5 +4,6 @@ # import frappe import unittest + class TestGrievanceType(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/holiday/holiday.py b/erpnext/hr/doctype/holiday/holiday.py index 78a95b9b7410..bce0dda6c514 100644 --- a/erpnext/hr/doctype/holiday/holiday.py +++ b/erpnext/hr/doctype/holiday/holiday.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class Holiday(Document): pass diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 8af8cea605d8..8d91ac2ddd7b 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -3,11 +3,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json -from frappe.utils import cint, getdate, formatdate, today -from frappe import throw, _ + +import frappe +from frappe import _, throw from frappe.model.document import Document +from frappe.utils import cint, formatdate, getdate, today + class OverlapError(frappe.ValidationError): pass @@ -44,9 +47,10 @@ def validate_days(self): def get_weekly_off_date_list(self, start_date, end_date): start_date, end_date = getdate(start_date), getdate(end_date) - from dateutil import relativedelta - from datetime import timedelta import calendar + from datetime import timedelta + + from dateutil import relativedelta date_list = [] existing_date_list = [] diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py index 05641c7dc26d..bbba36af8759 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'holiday_list', diff --git a/erpnext/hr/doctype/holiday_list/test_holiday_list.py b/erpnext/hr/doctype/holiday_list/test_holiday_list.py index 64bed6637bda..27131932db48 100644 --- a/erpnext/hr/doctype/holiday_list/test_holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/test_holiday_list.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import getdate from datetime import timedelta +import frappe +from frappe.utils import getdate + class TestHolidayList(unittest.TestCase): def test_holiday_list(self): diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index a47409363c78..c295bcbc0d99 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -4,7 +4,6 @@ # For license information, please see license.txt import frappe - from frappe.model.document import Document from frappe.utils import format_date diff --git a/erpnext/hr/doctype/hr_settings/test_hr_settings.py b/erpnext/hr/doctype/hr_settings/test_hr_settings.py index b0b07b0c0b35..8df2064d6f46 100644 --- a/erpnext/hr/doctype/hr_settings/test_hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/test_hr_settings.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.hr.doctype.employee.test_employee import make_employee -from frappe.utils import now_datetime from datetime import timedelta +import frappe +from frappe.utils import now_datetime + +from erpnext.hr.doctype.employee.test_employee import make_employee + + class TestHRSettings(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/identification_document_type/identification_document_type.py b/erpnext/hr/doctype/identification_document_type/identification_document_type.py index d9d81d2fa8f3..d7e42a33fff7 100644 --- a/erpnext/hr/doctype/identification_document_type/identification_document_type.py +++ b/erpnext/hr/doctype/identification_document_type/identification_document_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class IdentificationDocumentType(Document): pass diff --git a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py index 1265afaf4570..bca211d73e6a 100644 --- a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py +++ b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestIdentificationDocumentType(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/interest/interest.py b/erpnext/hr/doctype/interest/interest.py index 2a9c19c09d89..4378fea8cdc8 100644 --- a/erpnext/hr/doctype/interest/interest.py +++ b/erpnext/hr/doctype/interest/interest.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Interest(Document): pass diff --git a/erpnext/hr/doctype/interest/test_interest.py b/erpnext/hr/doctype/interest/test_interest.py index a7fe83bccc8e..3ee1e39442fd 100644 --- a/erpnext/hr/doctype/interest/test_interest.py +++ b/erpnext/hr/doctype/interest/test_interest.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Interest') class TestInterest(unittest.TestCase): diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py index 14aeb03a87ea..6971e5b4fef6 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant.py @@ -4,11 +4,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + import frappe from frappe import _ +from frappe.model.document import Document from frappe.utils import comma_and, validate_email_address + class DuplicationError(frappe.ValidationError): pass class JobApplicant(Document): diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index ed97978a8ad0..0e329410ef16 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'job_applicant', diff --git a/erpnext/hr/doctype/job_applicant/test_job_applicant.py b/erpnext/hr/doctype/job_applicant/test_job_applicant.py index 872834230e68..e583e25eae0a 100644 --- a/erpnext/hr/doctype/job_applicant/test_job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/test_job_applicant.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Job Applicant') class TestJobApplicant(unittest.TestCase): diff --git a/erpnext/hr/doctype/job_applicant_source/job_applicant_source.py b/erpnext/hr/doctype/job_applicant_source/job_applicant_source.py index 5f543d285cfc..9139584aa5cc 100644 --- a/erpnext/hr/doctype/job_applicant_source/job_applicant_source.py +++ b/erpnext/hr/doctype/job_applicant_source/job_applicant_source.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class JobApplicantSource(Document): pass diff --git a/erpnext/hr/doctype/job_applicant_source/test_job_applicant_source.py b/erpnext/hr/doctype/job_applicant_source/test_job_applicant_source.py index f318df20f7c9..0c29124560b4 100644 --- a/erpnext/hr/doctype/job_applicant_source/test_job_applicant_source.py +++ b/erpnext/hr/doctype/job_applicant_source/test_job_applicant_source.py @@ -5,5 +5,6 @@ import unittest + class TestJobApplicantSource(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/job_offer/job_offer.py b/erpnext/hr/doctype/job_offer/job_offer.py index 7e650f769172..07a7809891d5 100644 --- a/erpnext/hr/doctype/job_offer/job_offer.py +++ b/erpnext/hr/doctype/job_offer/job_offer.py @@ -2,13 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint +from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe import _ +from frappe.utils import cint from frappe.utils.data import get_link_to_form + class JobOffer(Document): def onload(self): employee = frappe.db.get_value("Employee", {"job_applicant": self.job_applicant}, "name") or "" diff --git a/erpnext/hr/doctype/job_offer/test_job_offer.py b/erpnext/hr/doctype/job_offer/test_job_offer.py index edb21321fcc8..3f3eca17e628 100644 --- a/erpnext/hr/doctype/job_offer/test_job_offer.py +++ b/erpnext/hr/doctype/job_offer/test_job_offer.py @@ -2,11 +2,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, add_days -from erpnext.hr.doctype.job_applicant.test_job_applicant import create_job_applicant + +import frappe +from frappe.utils import add_days, nowdate + from erpnext.hr.doctype.designation.test_designation import create_designation +from erpnext.hr.doctype.job_applicant.test_job_applicant import create_job_applicant from erpnext.hr.doctype.staffing_plan.test_staffing_plan import make_company # test_records = frappe.get_test_records('Job Offer') diff --git a/erpnext/hr/doctype/job_offer_term/job_offer_term.py b/erpnext/hr/doctype/job_offer_term/job_offer_term.py index 6dbe6757a709..236d4aa8c74c 100644 --- a/erpnext/hr/doctype/job_offer_term/job_offer_term.py +++ b/erpnext/hr/doctype/job_offer_term/job_offer_term.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class JobOfferTerm(Document): pass diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py index 1e8976717708..38d9a7181700 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.py +++ b/erpnext/hr/doctype/job_opening/job_opening.py @@ -4,11 +4,16 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe.website.website_generator import WebsiteGenerator +import frappe from frappe import _ -from erpnext.hr.doctype.staffing_plan.staffing_plan import get_designation_counts, get_active_staffing_plan_details +from frappe.website.website_generator import WebsiteGenerator + +from erpnext.hr.doctype.staffing_plan.staffing_plan import ( + get_active_staffing_plan_details, + get_designation_counts, +) + class JobOpening(WebsiteGenerator): website = frappe._dict( diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py index 31ef33ef2ce5..ca02e98c8d0d 100644 --- a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'job_title', diff --git a/erpnext/hr/doctype/job_opening/test_job_opening.py b/erpnext/hr/doctype/job_opening/test_job_opening.py index 815ce5bdb8cc..ab0ba5b36e3d 100644 --- a/erpnext/hr/doctype/job_opening/test_job_opening.py +++ b/erpnext/hr/doctype/job_opening/test_job_opening.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Job Opening') class TestJobOpening(unittest.TestCase): diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index 4757cd3b1922..f69bdf76307b 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -2,13 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt, date_diff, formatdate, add_days, today, getdate from frappe import _ from frappe.model.document import Document -from erpnext.hr.utils import set_employee_name, get_leave_period -from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import expire_allocation, create_leave_ledger_entry +from frappe.utils import add_days, date_diff, flt, formatdate, getdate, today + from erpnext.hr.doctype.leave_application.leave_application import get_approved_leaves_for_period +from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import ( + create_leave_ledger_entry, + expire_allocation, +) +from erpnext.hr.utils import get_leave_period, set_employee_name + class OverlapError(frappe.ValidationError): pass class BackDatedAllocationError(frappe.ValidationError): pass diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py index 7a063d92eac6..369270795205 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'leave_allocation', diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py index bff06e6a91cc..db2e71bda2fc 100644 --- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py @@ -1,10 +1,17 @@ from __future__ import unicode_literals + +import unittest + import frappe +from frappe.utils import add_days, add_months, getdate, nowdate + import erpnext -import unittest -from frappe.utils import nowdate, add_months, getdate, add_days +from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import ( + expire_allocation, + process_expired_allocation, +) from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type -from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import process_expired_allocation, expire_allocation + class TestLeaveAllocation(unittest.TestCase): @classmethod diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 2e37c135947a..9e6fc6d0f144 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -2,14 +2,33 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_link_to_form, get_fullname, add_days, nowdate -from erpnext.hr.utils import set_employee_name, get_leave_period, share_doc_with_approver, validate_active_employee -from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates -from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee +from frappe.utils import ( + add_days, + cint, + cstr, + date_diff, + flt, + formatdate, + get_fullname, + get_link_to_form, + getdate, + nowdate, +) + from erpnext.buying.doctype.supplier_scorecard.supplier_scorecard import daterange +from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee +from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import create_leave_ledger_entry +from erpnext.hr.utils import ( + get_leave_period, + set_employee_name, + share_doc_with_approver, + validate_active_employee, +) + class LeaveDayBlockedError(frappe.ValidationError): pass class OverlapError(frappe.ValidationError): pass @@ -17,6 +36,8 @@ class AttendanceAlreadyMarkedError(frappe.ValidationError): pass class NotAnOptionalHoliday(frappe.ValidationError): pass from frappe.model.document import Document + + class LeaveApplication(Document): def get_feed(self): return _("{0}: From {0} of type {1}").format(self.employee_name, self.leave_type) diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 2832e2fad3b2..bbe4eab68810 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -2,16 +2,24 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError, NotAnOptionalHoliday, get_leave_balance_on +import frappe from frappe.permissions import clear_user_permissions_for_doctype -from frappe.utils import add_days, nowdate, now_datetime, getdate, add_months -from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type -from erpnext.hr.doctype.leave_allocation.test_leave_allocation import create_leave_allocation -from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import create_assignment_for_multiple_employees +from frappe.utils import add_days, add_months, getdate, now_datetime, nowdate + from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.hr.doctype.leave_allocation.test_leave_allocation import create_leave_allocation +from erpnext.hr.doctype.leave_application.leave_application import ( + LeaveDayBlockedError, + NotAnOptionalHoliday, + OverlapError, + get_leave_balance_on, +) +from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import ( + create_assignment_for_multiple_employees, +) +from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type test_dependencies = ["Leave Allocation", "Leave Block List", "Employee"] diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py index 9cb9fc05cee7..9ba079c6e1fe 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -4,10 +4,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class LeaveBlockList(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py index 45aa4915bc66..30e7572c3838 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'leave_block_list', diff --git a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py index 0eb69a55a703..dd90e4f9eeab 100644 --- a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py @@ -2,12 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe from frappe.utils import getdate + from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates + class TestLeaveBlockList(unittest.TestCase): def tearDown(self): frappe.set_user("Administrator") diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py index 8e5a09e01ec2..e0cc0466c3d2 100644 --- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py +++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class LeaveBlockListAllow(Document): pass diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py index 54978a1e83af..240b226e79e0 100644 --- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py +++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class LeaveBlockListDate(Document): pass diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index 642ab6a81325..16bedc4a1ad2 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import cint, cstr, flt, nowdate, comma_and, date_diff -from frappe import msgprint, _ +import frappe +from frappe import _, msgprint from frappe.model.document import Document +from frappe.utils import cint, comma_and, cstr, date_diff, flt, nowdate + class LeaveControlPanel(Document): def get_employees(self): diff --git a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py index 9a907c885ace..827f13be83c9 100644 --- a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestLeaveControlPanel(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/leave_encashment/leave_encashment.py b/erpnext/hr/doctype/leave_encashment/leave_encashment.py index d136210a0432..58ef63ad8793 100644 --- a/erpnext/hr/doctype/leave_encashment/leave_encashment.py +++ b/erpnext/hr/doctype/leave_encashment/leave_encashment.py @@ -3,14 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import getdate, nowdate, flt -from erpnext.hr.utils import set_employee_name, validate_active_employee -from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure -from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import create_leave_ledger_entry +from frappe.utils import flt, getdate, nowdate + from erpnext.hr.doctype.leave_allocation.leave_allocation import get_unused_leaves +from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import create_leave_ledger_entry +from erpnext.hr.utils import set_employee_name, validate_active_employee +from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import ( + get_assigned_salary_structure, +) + class LeaveEncashment(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py b/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py index c1da8b47ffaa..762745b88f4c 100644 --- a/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py +++ b/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py @@ -3,14 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import today, add_months + +import frappe +from frappe.utils import add_months, today + from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period -from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import create_assignment_for_multiple_employees -from erpnext.hr.doctype.leave_policy.test_leave_policy import create_leave_policy\ +from erpnext.hr.doctype.leave_policy.test_leave_policy import create_leave_policy +from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import ( + create_assignment_for_multiple_employees, +) +from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure test_dependencies = ["Leave Type"] diff --git a/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py b/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py index 33a6243e609a..460661202eae 100644 --- a/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py +++ b/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import add_days, today, flt, DATE_FORMAT, getdate +from frappe.model.document import Document +from frappe.utils import DATE_FORMAT, add_days, flt, getdate, today + class LeaveLedgerEntry(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_ledger_entry/test_leave_ledger_entry.py b/erpnext/hr/doctype/leave_ledger_entry/test_leave_ledger_entry.py index 6f7725c254ed..5fa419da43c8 100644 --- a/erpnext/hr/doctype/leave_ledger_entry/test_leave_ledger_entry.py +++ b/erpnext/hr/doctype/leave_ledger_entry/test_leave_ledger_entry.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLeaveLedgerEntry(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/leave_period/leave_period.py b/erpnext/hr/doctype/leave_period/leave_period.py index 86dccfc2225d..45d6eed42cb1 100644 --- a/erpnext/hr/doctype/leave_period/leave_period.py +++ b/erpnext/hr/doctype/leave_period/leave_period.py @@ -3,13 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate, cstr, add_days, date_diff, ceil from frappe.model.document import Document -from erpnext.hr.utils import validate_overlap +from frappe.utils import add_days, ceil, cstr, date_diff, getdate from frappe.utils.background_jobs import enqueue +from erpnext.hr.utils import validate_overlap + + class LeavePeriod(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py index 7c2c9632d85e..a64c63af867e 100644 --- a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py +++ b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'leave_period', diff --git a/erpnext/hr/doctype/leave_period/test_leave_period.py b/erpnext/hr/doctype/leave_period/test_leave_period.py index cbb34371fc99..5c5ae133a13e 100644 --- a/erpnext/hr/doctype/leave_period/test_leave_period.py +++ b/erpnext/hr/doctype/leave_period/test_leave_period.py @@ -3,9 +3,12 @@ # See license.txt from __future__ import unicode_literals -import frappe, erpnext import unittest +import frappe + +import erpnext + test_dependencies = ["Employee", "Leave Type", "Leave Policy"] class TestLeavePeriod(unittest.TestCase): diff --git a/erpnext/hr/doctype/leave_policy/leave_policy.py b/erpnext/hr/doctype/leave_policy/leave_policy.py index 964a5de83ec7..b11459d8155f 100644 --- a/erpnext/hr/doctype/leave_policy/leave_policy.py +++ b/erpnext/hr/doctype/leave_policy/leave_policy.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class LeavePolicy(Document): def validate(self): if self.leave_policy_details: diff --git a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py index 474f3a77ad0b..76f886c73ebc 100644 --- a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py +++ b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'leave_policy', diff --git a/erpnext/hr/doctype/leave_policy/test_leave_policy.py b/erpnext/hr/doctype/leave_policy/test_leave_policy.py index af7567b5bc75..b0743f535bfb 100644 --- a/erpnext/hr/doctype/leave_policy/test_leave_policy.py +++ b/erpnext/hr/doctype/leave_policy/test_leave_policy.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestLeavePolicy(unittest.TestCase): def test_max_leave_allowed(self): random_leave_type = frappe.get_all("Leave Type", fields=["name", "max_leaves_allowed"]) diff --git a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py index d7cb1c88c923..be1f69c41d23 100644 --- a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py +++ b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py @@ -3,14 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json +from math import ceil + import frappe -from frappe.model.document import Document from frappe import _, bold -from frappe.utils import getdate, date_diff, comma_and, formatdate, get_datetime, flt -from math import ceil -import json +from frappe.model.document import Document +from frappe.utils import comma_and, date_diff, flt, formatdate, get_datetime, getdate from six import string_types + class LeavePolicyAssignment(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py index a2f7f5866b7d..79142a63429c 100644 --- a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py +++ b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'leave_policy_assignment', diff --git a/erpnext/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py b/erpnext/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py index 0089804f5129..cbb26a1e285a 100644 --- a/erpnext/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py +++ b/erpnext/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py @@ -3,11 +3,18 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.hr.doctype.leave_application.test_leave_application import get_leave_period, get_employee -from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import create_assignment_for_multiple_employees + +import frappe + +from erpnext.hr.doctype.leave_application.test_leave_application import ( + get_employee, + get_leave_period, +) from erpnext.hr.doctype.leave_policy.test_leave_policy import create_leave_policy +from erpnext.hr.doctype.leave_policy_assignment.leave_policy_assignment import ( + create_assignment_for_multiple_employees, +) test_dependencies = ["Employee"] diff --git a/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py b/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py index c103f08cd972..a9c7231d6ccd 100644 --- a/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py +++ b/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LeavePolicyDetail(Document): pass diff --git a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py index 610b1fa332e1..9da034422959 100644 --- a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py +++ b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestLeavePolicyDetail(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py index 21f180b857db..109c0db8ce1a 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.py +++ b/erpnext/hr/doctype/leave_type/leave_type.py @@ -2,13 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import calendar -import frappe from datetime import datetime -from frappe.utils import today -from frappe import _ +import frappe +from frappe import _ from frappe.model.document import Document +from frappe.utils import today + class LeaveType(Document): def validate(self): diff --git a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py index c8944fcb9e23..773d4e88beb3 100644 --- a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py +++ b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'leave_type', diff --git a/erpnext/hr/doctype/offer_term/offer_term.py b/erpnext/hr/doctype/offer_term/offer_term.py index 6a6320110600..c6de54b2e2eb 100644 --- a/erpnext/hr/doctype/offer_term/offer_term.py +++ b/erpnext/hr/doctype/offer_term/offer_term.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class OfferTerm(Document): pass diff --git a/erpnext/hr/doctype/offer_term/test_offer_term.py b/erpnext/hr/doctype/offer_term/test_offer_term.py index d0dd14d1e629..7afc23bc2d43 100644 --- a/erpnext/hr/doctype/offer_term/test_offer_term.py +++ b/erpnext/hr/doctype/offer_term/test_offer_term.py @@ -2,9 +2,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Offer Term') class TestOfferTerm(unittest.TestCase): diff --git a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py index 62f62a5c2498..1512e90e3bd5 100644 --- a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py +++ b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PurposeofTravel(Document): pass diff --git a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py index ccd950dff3a1..58a55dfc8778 100644 --- a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py +++ b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestPurposeofTravel(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/shift_assignment/shift_assignment.py b/erpnext/hr/doctype/shift_assignment/shift_assignment.py index 89ae4d535d45..da2cf539e72b 100644 --- a/erpnext/hr/doctype/shift_assignment/shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/shift_assignment.py @@ -3,14 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from datetime import datetime, timedelta + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, now_datetime, nowdate + from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday from erpnext.hr.utils import validate_active_employee -from datetime import timedelta, datetime + class ShiftAssignment(Document): def validate(self): diff --git a/erpnext/hr/doctype/shift_assignment/test_shift_assignment.py b/erpnext/hr/doctype/shift_assignment/test_shift_assignment.py index 07d92fe61d6a..84003e2ec287 100644 --- a/erpnext/hr/doctype/shift_assignment/test_shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/test_shift_assignment.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, add_days + +import frappe +from frappe.utils import add_days, nowdate test_dependencies = ["Shift Type"] diff --git a/erpnext/hr/doctype/shift_request/shift_request.py b/erpnext/hr/doctype/shift_request/shift_request.py index 2731da125a85..a6ac7c83aebd 100644 --- a/erpnext/hr/doctype/shift_request/shift_request.py +++ b/erpnext/hr/doctype/shift_request/shift_request.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import formatdate, getdate + from erpnext.hr.utils import share_doc_with_approver, validate_active_employee + class OverlapError(frappe.ValidationError): pass class ShiftRequest(Document): diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py index f70b61a20a6a..482d98810aad 100644 --- a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'shift_request', diff --git a/erpnext/hr/doctype/shift_request/test_shift_request.py b/erpnext/hr/doctype/shift_request/test_shift_request.py index 60b7676e251f..7b4a3ca5aab6 100644 --- a/erpnext/hr/doctype/shift_request/test_shift_request.py +++ b/erpnext/hr/doctype/shift_request/test_shift_request.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, add_days + +import frappe +from frappe.utils import add_days, nowdate + from erpnext.hr.doctype.employee.test_employee import make_employee test_dependencies = ["Shift Type"] diff --git a/erpnext/hr/doctype/shift_type/shift_type.py b/erpnext/hr/doctype/shift_type/shift_type.py index d5fdda809444..e53373df2796 100644 --- a/erpnext/hr/doctype/shift_type/shift_type.py +++ b/erpnext/hr/doctype/shift_type/shift_type.py @@ -3,16 +3,25 @@ # For license information, please see license.txt from __future__ import unicode_literals + import itertools from datetime import timedelta import frappe from frappe.model.document import Document -from frappe.utils import cint, getdate, get_datetime -from erpnext.hr.doctype.shift_assignment.shift_assignment import get_actual_start_end_datetime_of_shift, get_employee_shift -from erpnext.hr.doctype.employee_checkin.employee_checkin import mark_attendance_and_link_log, calculate_working_hours +from frappe.utils import cint, get_datetime, getdate + from erpnext.hr.doctype.attendance.attendance import mark_attendance from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee +from erpnext.hr.doctype.employee_checkin.employee_checkin import ( + calculate_working_hours, + mark_attendance_and_link_log, +) +from erpnext.hr.doctype.shift_assignment.shift_assignment import ( + get_actual_start_end_datetime_of_shift, + get_employee_shift, +) + class ShiftType(Document): @frappe.whitelist() diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py index aedd190bcb43..5d8719a3ac16 100644 --- a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'shift', diff --git a/erpnext/hr/doctype/shift_type/test_shift_type.py b/erpnext/hr/doctype/shift_type/test_shift_type.py index bc4f0eafcd52..5faade060278 100644 --- a/erpnext/hr/doctype/shift_type/test_shift_type.py +++ b/erpnext/hr/doctype/shift_type/test_shift_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestShiftType(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/skill/skill.py b/erpnext/hr/doctype/skill/skill.py index 8d2421207533..ebaa410fbdd8 100644 --- a/erpnext/hr/doctype/skill/skill.py +++ b/erpnext/hr/doctype/skill/skill.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class Skill(Document): pass diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan.py b/erpnext/hr/doctype/staffing_plan/staffing_plan.py index e6c783aca221..57a92b058718 100644 --- a/erpnext/hr/doctype/staffing_plan/staffing_plan.py +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan.py @@ -3,12 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import getdate, nowdate, cint, flt +from frappe.model.document import Document +from frappe.utils import cint, flt, getdate, nowdate from frappe.utils.nestedset import get_descendants_of + class SubsidiaryCompanyError(frappe.ValidationError): pass class ParentCompanyError(frappe.ValidationError): pass diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py index 8e89d53c8e0b..f941a76f5770 100644 --- a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'staffing_plan', diff --git a/erpnext/hr/doctype/staffing_plan/test_staffing_plan.py b/erpnext/hr/doctype/staffing_plan/test_staffing_plan.py index 1c6218e9a70b..4517cba23357 100644 --- a/erpnext/hr/doctype/staffing_plan/test_staffing_plan.py +++ b/erpnext/hr/doctype/staffing_plan/test_staffing_plan.py @@ -3,11 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.hr.doctype.staffing_plan.staffing_plan import SubsidiaryCompanyError -from erpnext.hr.doctype.staffing_plan.staffing_plan import ParentCompanyError -from frappe.utils import nowdate, add_days + +import frappe +from frappe.utils import add_days, nowdate + +from erpnext.hr.doctype.staffing_plan.staffing_plan import ( + ParentCompanyError, + SubsidiaryCompanyError, +) test_dependencies = ["Designation"] diff --git a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py index 28a651e72d87..e85ee04d57e8 100644 --- a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py +++ b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StaffingPlanDetail(Document): pass diff --git a/erpnext/hr/doctype/training_event/test_training_event.py b/erpnext/hr/doctype/training_event/test_training_event.py index 6a275b330c05..ed44fa607047 100644 --- a/erpnext/hr/doctype/training_event/test_training_event.py +++ b/erpnext/hr/doctype/training_event/test_training_event.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import today, add_days + +import frappe +from frappe.utils import add_days, today + from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee + class TestTrainingEvent(unittest.TestCase): def setUp(self): create_training_program("Basic Training") diff --git a/erpnext/hr/doctype/training_event/training_event.py b/erpnext/hr/doctype/training_event/training_event.py index e2c30cb31452..9b01d3d90260 100644 --- a/erpnext/hr/doctype/training_event/training_event.py +++ b/erpnext/hr/doctype/training_event/training_event.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import time_diff_in_seconds + from erpnext.hr.doctype.employee.employee import get_employee_emails + class TrainingEvent(Document): def validate(self): self.set_employee_emails() diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index 19afd8dd6e1c..18b183508bf4 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'training_event', diff --git a/erpnext/hr/doctype/training_event_employee/training_event_employee.py b/erpnext/hr/doctype/training_event_employee/training_event_employee.py index 234e958a2127..1ad28d6208f4 100644 --- a/erpnext/hr/doctype/training_event_employee/training_event_employee.py +++ b/erpnext/hr/doctype/training_event_employee/training_event_employee.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TrainingEventEmployee(Document): pass diff --git a/erpnext/hr/doctype/training_feedback/test_training_feedback.py b/erpnext/hr/doctype/training_feedback/test_training_feedback.py index 4c0c18029d03..a9bf6d6bbde8 100644 --- a/erpnext/hr/doctype/training_feedback/test_training_feedback.py +++ b/erpnext/hr/doctype/training_feedback/test_training_feedback.py @@ -3,10 +3,17 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + +from erpnext.hr.doctype.training_event.test_training_event import ( + create_training_event, + create_training_program, +) from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee -from erpnext.hr.doctype.training_event.test_training_event import create_training_program, create_training_event + + class TestTrainingFeedback(unittest.TestCase): def setUp(self): create_training_program("Basic Training") diff --git a/erpnext/hr/doctype/training_feedback/training_feedback.py b/erpnext/hr/doctype/training_feedback/training_feedback.py index 3d4b9b3ea963..6a41a657cea3 100644 --- a/erpnext/hr/doctype/training_feedback/training_feedback.py +++ b/erpnext/hr/doctype/training_feedback/training_feedback.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class TrainingFeedback(Document): def validate(self): diff --git a/erpnext/hr/doctype/training_program/test_training_program.py b/erpnext/hr/doctype/training_program/test_training_program.py index 9d5b28616b1c..aec319f40776 100644 --- a/erpnext/hr/doctype/training_program/test_training_program.py +++ b/erpnext/hr/doctype/training_program/test_training_program.py @@ -5,5 +5,6 @@ import unittest + class TestTrainingProgram(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/training_program/training_program.py b/erpnext/hr/doctype/training_program/training_program.py index 7a3720b66b6c..6f3ab5a806f3 100644 --- a/erpnext/hr/doctype/training_program/training_program.py +++ b/erpnext/hr/doctype/training_program/training_program.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class TrainingProgram(Document): pass diff --git a/erpnext/hr/doctype/training_program/training_program_dashboard.py b/erpnext/hr/doctype/training_program/training_program_dashboard.py index 0fc18a802982..b2eed6895cad 100644 --- a/erpnext/hr/doctype/training_program/training_program_dashboard.py +++ b/erpnext/hr/doctype/training_program/training_program_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'training_program', diff --git a/erpnext/hr/doctype/training_result/test_training_result.py b/erpnext/hr/doctype/training_result/test_training_result.py index 29ed2a0ff38a..c0c5aadf0b8f 100644 --- a/erpnext/hr/doctype/training_result/test_training_result.py +++ b/erpnext/hr/doctype/training_result/test_training_result.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Training Result') class TestTrainingResult(unittest.TestCase): diff --git a/erpnext/hr/doctype/training_result/training_result.py b/erpnext/hr/doctype/training_result/training_result.py index 7cdc51f80106..9cfc5707cac3 100644 --- a/erpnext/hr/doctype/training_result/training_result.py +++ b/erpnext/hr/doctype/training_result/training_result.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + from erpnext.hr.doctype.employee.employee import get_employee_emails + class TrainingResult(Document): def validate(self): training_event = frappe.get_doc("Training Event", self.training_event) diff --git a/erpnext/hr/doctype/training_result_employee/training_result_employee.py b/erpnext/hr/doctype/training_result_employee/training_result_employee.py index 54e2a18260a7..9304241c3d49 100644 --- a/erpnext/hr/doctype/training_result_employee/training_result_employee.py +++ b/erpnext/hr/doctype/training_result_employee/training_result_employee.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TrainingResultEmployee(Document): pass diff --git a/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py index 0b369beb1346..f389825cd55d 100644 --- a/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py +++ b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TravelItinerary(Document): pass diff --git a/erpnext/hr/doctype/travel_request/test_travel_request.py b/erpnext/hr/doctype/travel_request/test_travel_request.py index dac5517aab0f..7d5f6fa1ab6e 100644 --- a/erpnext/hr/doctype/travel_request/test_travel_request.py +++ b/erpnext/hr/doctype/travel_request/test_travel_request.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTravelRequest(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/travel_request/travel_request.py b/erpnext/hr/doctype/travel_request/travel_request.py index 60834d3f4a64..5083a02c476d 100644 --- a/erpnext/hr/doctype/travel_request/travel_request.py +++ b/erpnext/hr/doctype/travel_request/travel_request.py @@ -3,10 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + from erpnext.hr.utils import validate_active_employee + class TravelRequest(Document): def validate(self): validate_active_employee(self.employee) diff --git a/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py index 9fa85e84c283..73aa1e72801a 100644 --- a/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py +++ b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TravelRequestCosting(Document): pass diff --git a/erpnext/hr/doctype/upload_attendance/test_upload_attendance.py b/erpnext/hr/doctype/upload_attendance/test_upload_attendance.py index 03b0cf3da21a..e0a776c45d09 100644 --- a/erpnext/hr/doctype/upload_attendance/test_upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/test_upload_attendance.py @@ -3,12 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -import erpnext + +import frappe from frappe.utils import getdate -from erpnext.hr.doctype.upload_attendance.upload_attendance import get_data + +import erpnext from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.hr.doctype.upload_attendance.upload_attendance import get_data test_dependencies = ['Holiday List'] diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py index 9c765d737164..030ecec74f9d 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -4,14 +4,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cstr, add_days, date_diff, getdate from frappe import _ -from frappe.utils.csvutils import UnicodeWriter from frappe.model.document import Document +from frappe.utils import add_days, cstr, date_diff, getdate +from frappe.utils.csvutils import UnicodeWriter + from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.hr.utils import get_holiday_dates_for_employee + class UploadAttendance(Document): pass diff --git a/erpnext/hr/doctype/vehicle/test_vehicle.py b/erpnext/hr/doctype/vehicle/test_vehicle.py index ff3429d0e7e2..97eae850162f 100644 --- a/erpnext/hr/doctype/vehicle/test_vehicle.py +++ b/erpnext/hr/doctype/vehicle/test_vehicle.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate,flt, cstr,random_string + +import frappe +from frappe.utils import cstr, flt, nowdate, random_string + # test_records = frappe.get_test_records('Vehicle') class TestVehicle(unittest.TestCase): diff --git a/erpnext/hr/doctype/vehicle/vehicle.py b/erpnext/hr/doctype/vehicle/vehicle.py index 1df506826833..2ff190426dd4 100644 --- a/erpnext/hr/doctype/vehicle/vehicle.py +++ b/erpnext/hr/doctype/vehicle/vehicle.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate from frappe.model.document import Document +from frappe.utils import getdate + class Vehicle(Document): def validate(self): diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index 628c8972cec4..6a01bcffd50a 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/hr/doctype/vehicle_log/test_vehicle_log.py b/erpnext/hr/doctype/vehicle_log/test_vehicle_log.py index ed02120cca39..1b0bfcb08f9d 100644 --- a/erpnext/hr/doctype/vehicle_log/test_vehicle_log.py +++ b/erpnext/hr/doctype/vehicle_log/test_vehicle_log.py @@ -3,12 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, flt, cstr, random_string + +import frappe +from frappe.utils import cstr, flt, nowdate, random_string + from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.vehicle_log.vehicle_log import make_expense_claim + class TestVehicleLog(unittest.TestCase): def setUp(self): employee_id = frappe.db.sql("""select name from `tabEmployee` where name='testdriver@example.com'""") diff --git a/erpnext/hr/doctype/vehicle_log/vehicle_log.py b/erpnext/hr/doctype/vehicle_log/vehicle_log.py index 04c94e37d5a6..48231cd33c83 100644 --- a/erpnext/hr/doctype/vehicle_log/vehicle_log.py +++ b/erpnext/hr/doctype/vehicle_log/vehicle_log.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, cstr -from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cstr, flt + class VehicleLog(Document): def validate(self): diff --git a/erpnext/hr/doctype/vehicle_service/vehicle_service.py b/erpnext/hr/doctype/vehicle_service/vehicle_service.py index 18ed7821382b..dfebc65c44a1 100644 --- a/erpnext/hr/doctype/vehicle_service/vehicle_service.py +++ b/erpnext/hr/doctype/vehicle_service/vehicle_service.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class VehicleService(Document): pass diff --git a/erpnext/hr/notification/training_feedback/training_feedback.py b/erpnext/hr/notification/training_feedback/training_feedback.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/hr/notification/training_feedback/training_feedback.py +++ b/erpnext/hr/notification/training_feedback/training_feedback.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/hr/notification/training_scheduled/training_scheduled.py b/erpnext/hr/notification/training_scheduled/training_scheduled.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/hr/notification/training_scheduled/training_scheduled.py +++ b/erpnext/hr/notification/training_scheduled/training_scheduled.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/hr/page/organizational_chart/organizational_chart.py b/erpnext/hr/page/organizational_chart/organizational_chart.py index 4423d29e4029..1baf805f4b99 100644 --- a/erpnext/hr/page/organizational_chart/organizational_chart.py +++ b/erpnext/hr/page/organizational_chart/organizational_chart.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + @frappe.whitelist() def get_children(parent=None, company=None, exclude_node=None): filters = [['status', '!=', 'Left']] diff --git a/erpnext/hr/page/team_updates/team_updates.py b/erpnext/hr/page/team_updates/team_updates.py index 58cdc4b7e1dc..a5e7c44c31df 100644 --- a/erpnext/hr/page/team_updates/team_updates.py +++ b/erpnext/hr/page/team_updates/team_updates.py @@ -3,6 +3,7 @@ import frappe from email_reply_parser import EmailReplyParser + @frappe.whitelist() def get_data(start=0): #frappe.only_for('Employee', 'System Manager') diff --git a/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py b/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py index d8691b4d0259..62ffb7d34457 100644 --- a/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py +++ b/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe import _ + import frappe +from frappe import _ + from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_user_emails_from_group + def execute(filters=None): if not filters.group: return [], [] columns, data = get_columns(), get_data(filters) diff --git a/erpnext/hr/report/employee_advance_summary/employee_advance_summary.py b/erpnext/hr/report/employee_advance_summary/employee_advance_summary.py index 363e31d0960b..d0c295df9f1f 100644 --- a/erpnext/hr/report/employee_advance_summary/employee_advance_summary.py +++ b/erpnext/hr/report/employee_advance_summary/employee_advance_summary.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/hr/report/employee_analytics/employee_analytics.py b/erpnext/hr/report/employee_analytics/employee_analytics.py index fe77b6abc963..725c5a157139 100644 --- a/erpnext/hr/report/employee_analytics/employee_analytics.py +++ b/erpnext/hr/report/employee_analytics/employee_analytics.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.py b/erpnext/hr/report/employee_birthday/employee_birthday.py index e8d78449bff0..63a6b1038433 100644 --- a/erpnext/hr/report/employee_birthday/employee_birthday.py +++ b/erpnext/hr/report/employee_birthday/employee_birthday.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py index b8953b3eaaca..6546e5fef029 100644 --- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py +++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py @@ -2,11 +2,18 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from itertools import groupby + import frappe -from frappe.utils import flt, add_days from frappe import _ -from erpnext.hr.doctype.leave_application.leave_application import get_leaves_for_period, get_leave_balance_on -from itertools import groupby +from frappe.utils import add_days, flt + +from erpnext.hr.doctype.leave_application.leave_application import ( + get_leave_balance_on, + get_leaves_for_period, +) + def execute(filters=None): if filters.to_date <= filters.from_date: diff --git a/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py b/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py index e4a7e65f7b89..b0cf58418448 100644 --- a/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py +++ b/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py @@ -2,14 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt -from erpnext.hr.doctype.leave_application.leave_application \ - import get_leave_details -from erpnext.hr.report.employee_leave_balance.employee_leave_balance \ - import get_department_leave_approver_map +from erpnext.hr.doctype.leave_application.leave_application import get_leave_details +from erpnext.hr.report.employee_leave_balance.employee_leave_balance import ( + get_department_leave_approver_map, +) + def execute(filters=None): leave_types = frappe.db.sql_list("select name from `tabLeave Type` order by name asc") diff --git a/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py b/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py index 59f56d7345f7..3a268821361c 100644 --- a/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py +++ b/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py @@ -2,6 +2,7 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py index c5929c6bf99c..8c40da29ee91 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import cstr, cint, getdate -from frappe import msgprint, _ + from calendar import monthrange +import frappe +from frappe import _, msgprint +from frappe.utils import cint, cstr, getdate + status_map = { "Absent": "A", "Half Day": "HD", diff --git a/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py b/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py index 303c829eb6cc..c598e9e37309 100644 --- a/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py +++ b/erpnext/hr/report/recruitment_analytics/recruitment_analytics.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/hr/report/vehicle_expenses/test_vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/test_vehicle_expenses.py index 26e0f26392e2..2ba87efd9b27 100644 --- a/erpnext/hr/report/vehicle_expenses/test_vehicle_expenses.py +++ b/erpnext/hr/report/vehicle_expenses/test_vehicle_expenses.py @@ -2,14 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe from frappe.utils import getdate + +from erpnext.accounts.utils import get_fiscal_year from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.hr.doctype.vehicle_log.vehicle_log import make_expense_claim from erpnext.hr.doctype.vehicle_log.test_vehicle_log import get_vehicle, make_vehicle_log +from erpnext.hr.doctype.vehicle_log.vehicle_log import make_expense_claim from erpnext.hr.report.vehicle_expenses.vehicle_expenses import execute -from erpnext.accounts.utils import get_fiscal_year + class TestVehicleExpenses(unittest.TestCase): @classmethod diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py index c05355918607..3481cd3307e2 100644 --- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py +++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _ from frappe.utils import flt + +import erpnext from erpnext.accounts.report.financial_statements import get_period_list + def execute(filters=None): filters = frappe._dict(filters or {}) diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py index b0afcb20ca01..3f4a0b90b563 100644 --- a/erpnext/hr/utils.py +++ b/erpnext/hr/utils.py @@ -1,14 +1,30 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import erpnext import frappe -from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee, InactiveEmployeeStatusError from frappe import _ from frappe.desk.form import assign_to from frappe.model.document import Document -from frappe.utils import (add_days, cstr, flt, format_datetime, formatdate, - get_datetime, getdate, nowdate, today, unique, get_link_to_form) +from frappe.utils import ( + add_days, + cstr, + flt, + format_datetime, + formatdate, + get_datetime, + get_link_to_form, + getdate, + nowdate, + today, + unique, +) + +import erpnext +from erpnext.hr.doctype.employee.employee import ( + InactiveEmployeeStatusError, + get_holiday_list_for_employee, +) + class DuplicateDeclarationError(frappe.ValidationError): pass @@ -385,6 +401,7 @@ def create_additional_leave_ledger_entry(allocation, leaves, date): def check_effective_date(from_date, to_date, frequency, based_on_date_of_joining_date): import calendar + from dateutil import relativedelta from_date = get_datetime(from_date) diff --git a/erpnext/hr/web_form/job_application/job_application.py b/erpnext/hr/web_form/job_application/job_application.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/hr/web_form/job_application/job_application.py +++ b/erpnext/hr/web_form/job_application/job_application.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py index 85ffe29d1185..6ac3255c12a4 100644 --- a/erpnext/hub_node/__init__.py +++ b/erpnext/hub_node/__init__.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe + @frappe.whitelist() def enable_hub(): hub_settings = frappe.get_doc('Marketplace Settings') diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py index 42f90006f4df..553049177599 100644 --- a/erpnext/hub_node/api.py +++ b/erpnext/hub_node/api.py @@ -1,11 +1,11 @@ from __future__ import unicode_literals -import frappe import json +import frappe from frappe import _ -from frappe.frappeclient import FrappeClient from frappe.desk.form.load import get_attachments +from frappe.frappeclient import FrappeClient from six import string_types current_user = frappe.session.user diff --git a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py index be2cd6b3ee9b..2ab86b22ad5c 100644 --- a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py +++ b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HubTrackedItem(Document): pass diff --git a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py index 92b294064fb0..c598abb0a6eb 100644 --- a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py +++ b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestHubTrackedItem(unittest.TestCase): pass diff --git a/erpnext/hub_node/doctype/hub_user/hub_user.py b/erpnext/hub_node/doctype/hub_user/hub_user.py index de43f4e0c042..713e3bede434 100644 --- a/erpnext/hub_node/doctype/hub_user/hub_user.py +++ b/erpnext/hub_node/doctype/hub_user/hub_user.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HubUser(Document): pass diff --git a/erpnext/hub_node/doctype/hub_users/hub_users.py b/erpnext/hub_node/doctype/hub_users/hub_users.py index 440be14c0bfc..60a4d10edf1d 100644 --- a/erpnext/hub_node/doctype/hub_users/hub_users.py +++ b/erpnext/hub_node/doctype/hub_users/hub_users.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HubUsers(Document): pass diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index 91c7bf5850a9..e13bf00bfc22 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -2,15 +2,21 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, requests, json, time -from frappe.model.document import Document -from frappe.utils import add_years, now, get_datetime, get_datetime_str, cint +import json +import time + +import frappe +import requests from frappe import _ from frappe.frappeclient import FrappeClient -from erpnext.utilities.product import get_price, get_qty_in_stock +from frappe.model.document import Document +from frappe.utils import add_years, cint, get_datetime, get_datetime_str, now from six import string_types +from erpnext.utilities.product import get_price, get_qty_in_stock + + class MarketplaceSettings(Document): def register_seller(self, company, company_description): diff --git a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py index 549b9914c341..1f01f3348fd3 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestMarketplaceSettings(unittest.TestCase): pass diff --git a/erpnext/hub_node/legacy.py b/erpnext/hub_node/legacy.py index b61b88bf078d..2e4c26684365 100644 --- a/erpnext/hub_node/legacy.py +++ b/erpnext/hub_node/legacy.py @@ -1,9 +1,13 @@ from __future__ import unicode_literals -import frappe, json -from frappe.utils import nowdate + +import json + +import frappe +from frappe.contacts.doctype.contact.contact import get_default_contact from frappe.frappeclient import FrappeClient +from frappe.utils import nowdate from frappe.utils.nestedset import get_root_of -from frappe.contacts.doctype.contact.contact import get_default_contact + def get_list(doctype, start, limit, fields, filters, order_by): pass diff --git a/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py b/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py index 6ce2a54b1900..0911e8f49bb6 100644 --- a/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py +++ b/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py @@ -2,12 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils.dashboard import cache_source -from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure \ - import get_loan_security_details from six import iteritems +from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure import ( + get_loan_security_details, +) + + @frappe.whitelist() @cache_source def get_data(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None, diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py index ff7fbbdf49a8..10bc1e6eecbd 100644 --- a/erpnext/loan_management/doctype/loan/loan.py +++ b/erpnext/loan_management/doctype/loan/loan.py @@ -3,14 +3,22 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, math, json -import erpnext + +import json +import math + +import frappe from frappe import _ +from frappe.utils import add_months, flt, getdate, now_datetime, nowdate, rounded from six import string_types -from frappe.utils import flt, rounded, add_months, nowdate, getdate, now_datetime -from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import get_pledged_security_qty + +import erpnext from erpnext.controllers.accounts_controller import AccountsController from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts +from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import ( + get_pledged_security_qty, +) + class Loan(AccountsController): def validate(self): @@ -361,7 +369,9 @@ def create_loan_security_unpledge(unpledge_map, loan, company, applicant_type, a return unpledge_request def validate_employee_currency_with_company_currency(applicant, company): - from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_employee_currency + from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import ( + get_employee_currency, + ) if not applicant: frappe.throw(_("Please select Applicant")) if not company: diff --git a/erpnext/loan_management/doctype/loan/loan_dashboard.py b/erpnext/loan_management/doctype/loan/loan_dashboard.py index 711a7829baf3..4fe45c9199e2 100644 --- a/erpnext/loan_management/doctype/loan/loan_dashboard.py +++ b/erpnext/loan_management/doctype/loan/loan_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'loan', diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py index 122d72360515..e6417d3e4720 100644 --- a/erpnext/loan_management/doctype/loan/test_loan.py +++ b/erpnext/loan_management/doctype/loan/test_loan.py @@ -3,23 +3,53 @@ # See license.txt from __future__ import unicode_literals +import unittest + import frappe +from frappe.utils import ( + add_days, + add_months, + add_to_date, + date_diff, + flt, + get_datetime, + get_first_day, + get_last_day, + getdate, + now_datetime, + nowdate, +) + import erpnext -import unittest -from frappe.utils import (nowdate, add_days, getdate, now_datetime, add_to_date, get_datetime, - add_months, get_first_day, get_last_day, flt, date_diff) -from erpnext.selling.doctype.customer.test_customer import get_customer_dict -from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import (process_loan_interest_accrual_for_demand_loans, - process_loan_interest_accrual_for_term_loans) -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year -from erpnext.loan_management.doctype.process_loan_security_shortfall.process_loan_security_shortfall import create_process_loan_security_shortfall -from erpnext.loan_management.doctype.loan.loan import unpledge_security, request_loan_closure, make_loan_write_off -from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import get_pledged_security_qty +from erpnext.loan_management.doctype.loan.loan import ( + make_loan_write_off, + request_loan_closure, + unpledge_security, +) from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge -from erpnext.loan_management.doctype.loan_disbursement.loan_disbursement import get_disbursal_amount +from erpnext.loan_management.doctype.loan_disbursement.loan_disbursement import ( + get_disbursal_amount, +) +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + days_in_year, +) from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts -from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure +from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import ( + get_pledged_security_qty, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_demand_loans, + process_loan_interest_accrual_for_term_loans, +) +from erpnext.loan_management.doctype.process_loan_security_shortfall.process_loan_security_shortfall import ( + create_process_loan_security_shortfall, +) +from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + make_employee, + make_salary_structure, +) +from erpnext.selling.doctype.customer.test_customer import get_customer_dict + class TestLoan(unittest.TestCase): def setUp(self): diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py index d8f3577b2c3b..e492920abb31 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application.py @@ -3,17 +3,28 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, math + +import json +import math + +import frappe from frappe import _ -from frappe.utils import flt, rounded, cint -from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document -from erpnext.loan_management.doctype.loan.loan import (get_monthly_repayment_amount, validate_repayment_method, - get_total_loan_amount, get_sanctioned_amount_limit) -from erpnext.loan_management.doctype.loan_security_price.loan_security_price import get_loan_security_price -import json +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, flt, rounded from six import string_types +from erpnext.loan_management.doctype.loan.loan import ( + get_monthly_repayment_amount, + get_sanctioned_amount_limit, + get_total_loan_amount, + validate_repayment_method, +) +from erpnext.loan_management.doctype.loan_security_price.loan_security_price import ( + get_loan_security_price, +) + + class LoanApplication(Document): def validate(self): self.set_pledge_amount() diff --git a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py index 3975adf44317..a30b35cc86c7 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'loan_application', diff --git a/erpnext/loan_management/doctype/loan_application/test_loan_application.py b/erpnext/loan_management/doctype/loan_application/test_loan_application.py index 2a659e9fc2ea..aefa08970a46 100644 --- a/erpnext/loan_management/doctype/loan_application/test_loan_application.py +++ b/erpnext/loan_management/doctype/loan_application/test_loan_application.py @@ -3,10 +3,16 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee, make_salary_structure -from erpnext.loan_management.doctype.loan.test_loan import create_loan_type, create_loan_accounts + +import frappe + +from erpnext.loan_management.doctype.loan.test_loan import create_loan_accounts, create_loan_type +from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + make_employee, + make_salary_structure, +) + class TestLoanApplication(unittest.TestCase): def setUp(self): diff --git a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py index f113c10ef71e..bbc46cce8a1d 100644 --- a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py +++ b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py @@ -3,15 +3,22 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import nowdate, getdate, add_days, flt -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import add_days, flt, get_datetime, getdate, nowdate + +import erpnext from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans -from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import get_pledged_security_qty -from frappe.utils import get_datetime +from erpnext.controllers.accounts_controller import AccountsController +from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import ( + get_pledged_security_qty, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_demand_loans, +) + class LoanDisbursement(AccountsController): diff --git a/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py b/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py index da56710c679d..b17c9a177e0c 100644 --- a/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py +++ b/erpnext/loan_management/doctype/loan_disbursement/test_loan_disbursement.py @@ -2,16 +2,44 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe + import unittest -from frappe.utils import (nowdate, add_days, get_datetime, get_first_day, get_last_day, date_diff, flt, add_to_date) -from erpnext.loan_management.doctype.loan.test_loan import (create_loan_type, create_loan_security_pledge, create_repayment_entry, create_loan_application, - make_loan_disbursement_entry, create_loan_accounts, create_loan_security_type, create_loan_security, create_demand_loan, create_loan_security_price) -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year, get_per_day_interest -from erpnext.selling.doctype.customer.test_customer import get_customer_dict + +import frappe +from frappe.utils import ( + add_days, + add_to_date, + date_diff, + flt, + get_datetime, + get_first_day, + get_last_day, + nowdate, +) + +from erpnext.loan_management.doctype.loan.test_loan import ( + create_demand_loan, + create_loan_accounts, + create_loan_application, + create_loan_security, + create_loan_security_pledge, + create_loan_security_price, + create_loan_security_type, + create_loan_type, + create_repayment_entry, + make_loan_disbursement_entry, +) from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + days_in_year, + get_per_day_interest, +) from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_demand_loans, +) +from erpnext.selling.doctype.customer.test_customer import get_customer_dict + class TestLoanDisbursement(unittest.TestCase): diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index b5b30486de45..c111c19920af 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -3,13 +3,27 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import (nowdate, getdate, now_datetime, get_datetime, flt, date_diff, get_last_day, cint, - get_first_day, add_days) -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import ( + add_days, + cint, + date_diff, + flt, + get_datetime, + get_first_day, + get_last_day, + getdate, + now_datetime, + nowdate, +) + +import erpnext from erpnext.accounts.general_ledger import make_gl_entries +from erpnext.controllers.accounts_controller import AccountsController + class LoanInterestAccrual(AccountsController): def validate(self): diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index eb626f3eee0d..a97bed4cef15 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -2,15 +2,40 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe + import unittest -from frappe.utils import (nowdate, add_days, get_datetime, get_first_day, get_last_day, date_diff, flt, add_to_date) -from erpnext.loan_management.doctype.loan.test_loan import (create_loan_type, create_loan_security_price, - make_loan_disbursement_entry, create_loan_accounts, create_loan_security_type, create_loan_security, create_demand_loan, create_loan_application) -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year -from erpnext.selling.doctype.customer.test_customer import get_customer_dict + +import frappe +from frappe.utils import ( + add_days, + add_to_date, + date_diff, + flt, + get_datetime, + get_first_day, + get_last_day, + nowdate, +) + +from erpnext.loan_management.doctype.loan.test_loan import ( + create_demand_loan, + create_loan_accounts, + create_loan_application, + create_loan_security, + create_loan_security_price, + create_loan_security_type, + create_loan_type, + make_loan_disbursement_entry, +) from erpnext.loan_management.doctype.loan_application.loan_application import create_pledge +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + days_in_year, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_demand_loans, +) +from erpnext.selling.doctype.customer.test_customer import get_customer_dict + class TestLoanInterestAccrual(unittest.TestCase): def setUp(self): diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index 6c74a9bf5ab5..6875c922951e 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -3,17 +3,38 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + import json + +import frappe from frappe import _ -from six import iteritems from frappe.model.document import Document -from frappe.utils import flt, cint, date_diff, add_days, getdate, add_months, get_first_day, get_datetime -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import ( + add_days, + add_months, + cint, + date_diff, + flt, + get_datetime, + get_first_day, + getdate, +) +from six import iteritems + +import erpnext from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import update_shortfall_status -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_demand_loans -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import get_per_day_interest, get_last_accrual_date +from erpnext.controllers.accounts_controller import AccountsController +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + get_last_accrual_date, + get_per_day_interest, +) +from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import ( + update_shortfall_status, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_demand_loans, +) + class LoanRepayment(AccountsController): diff --git a/erpnext/loan_management/doctype/loan_repayment/test_loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/test_loan_repayment.py index 73585a515927..c6ca630e599e 100644 --- a/erpnext/loan_management/doctype/loan_repayment/test_loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/test_loan_repayment.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanRepayment(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_repayment_detail/loan_repayment_detail.py b/erpnext/loan_management/doctype/loan_repayment_detail/loan_repayment_detail.py index a83b9b59415d..495466c382e6 100644 --- a/erpnext/loan_management/doctype/loan_repayment_detail/loan_repayment_detail.py +++ b/erpnext/loan_management/doctype/loan_repayment_detail/loan_repayment_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class LoanRepaymentDetail(Document): pass diff --git a/erpnext/loan_management/doctype/loan_security/loan_security.py b/erpnext/loan_management/doctype/loan_security/loan_security.py index 8858c8183627..91cce67852ac 100644 --- a/erpnext/loan_management/doctype/loan_security/loan_security.py +++ b/erpnext/loan_management/doctype/loan_security/loan_security.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class LoanSecurity(Document): def autoname(self): self.name = self.loan_security_name diff --git a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py index 3eec5660ac11..af70b253fda1 100644 --- a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'loan_security', diff --git a/erpnext/loan_management/doctype/loan_security/test_loan_security.py b/erpnext/loan_management/doctype/loan_security/test_loan_security.py index 24dbc6804611..910b658a93c6 100644 --- a/erpnext/loan_management/doctype/loan_security/test_loan_security.py +++ b/erpnext/loan_management/doctype/loan_security/test_loan_security.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurity(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.py b/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.py index c390b6c526d9..eb6c79ec4fcb 100644 --- a/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.py +++ b/erpnext/loan_management/doctype/loan_security_pledge/loan_security_pledge.py @@ -3,12 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import now_datetime, cint from frappe.model.document import Document -from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import update_shortfall_status -from erpnext.loan_management.doctype.loan_security_price.loan_security_price import get_loan_security_price +from frappe.utils import cint, now_datetime + +from erpnext.loan_management.doctype.loan_security_price.loan_security_price import ( + get_loan_security_price, +) +from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import ( + update_shortfall_status, +) + class LoanSecurityPledge(Document): def validate(self): diff --git a/erpnext/loan_management/doctype/loan_security_pledge/test_loan_security_pledge.py b/erpnext/loan_management/doctype/loan_security_pledge/test_loan_security_pledge.py index d2347c00985c..41bc78ede484 100644 --- a/erpnext/loan_management/doctype/loan_security_pledge/test_loan_security_pledge.py +++ b/erpnext/loan_management/doctype/loan_security_pledge/test_loan_security_pledge.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurityPledge(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py index 9fc1fda53f41..0bc16bdaa4bb 100644 --- a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py +++ b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py @@ -3,12 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import getdate, now_datetime, add_to_date, get_datetime, get_timestamp, get_datetime_str +from frappe.utils import ( + add_to_date, + get_datetime, + get_datetime_str, + get_timestamp, + getdate, + now_datetime, +) from six import iteritems + class LoanSecurityPrice(Document): def validate(self): self.validate_dates() diff --git a/erpnext/loan_management/doctype/loan_security_price/test_loan_security_price.py b/erpnext/loan_management/doctype/loan_security_price/test_loan_security_price.py index 2fe0bd5a24e9..ac630868427c 100644 --- a/erpnext/loan_management/doctype/loan_security_price/test_loan_security_price.py +++ b/erpnext/loan_management/doctype/loan_security_price/test_loan_security_price.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurityPrice(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py index 61f177804813..bd4ebc720c9b 100644 --- a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py @@ -3,11 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import get_datetime, flt from frappe.model.document import Document +from frappe.utils import flt, get_datetime from six import iteritems -from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import get_pledged_security_qty + +from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import ( + get_pledged_security_qty, +) + class LoanSecurityShortfall(Document): pass diff --git a/erpnext/loan_management/doctype/loan_security_shortfall/test_loan_security_shortfall.py b/erpnext/loan_management/doctype/loan_security_shortfall/test_loan_security_shortfall.py index b82f3d25936f..fefec43bf410 100644 --- a/erpnext/loan_management/doctype/loan_security_shortfall/test_loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/loan_security_shortfall/test_loan_security_shortfall.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurityShortfall(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_security_type/loan_security_type.py b/erpnext/loan_management/doctype/loan_security_type/loan_security_type.py index cb8a50a27ba8..ca1957fb3aaa 100644 --- a/erpnext/loan_management/doctype/loan_security_type/loan_security_type.py +++ b/erpnext/loan_management/doctype/loan_security_type/loan_security_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class LoanSecurityType(Document): pass diff --git a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py index 17de8c1da4d3..466b2fdcd364 100644 --- a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'loan_security_type', diff --git a/erpnext/loan_management/doctype/loan_security_type/test_loan_security_type.py b/erpnext/loan_management/doctype/loan_security_type/test_loan_security_type.py index f7d845a779c9..99d7aafb3438 100644 --- a/erpnext/loan_management/doctype/loan_security_type/test_loan_security_type.py +++ b/erpnext/loan_management/doctype/loan_security_type/test_loan_security_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurityType(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py index 4f936dd7c117..9e8aee4580a4 100644 --- a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py +++ b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json + import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import get_datetime, flt, getdate -import json +from frappe.utils import flt, get_datetime, getdate from six import iteritems -from erpnext.loan_management.doctype.loan_security_price.loan_security_price import get_loan_security_price + +from erpnext.loan_management.doctype.loan_security_price.loan_security_price import ( + get_loan_security_price, +) + class LoanSecurityUnpledge(Document): def validate(self): @@ -30,7 +36,9 @@ def validate_duplicate_securities(self): d.idx, frappe.bold(d.loan_security))) def validate_unpledge_qty(self): - from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import get_ltv_ratio + from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import ( + get_ltv_ratio, + ) pledge_qty_map = get_pledged_security_qty(self.loan) diff --git a/erpnext/loan_management/doctype/loan_security_unpledge/test_loan_security_unpledge.py b/erpnext/loan_management/doctype/loan_security_unpledge/test_loan_security_unpledge.py index 5b5c205bda05..17eb7c63c7a7 100644 --- a/erpnext/loan_management/doctype/loan_security_unpledge/test_loan_security_unpledge.py +++ b/erpnext/loan_management/doctype/loan_security_unpledge/test_loan_security_unpledge.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanSecurityUnpledge(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_type/loan_type.py b/erpnext/loan_management/doctype/loan_type/loan_type.py index 50ef930dbbe6..5458d358f3b2 100644 --- a/erpnext/loan_management/doctype/loan_type/loan_type.py +++ b/erpnext/loan_management/doctype/loan_type/loan_type.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class LoanType(Document): def validate(self): self.validate_accounts() diff --git a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py index 95d97fdf9b03..c4c453a6a7e0 100644 --- a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'loan_type', diff --git a/erpnext/loan_management/doctype/loan_type/test_loan_type.py b/erpnext/loan_management/doctype/loan_type/test_loan_type.py index 5877ab6f7f09..9e57fdef2fa5 100644 --- a/erpnext/loan_management/doctype/loan_type/test_loan_type.py +++ b/erpnext/loan_management/doctype/loan_type/test_loan_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanType(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py b/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py index 676df701cc3f..4d5e7df4de10 100644 --- a/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py +++ b/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import getdate, flt, cint -from erpnext.controllers.accounts_controller import AccountsController +from frappe.utils import cint, flt, getdate + +import erpnext from erpnext.accounts.general_ledger import make_gl_entries +from erpnext.controllers.accounts_controller import AccountsController + class LoanWriteOff(AccountsController): def validate(self): diff --git a/erpnext/loan_management/doctype/loan_write_off/test_loan_write_off.py b/erpnext/loan_management/doctype/loan_write_off/test_loan_write_off.py index 9f6700e27496..57337c7e5d25 100644 --- a/erpnext/loan_management/doctype/loan_write_off/test_loan_write_off.py +++ b/erpnext/loan_management/doctype/loan_write_off/test_loan_write_off.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLoanWriteOff(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/pledge/pledge.py b/erpnext/loan_management/doctype/pledge/pledge.py index 0457ad7abdba..5a41cde4b584 100644 --- a/erpnext/loan_management/doctype/pledge/pledge.py +++ b/erpnext/loan_management/doctype/pledge/pledge.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class Pledge(Document): pass diff --git a/erpnext/loan_management/doctype/pledge/test_pledge.py b/erpnext/loan_management/doctype/pledge/test_pledge.py index 2e01dc114d70..adcbc6eae03d 100644 --- a/erpnext/loan_management/doctype/pledge/test_pledge.py +++ b/erpnext/loan_management/doctype/pledge/test_pledge.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestPledge(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py index 8c67c0affeec..efee701dc049 100644 --- a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.py @@ -3,11 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import nowdate from frappe.model.document import Document -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import (make_accrual_interest_entry_for_demand_loans, - make_accrual_interest_entry_for_term_loans) +from frappe.utils import nowdate + +from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( + make_accrual_interest_entry_for_demand_loans, + make_accrual_interest_entry_for_term_loans, +) + class ProcessLoanInterestAccrual(Document): def on_submit(self): diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py index e104c6646b07..642668ce400e 100644 --- a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'process_loan_interest_accrual', diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/test_process_loan_interest_accrual.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/test_process_loan_interest_accrual.py index 6bfd3f421034..e7d360209cab 100644 --- a/erpnext/loan_management/doctype/process_loan_interest_accrual/test_process_loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/test_process_loan_interest_accrual.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestProcessLoanInterestAccrual(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py index b4aad25ac80f..5a171a15745a 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py @@ -3,11 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import get_datetime from frappe import _ from frappe.model.document import Document -from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import check_for_ltv_shortfall +from frappe.utils import get_datetime + +from erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import ( + check_for_ltv_shortfall, +) + class ProcessLoanSecurityShortfall(Document): def onload(self): diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py index e67e4d4738f1..b88b4ee1189b 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'process_loan_security_shortfall', diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/test_process_loan_security_shortfall.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/test_process_loan_security_shortfall.py index cd379a1bea20..50e0a46ee4f6 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/test_process_loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/test_process_loan_security_shortfall.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestProcessLoanSecurityShortfall(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/proposed_pledge/proposed_pledge.py b/erpnext/loan_management/doctype/proposed_pledge/proposed_pledge.py index dfa5c7965a02..5c125e1307ef 100644 --- a/erpnext/loan_management/doctype/proposed_pledge/proposed_pledge.py +++ b/erpnext/loan_management/doctype/proposed_pledge/proposed_pledge.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProposedPledge(Document): pass diff --git a/erpnext/loan_management/doctype/repayment_schedule/repayment_schedule.py b/erpnext/loan_management/doctype/repayment_schedule/repayment_schedule.py index 2aa27b09687d..af9c6696acab 100644 --- a/erpnext/loan_management/doctype/repayment_schedule/repayment_schedule.py +++ b/erpnext/loan_management/doctype/repayment_schedule/repayment_schedule.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class RepaymentSchedule(Document): pass diff --git a/erpnext/loan_management/doctype/salary_slip_loan/salary_slip_loan.py b/erpnext/loan_management/doctype/salary_slip_loan/salary_slip_loan.py index 9ee0b96dc1d3..64be1b2673e0 100644 --- a/erpnext/loan_management/doctype/salary_slip_loan/salary_slip_loan.py +++ b/erpnext/loan_management/doctype/salary_slip_loan/salary_slip_loan.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class SalarySlipLoan(Document): pass diff --git a/erpnext/loan_management/doctype/sanctioned_loan_amount/sanctioned_loan_amount.py b/erpnext/loan_management/doctype/sanctioned_loan_amount/sanctioned_loan_amount.py index 7ed838d4e133..5660c4210226 100644 --- a/erpnext/loan_management/doctype/sanctioned_loan_amount/sanctioned_loan_amount.py +++ b/erpnext/loan_management/doctype/sanctioned_loan_amount/sanctioned_loan_amount.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class SanctionedLoanAmount(Document): def validate(self): sanctioned_doc = frappe.db.exists('Sanctioned Loan Amount', {'applicant': self.applicant, 'company': self.company}) diff --git a/erpnext/loan_management/doctype/sanctioned_loan_amount/test_sanctioned_loan_amount.py b/erpnext/loan_management/doctype/sanctioned_loan_amount/test_sanctioned_loan_amount.py index ba1372f175d3..663f2e72bebe 100644 --- a/erpnext/loan_management/doctype/sanctioned_loan_amount/test_sanctioned_loan_amount.py +++ b/erpnext/loan_management/doctype/sanctioned_loan_amount/test_sanctioned_loan_amount.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestSanctionedLoanAmount(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/unpledge/unpledge.py b/erpnext/loan_management/doctype/unpledge/unpledge.py index 205230a308f6..2e82e2399793 100644 --- a/erpnext/loan_management/doctype/unpledge/unpledge.py +++ b/erpnext/loan_management/doctype/unpledge/unpledge.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class Unpledge(Document): pass diff --git a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py index f2cbbb469f08..c29fed9a7439 100644 --- a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py +++ b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _ -from frappe.utils import get_datetime, flt +from frappe.utils import flt, get_datetime from six import iteritems +import erpnext + + def execute(filters=None): columns = get_columns(filters) data = get_data(filters) diff --git a/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py b/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py index a505e72c4d9c..c4adef1c7ba7 100644 --- a/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py +++ b/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _ -from frappe.utils import flt, getdate, add_days -from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure \ - import get_loan_security_details +from frappe.utils import add_days, flt, getdate + +import erpnext +from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure import ( + get_loan_security_details, +) def execute(filters=None): diff --git a/erpnext/loan_management/report/loan_repayment_and_closure/loan_repayment_and_closure.py b/erpnext/loan_management/report/loan_repayment_and_closure/loan_repayment_and_closure.py index 659107708812..9d8a425b30cc 100644 --- a/erpnext/loan_management/report/loan_repayment_and_closure/loan_repayment_and_closure.py +++ b/erpnext/loan_management/report/loan_repayment_and_closure/loan_repayment_and_closure.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns() data = get_data(filters) diff --git a/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py b/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py index 34bbe5a45034..3d6242a4fa10 100644 --- a/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py +++ b/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py @@ -2,12 +2,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import erpnext + from frappe import _ from frappe.utils import flt from six import iteritems -from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure \ - import get_loan_security_details, get_applicant_wise_total_loan_security_qty + +import erpnext +from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure import ( + get_applicant_wise_total_loan_security_qty, + get_loan_security_details, +) + def execute(filters=None): columns = get_columns(filters) diff --git a/erpnext/loan_management/report/loan_security_status/loan_security_status.py b/erpnext/loan_management/report/loan_security_status/loan_security_status.py index 195185547597..a93a381eb3f0 100644 --- a/erpnext/loan_management/report/loan_security_status/loan_security_status.py +++ b/erpnext/loan_management/report/loan_security_status/loan_security_status.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns(filters) data = get_data(filters) diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py index 97289032d70f..52e41c5863eb 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py @@ -2,15 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import add_days, getdate, cint, cstr, date_diff, formatdate +import frappe +from frappe import _, throw +from frappe.utils import add_days, cint, cstr, date_diff, formatdate, getdate -from frappe import throw, _ -from erpnext.utilities.transaction_base import TransactionBase, delete_events -from erpnext.stock.utils import get_valid_serial_nos from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.utils import get_valid_serial_nos +from erpnext.utilities.transaction_base import TransactionBase, delete_events + class MaintenanceSchedule(TransactionBase): @frappe.whitelist() diff --git a/erpnext/maintenance/doctype/maintenance_schedule/test_maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/test_maintenance_schedule.py index c733dd0c92c6..38654de6638a 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule/test_maintenance_schedule.py +++ b/erpnext/maintenance/doctype/maintenance_schedule/test_maintenance_schedule.py @@ -2,12 +2,16 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -from frappe.utils.data import add_days, today, formatdate -from erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule import make_maintenance_visit -import frappe import unittest +import frappe +from frappe.utils.data import add_days, formatdate, today + +from erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule import ( + make_maintenance_visit, +) + # test_records = frappe.get_test_records('Maintenance Schedule') class TestMaintenanceSchedule(unittest.TestCase): diff --git a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py index e69b4fb65e02..bd56685380c2 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py +++ b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MaintenanceScheduleDetail(Document): pass diff --git a/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py b/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py index 1dd47fea24ff..18240c61b2a2 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py +++ b/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MaintenanceScheduleItem(Document): pass diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py index d63c7003870b..814ec0cae4b0 100644 --- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py @@ -2,12 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import get_datetime from erpnext.utilities.transaction_base import TransactionBase + class MaintenanceVisit(TransactionBase): def get_feed(self): return _("To {0}").format(self.customer_name) diff --git a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py index 2bea8d1e2f66..a25c5683e085 100644 --- a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py +++ b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Maintenance Visit') class TestMaintenanceVisit(unittest.TestCase): diff --git a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py index a7f0f5b3bb95..2e7bed443db9 100644 --- a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py +++ b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class MaintenanceVisitPurpose(Document): pass diff --git a/erpnext/manufacturing/dashboard_fixtures.py b/erpnext/manufacturing/dashboard_fixtures.py index 7ba43d6471e3..33466f2b44ba 100644 --- a/erpnext/manufacturing/dashboard_fixtures.py +++ b/erpnext/manufacturing/dashboard_fixtures.py @@ -1,9 +1,14 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import frappe, erpnext, json +import json + +import frappe from frappe import _ -from frappe.utils import nowdate, get_first_day, get_last_day, add_months +from frappe.utils import add_months, get_first_day, get_last_day, nowdate + +import erpnext + def get_data(): return frappe._dict({ diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order.py index 1aedb1e590f0..59eb168d4e48 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order.py +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, getdate from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc +from frappe.utils import flt, getdate + from erpnext.stock.doctype.item.item import get_item_defaults diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py index d9aa0ca49d0e..ba384d8346b8 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'blanket_order', diff --git a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py index 9a0a72fb475c..3104ae01177d 100644 --- a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py +++ b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py @@ -3,12 +3,16 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import add_months, today + from erpnext import get_company_currency + from .blanket_order import make_order + class TestBlanketOrder(unittest.TestCase): def setUp(self): frappe.flags.args = frappe._dict() diff --git a/erpnext/manufacturing/doctype/blanket_order_item/blanket_order_item.py b/erpnext/manufacturing/doctype/blanket_order_item/blanket_order_item.py index f07f3c8e046d..0825f763dcfb 100644 --- a/erpnext/manufacturing/doctype/blanket_order_item/blanket_order_item.py +++ b/erpnext/manufacturing/doctype/blanket_order_item/blanket_order_item.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class BlanketOrderItem(Document): pass diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 47d94fbce31a..3846e2f7879e 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -1,23 +1,23 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -from typing import List +import functools from collections import deque -import frappe, erpnext -from frappe.utils import cint, cstr, flt, today +from operator import itemgetter +from typing import List + +import frappe from frappe import _ -from erpnext.setup.utils import get_exchange_rate -from frappe.website.website_generator import WebsiteGenerator -from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.stock.get_item_details import get_price_list_rate from frappe.core.doctype.version.version import get_diff -from erpnext.controllers.queries import get_match_cond -from erpnext.stock.doctype.item.item import get_item_details from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, cstr, flt, today +from frappe.website.website_generator import WebsiteGenerator -import functools - -from operator import itemgetter +import erpnext +from erpnext.controllers.queries import get_match_cond +from erpnext.setup.utils import get_exchange_rate +from erpnext.stock.doctype.item.item import get_item_details +from erpnext.stock.get_item_details import get_conversion_factor, get_price_list_rate form_grid_templates = { "items": "templates/form_grid/item_grid.html" diff --git a/erpnext/manufacturing/doctype/bom/bom_dashboard.py b/erpnext/manufacturing/doctype/bom/bom_dashboard.py index 361826e2d0cd..f65df011a93a 100644 --- a/erpnext/manufacturing/doctype/bom/bom_dashboard.py +++ b/erpnext/manufacturing/doctype/bom/bom_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'bom_no', diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py index a904d7f7be0c..6484b7f699d2 100644 --- a/erpnext/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -2,15 +2,19 @@ # License: GNU General Public License v3. See license.txt -from collections import deque import unittest +from collections import deque + import frappe -from frappe.utils import cstr, flt from frappe.test_runner import make_test_records -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation +from frappe.utils import cstr, flt + +from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order from erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool import update_cost from erpnext.stock.doctype.item.test_item import make_item -from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, +) from erpnext.tests.test_subcontracting import set_backflush_based_on test_records = frappe.get_test_records('BOM') diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py index 39ccbddbea2d..499674cfd756 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class BOMExplosionItem(Document): pass diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py index 220c73e1493c..3c612fcec42f 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.py +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class BOMItem(Document): pass diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py index e3501eb9cf6c..3da26189c3f8 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class BOMOperation(Document): pass diff --git a/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py b/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py index b6d423f09f21..7637cc79a84c 100644 --- a/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py +++ b/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class BOMScrapItem(Document): pass diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py index 8fbcd4ea1dbb..ed71c6d6d7be 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py @@ -3,13 +3,18 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json -from frappe.utils import cstr, flt + +import json + +import click +import frappe from frappe import _ +from frappe.model.document import Document +from frappe.utils import cstr, flt from six import string_types + from erpnext.manufacturing.doctype.bom.bom import get_boms_in_bottom_up_order -from frappe.model.document import Document -import click + class BOMUpdateTool(Document): def replace_bom(self): diff --git a/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py index 80d1cdfc8f24..88c69ce2a5e0 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py @@ -3,11 +3,14 @@ from __future__ import unicode_literals + import unittest + import frappe -from erpnext.stock.doctype.item.test_item import create_item -from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom + from erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool import update_cost +from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom +from erpnext.stock.doctype.item.test_item import create_item test_records = frappe.get_test_records('BOM') diff --git a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py index 4088a7fc5408..cc6706dbaaa9 100644 --- a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py +++ b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class BOMWebsiteItem(Document): pass diff --git a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py index bcc5ddab0899..551b0e0ff92d 100644 --- a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py +++ b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class BOMWebsiteOperation(Document): pass diff --git a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py index 56ec4356af44..b87298abdade 100644 --- a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py +++ b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import time_diff_in_hours from frappe.model.document import Document +from frappe.utils import time_diff_in_hours + class DowntimeEntry(Document): def validate(self): diff --git a/erpnext/manufacturing/doctype/downtime_entry/test_downtime_entry.py b/erpnext/manufacturing/doctype/downtime_entry/test_downtime_entry.py index 8b2a8d36c125..37169f4439af 100644 --- a/erpnext/manufacturing/doctype/downtime_entry/test_downtime_entry.py +++ b/erpnext/manufacturing/doctype/downtime_entry/test_downtime_entry.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestDowntimeEntry(unittest.TestCase): pass diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 3efbe88adafa..c4cbe5e74cca 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -3,16 +3,33 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import datetime import json + +import frappe from frappe import _, bold -from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document -from frappe.utils import (flt, cint, time_diff_in_hours, get_datetime, getdate, - get_time, add_to_date, time_diff, add_days, get_datetime_str, get_link_to_form, time_diff_in_seconds) +from frappe.model.mapper import get_mapped_doc +from frappe.utils import ( + add_days, + add_to_date, + cint, + flt, + get_datetime, + get_datetime_str, + get_link_to_form, + get_time, + getdate, + time_diff, + time_diff_in_hours, + time_diff_in_seconds, +) + +from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( + get_mins_between_operations, +) -from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import get_mins_between_operations class OverlapError(frappe.ValidationError): pass diff --git a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py index c2aa2bd968a4..3ec6697b9f46 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py +++ b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'job_card', diff --git a/erpnext/manufacturing/doctype/job_card/test_job_card.py b/erpnext/manufacturing/doctype/job_card/test_job_card.py index 8fa0b27fcb82..db0e08fcd0a8 100644 --- a/erpnext/manufacturing/doctype/job_card/test_job_card.py +++ b/erpnext/manufacturing/doctype/job_card/test_job_card.py @@ -4,11 +4,14 @@ from __future__ import unicode_literals import unittest + import frappe from frappe.utils import random_string -from erpnext.manufacturing.doctype.workstation.test_workstation import make_workstation -from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record + from erpnext.manufacturing.doctype.job_card.job_card import OperationMismatchError +from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record +from erpnext.manufacturing.doctype.workstation.test_workstation import make_workstation + class TestJobCard(unittest.TestCase): def test_job_card(self): diff --git a/erpnext/manufacturing/doctype/job_card_item/job_card_item.py b/erpnext/manufacturing/doctype/job_card_item/job_card_item.py index 373cba293e35..a1338364aa45 100644 --- a/erpnext/manufacturing/doctype/job_card_item/job_card_item.py +++ b/erpnext/manufacturing/doctype/job_card_item/job_card_item.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class JobCardItem(Document): pass diff --git a/erpnext/manufacturing/doctype/job_card_operation/job_card_operation.py b/erpnext/manufacturing/doctype/job_card_operation/job_card_operation.py index 85d72982ed31..43d142206493 100644 --- a/erpnext/manufacturing/doctype/job_card_operation/job_card_operation.py +++ b/erpnext/manufacturing/doctype/job_card_operation/job_card_operation.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class JobCardOperation(Document): pass diff --git a/erpnext/manufacturing/doctype/job_card_time_log/job_card_time_log.py b/erpnext/manufacturing/doctype/job_card_time_log/job_card_time_log.py index 3dc668912166..ed27e7ff824e 100644 --- a/erpnext/manufacturing/doctype/job_card_time_log/job_card_time_log.py +++ b/erpnext/manufacturing/doctype/job_card_time_log/job_card_time_log.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class JobCardTimeLog(Document): pass diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py index 149fe3e22b82..18d78b59f53b 100644 --- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py +++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from dateutil.relativedelta import relativedelta from frappe.model.document import Document from frappe.utils import cint -from dateutil.relativedelta import relativedelta + class ManufacturingSettings(Document): pass diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/test_manufacturing_settings.py b/erpnext/manufacturing/doctype/manufacturing_settings/test_manufacturing_settings.py index 7391f65dec92..fd0ac7259140 100644 --- a/erpnext/manufacturing/doctype/manufacturing_settings/test_manufacturing_settings.py +++ b/erpnext/manufacturing/doctype/manufacturing_settings/test_manufacturing_settings.py @@ -5,5 +5,6 @@ import unittest + class TestManufacturingSettings(unittest.TestCase): pass diff --git a/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.py b/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.py index 73e369c149e2..bc26644067f4 100644 --- a/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.py +++ b/erpnext/manufacturing/doctype/material_request_plan_item/material_request_plan_item.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class MaterialRequestPlanItem(Document): pass diff --git a/erpnext/manufacturing/doctype/material_request_plan_item/test_material_request_plan_item.py b/erpnext/manufacturing/doctype/material_request_plan_item/test_material_request_plan_item.py index dc43b69ef24d..2675af94a725 100644 --- a/erpnext/manufacturing/doctype/material_request_plan_item/test_material_request_plan_item.py +++ b/erpnext/manufacturing/doctype/material_request_plan_item/test_material_request_plan_item.py @@ -5,5 +5,6 @@ import unittest + class TestMaterialRequestPlanItem(unittest.TestCase): pass diff --git a/erpnext/manufacturing/doctype/operation/operation.py b/erpnext/manufacturing/doctype/operation/operation.py index 374f32019bd3..2926f911ea16 100644 --- a/erpnext/manufacturing/doctype/operation/operation.py +++ b/erpnext/manufacturing/doctype/operation/operation.py @@ -7,6 +7,7 @@ from frappe import _ from frappe.model.document import Document + class Operation(Document): def validate(self): if not self.description: diff --git a/erpnext/manufacturing/doctype/operation/operation_dashboard.py b/erpnext/manufacturing/doctype/operation/operation_dashboard.py index 8deb9ec6e0bb..284fd9dfc2fa 100644 --- a/erpnext/manufacturing/doctype/operation/operation_dashboard.py +++ b/erpnext/manufacturing/doctype/operation/operation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'operation', diff --git a/erpnext/manufacturing/doctype/operation/test_operation.py b/erpnext/manufacturing/doctype/operation/test_operation.py index 8e7e72372637..2b24118fc413 100644 --- a/erpnext/manufacturing/doctype/operation/test_operation.py +++ b/erpnext/manufacturing/doctype/operation/test_operation.py @@ -2,9 +2,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = frappe.get_test_records('Operation') class TestOperation(unittest.TestCase): diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 2c77c9c23fe5..91e57489644b 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -3,18 +3,32 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json, copy -from frappe import msgprint, _ -from six import iteritems +import copy +import json + +import frappe +from frappe import _, msgprint from frappe.model.document import Document -from frappe.utils import (flt, cint, nowdate, add_days, comma_and, now_datetime, - ceil, get_link_to_form, getdate) +from frappe.utils import ( + add_days, + ceil, + cint, + comma_and, + flt, + get_link_to_form, + getdate, + now_datetime, + nowdate, +) from frappe.utils.csvutils import build_csv_response -from erpnext.manufacturing.doctype.bom.bom import validate_bom_no, get_children +from six import iteritems + +from erpnext.manufacturing.doctype.bom.bom import get_children, validate_bom_no from erpnext.manufacturing.doctype.work_order.work_order import get_item_details from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults + class ProductionPlan(Document): def validate(self): self.calculate_total_planned_qty() @@ -453,7 +467,10 @@ def prepare_args_for_sub_assembly_items(self, row, args): }) def create_work_order(self, item): - from erpnext.manufacturing.doctype.work_order.work_order import OverProductionError, get_default_warehouse + from erpnext.manufacturing.doctype.work_order.work_order import ( + OverProductionError, + get_default_warehouse, + ) warehouse = get_default_warehouse() wo = frappe.new_doc("Work Order") wo.update(item) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py index 52a56af7bce0..b4bc3467e462 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'production_plan', diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index 78028039c484..6a942d543354 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -3,15 +3,23 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import nowdate, now_datetime, flt, add_to_date -from erpnext.stock.doctype.item.test_item import create_item -from erpnext.manufacturing.doctype.production_plan.production_plan import get_sales_orders -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation -from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order -from erpnext.manufacturing.doctype.production_plan.production_plan import get_items_for_material_requests, get_warehouse_list + +import frappe +from frappe.utils import add_to_date, flt, now_datetime, nowdate + from erpnext.controllers.item_variant import create_variant +from erpnext.manufacturing.doctype.production_plan.production_plan import ( + get_items_for_material_requests, + get_sales_orders, + get_warehouse_list, +) +from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order +from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, +) + class TestProductionPlan(unittest.TestCase): def setUp(self): diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py index 37cf5a49dc98..6029fcfdc6cd 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ProductionPlanItem(Document): pass diff --git a/erpnext/manufacturing/doctype/production_plan_item_reference/production_plan_item_reference.py b/erpnext/manufacturing/doctype/production_plan_item_reference/production_plan_item_reference.py index 51fbc3633b15..9d25d6fc20f0 100644 --- a/erpnext/manufacturing/doctype/production_plan_item_reference/production_plan_item_reference.py +++ b/erpnext/manufacturing/doctype/production_plan_item_reference/production_plan_item_reference.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProductionPlanItemReference(Document): pass diff --git a/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py b/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py index 44786f8388d4..adcf4a94656c 100644 --- a/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py +++ b/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProductionPlanMaterialRequest(Document): pass diff --git a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.py b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.py index f605985ae96b..1548bd7b88ab 100644 --- a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.py +++ b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/production_plan_material_request_warehouse.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProductionPlanMaterialRequestWarehouse(Document): pass diff --git a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/test_production_plan_material_request_warehouse.py b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/test_production_plan_material_request_warehouse.py index ecab5fbae12e..905252da604c 100644 --- a/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/test_production_plan_material_request_warehouse.py +++ b/erpnext/manufacturing/doctype/production_plan_material_request_warehouse/test_production_plan_material_request_warehouse.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestProductionPlanMaterialRequestWarehouse(unittest.TestCase): pass diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py index 99c7273a6404..6ca19fa51bb7 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ProductionPlanSalesOrder(Document): pass diff --git a/erpnext/manufacturing/doctype/production_plan_sub_assembly_item/production_plan_sub_assembly_item.py b/erpnext/manufacturing/doctype/production_plan_sub_assembly_item/production_plan_sub_assembly_item.py index 6850a2eb4ed9..be0ed1b96a88 100644 --- a/erpnext/manufacturing/doctype/production_plan_sub_assembly_item/production_plan_sub_assembly_item.py +++ b/erpnext/manufacturing/doctype/production_plan_sub_assembly_item/production_plan_sub_assembly_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProductionPlanSubAssemblyItem(Document): pass diff --git a/erpnext/manufacturing/doctype/routing/routing.py b/erpnext/manufacturing/doctype/routing/routing.py index ece0db717a2a..20fb370d942f 100644 --- a/erpnext/manufacturing/doctype/routing/routing.py +++ b/erpnext/manufacturing/doctype/routing/routing.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint, flt from frappe import _ from frappe.model.document import Document +from frappe.utils import cint, flt + class Routing(Document): def validate(self): diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py index 50a3fe62da54..70ae5752a2ca 100644 --- a/erpnext/manufacturing/doctype/routing/routing_dashboard.py +++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'routing', diff --git a/erpnext/manufacturing/doctype/routing/test_routing.py b/erpnext/manufacturing/doctype/routing/test_routing.py index 92f26946ab71..b84b2ba1e6d9 100644 --- a/erpnext/manufacturing/doctype/routing/test_routing.py +++ b/erpnext/manufacturing/doctype/routing/test_routing.py @@ -4,11 +4,14 @@ from __future__ import unicode_literals import unittest + import frappe from frappe.test_runner import make_test_records -from erpnext.stock.doctype.item.test_item import make_item + from erpnext.manufacturing.doctype.job_card.job_card import OperationSequenceError from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record +from erpnext.stock.doctype.item.test_item import make_item + class TestRouting(unittest.TestCase): @classmethod @@ -91,8 +94,8 @@ def test_update_bom_operation_time(self): def setup_operations(rows): - from erpnext.manufacturing.doctype.workstation.test_workstation import make_workstation from erpnext.manufacturing.doctype.operation.test_operation import make_operation + from erpnext.manufacturing.doctype.workstation.test_workstation import make_workstation for row in rows: make_workstation(row) make_operation(row) diff --git a/erpnext/manufacturing/doctype/sub_operation/sub_operation.py b/erpnext/manufacturing/doctype/sub_operation/sub_operation.py index f4b27758e9de..37b64f23d297 100644 --- a/erpnext/manufacturing/doctype/sub_operation/sub_operation.py +++ b/erpnext/manufacturing/doctype/sub_operation/sub_operation.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class SubOperation(Document): pass diff --git a/erpnext/manufacturing/doctype/sub_operation/test_sub_operation.py b/erpnext/manufacturing/doctype/sub_operation/test_sub_operation.py index d3410ca3120c..c5749dbc962d 100644 --- a/erpnext/manufacturing/doctype/sub_operation/test_sub_operation.py +++ b/erpnext/manufacturing/doctype/sub_operation/test_sub_operation.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestSubOperation(unittest.TestCase): pass diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index c0ed6115340c..4564cf93104e 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -3,18 +3,28 @@ from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import flt, now, add_months, cint, today, add_to_date -from erpnext.manufacturing.doctype.work_order.work_order import (make_stock_entry, - ItemHasVariantError, stop_unstop, StockOverProductionError, OverProductionError, CapacityError) -from erpnext.stock.doctype.stock_entry import test_stock_entry -from erpnext.stock.utils import get_bin +from frappe.utils import add_months, add_to_date, cint, flt, now, today + +from erpnext.manufacturing.doctype.job_card.job_card import JobCardCancelError +from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom +from erpnext.manufacturing.doctype.work_order.work_order import ( + CapacityError, + ItemHasVariantError, + OverProductionError, + StockOverProductionError, + make_stock_entry, + stop_unstop, +) from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.stock.doctype.item.test_item import make_item -from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom +from erpnext.stock.doctype.stock_entry import test_stock_entry from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse -from erpnext.manufacturing.doctype.job_card.job_card import JobCardCancelError +from erpnext.stock.utils import get_bin + class TestWorkOrder(unittest.TestCase): def setUp(self): @@ -696,8 +706,10 @@ def test_valuation_rate_missing_on_make_stock_entry(self): self.assertRaises(frappe.ValidationError, make_stock_entry, wo.name, 'Material Transfer for Manufacture') def test_wo_completion_with_pl_bom(self): - from erpnext.manufacturing.doctype.bom.test_bom import create_process_loss_bom_items - from erpnext.manufacturing.doctype.bom.test_bom import create_bom_with_process_loss_item + from erpnext.manufacturing.doctype.bom.test_bom import ( + create_bom_with_process_loss_item, + create_process_loss_bom_items, + ) qty = 4 scrap_qty = 0.25 # bom item qty = 1, consider as 25% of FG diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index 24b33d523e4b..ffa97d2e081f 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -1,25 +1,47 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -import frappe import json import math + +import frappe +from dateutil.relativedelta import relativedelta from frappe import _ -from frappe.utils import flt, get_datetime, getdate, date_diff, cint, nowdate, get_link_to_form, time_diff_in_hours from frappe.model.document import Document -from erpnext.manufacturing.doctype.bom.bom import validate_bom_no, get_bom_items_as_dict, get_bom_item_rate -from dateutil.relativedelta import relativedelta -from erpnext.stock.doctype.item.item import validate_end_of_life, get_item_defaults +from frappe.model.mapper import get_mapped_doc +from frappe.utils import ( + cint, + date_diff, + flt, + get_datetime, + get_link_to_form, + getdate, + nowdate, + time_diff_in_hours, +) +from frappe.utils.csvutils import getlink + +from erpnext.manufacturing.doctype.bom.bom import ( + get_bom_item_rate, + get_bom_items_as_dict, + validate_bom_no, +) +from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( + get_mins_between_operations, +) from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError from erpnext.projects.doctype.timesheet.timesheet import OverlapError -from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import get_mins_between_operations +from erpnext.stock.doctype.batch.batch import make_batch +from erpnext.stock.doctype.item.item import get_item_defaults, validate_end_of_life +from erpnext.stock.doctype.serial_no.serial_no import ( + auto_make_serial_nos, + get_auto_serial_nos, + get_serial_nos, +) from erpnext.stock.stock_balance import get_planned_qty, update_bin_qty -from frappe.utils.csvutils import getlink -from erpnext.stock.utils import get_bin, validate_warehouse_company, get_latest_stock_qty +from erpnext.stock.utils import get_bin, get_latest_stock_qty, validate_warehouse_company from erpnext.utilities.transaction_base import validate_uom_is_integer -from frappe.model.mapper import get_mapped_doc -from erpnext.stock.doctype.batch.batch import make_batch -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos, get_auto_serial_nos, auto_make_serial_nos + class OverProductionError(frappe.ValidationError): pass class CapacityError(frappe.ValidationError): pass diff --git a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py index 403d46d8d42d..f0fc43f16560 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py +++ b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'work_order', diff --git a/erpnext/manufacturing/doctype/work_order_item/work_order_item.py b/erpnext/manufacturing/doctype/work_order_item/work_order_item.py index 9aa53b5e3c37..3f2664b16e91 100644 --- a/erpnext/manufacturing/doctype/work_order_item/work_order_item.py +++ b/erpnext/manufacturing/doctype/work_order_item/work_order_item.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WorkOrderItem(Document): pass diff --git a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py index 3c20d8e88a02..3773345b5ed6 100644 --- a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py +++ b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WorkOrderOperation(Document): pass diff --git a/erpnext/manufacturing/doctype/workstation/test_workstation.py b/erpnext/manufacturing/doctype/workstation/test_workstation.py index 9b73aca60101..6c6ab77dd8f9 100644 --- a/erpnext/manufacturing/doctype/workstation/test_workstation.py +++ b/erpnext/manufacturing/doctype/workstation/test_workstation.py @@ -1,14 +1,20 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt from __future__ import unicode_literals -from erpnext.manufacturing.doctype.operation.test_operation import make_operation -import frappe import unittest -from erpnext.manufacturing.doctype.workstation.workstation import check_if_within_operating_hours, NotInWorkingHoursError, WorkstationHolidayError -from erpnext.manufacturing.doctype.routing.test_routing import setup_bom, create_routing + +import frappe from frappe.test_runner import make_test_records +from erpnext.manufacturing.doctype.operation.test_operation import make_operation +from erpnext.manufacturing.doctype.routing.test_routing import create_routing, setup_bom +from erpnext.manufacturing.doctype.workstation.workstation import ( + NotInWorkingHoursError, + WorkstationHolidayError, + check_if_within_operating_hours, +) + test_dependencies = ["Warehouse"] test_records = frappe.get_test_records('Workstation') make_test_records('Workstation') diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index f4483f75472d..d8d6cbaef0f8 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -2,13 +2,24 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from dateutil.parser import parse from frappe import _ -from erpnext.support.doctype.issue.issue import get_holidays -from frappe.utils import (flt, cint, getdate, formatdate, - comma_and, time_diff_in_seconds, to_timedelta, add_days) from frappe.model.document import Document -from dateutil.parser import parse +from frappe.utils import ( + add_days, + cint, + comma_and, + flt, + formatdate, + getdate, + time_diff_in_seconds, + to_timedelta, +) + +from erpnext.support.doctype.issue.issue import get_holidays + class WorkstationHolidayError(frappe.ValidationError): pass class NotInWorkingHoursError(frappe.ValidationError): pass diff --git a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py index 3ddbe731700f..3e4b38aae855 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py +++ b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'workstation', diff --git a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py index 215df4c9b5d8..5d635dc6fd6b 100644 --- a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py +++ b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WorkstationWorkingHour(Document): pass diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py index 858b5546b020..069638a305dd 100644 --- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py +++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py @@ -2,9 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + from pprint import pprint +import frappe + + def execute(filters=None): data = [] columns = get_columns() diff --git a/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.py b/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.py index 8778d9ba557a..3c2d21536976 100644 --- a/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.py +++ b/erpnext/manufacturing/report/bom_operations_time/bom_operations_time.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): data = get_data(filters) columns = get_columns(filters) diff --git a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py index d7ebfd6b82bc..c085990acc34 100644 --- a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py +++ b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils.data import comma_and + def execute(filters=None): # if not filters: filters = {} columns = get_columns() diff --git a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py index ed8b93929a16..b8ef68dbb680 100644 --- a/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py +++ b/erpnext/manufacturing/report/bom_stock_report/bom_stock_report.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.py b/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.py index dc424b7605cd..bbf503718f9f 100644 --- a/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.py +++ b/erpnext/manufacturing/report/bom_variance_report/bom_variance_report.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns, data = [], [] columns = get_columns(filters) diff --git a/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.py b/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.py index b4db98c3d7e3..0dcad448d795 100644 --- a/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.py +++ b/erpnext/manufacturing/report/cost_of_poor_quality_report/cost_of_poor_quality_report.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.py b/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.py index 74c794b5dd06..a1c6fd12622e 100644 --- a/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.py +++ b/erpnext/manufacturing/report/downtime_analysis/downtime_analysis.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt from frappe import _ +from frappe.utils import flt + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py index 9a6c764c6094..4e160d6c7006 100644 --- a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py +++ b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py @@ -2,12 +2,16 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, nowdate, add_years, cint, getdate +from frappe.utils import add_years, cint, flt, getdate, nowdate + +import erpnext from erpnext.accounts.report.financial_statements import get_period_list from erpnext.stock.doctype.warehouse.warehouse import get_child_warehouses + def execute(filters=None): return ForecastingReport(filters).execute_report() diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py index a8939051523f..3003eed63ce3 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate, flt -from erpnext.stock.report.stock_analytics.stock_analytics import (get_period_date_ranges, get_period) +from frappe.utils import flt, getdate + +from erpnext.stock.report.stock_analytics.stock_analytics import get_period, get_period_date_ranges + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.py b/erpnext/manufacturing/report/production_analytics/production_analytics.py index 42c9d97cb5ef..9e0978aee7fc 100644 --- a/erpnext/manufacturing/report/production_analytics/production_analytics.py +++ b/erpnext/manufacturing/report/production_analytics/production_analytics.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, scrub from frappe.utils import getdate -from erpnext.stock.report.stock_analytics.stock_analytics import (get_period_date_ranges, get_period) + +from erpnext.stock.report.stock_analytics.stock_analytics import get_period, get_period_date_ranges + def execute(filters=None): columns = get_columns(filters) diff --git a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py index 81b1791ae811..9a4d0c42db43 100644 --- a/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py +++ b/erpnext/manufacturing/report/production_plan_summary/production_plan_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.utils import flt + def execute(filters=None): columns, data = [], [] data = get_data(filters) diff --git a/erpnext/manufacturing/report/production_planning_report/production_planning_report.py b/erpnext/manufacturing/report/production_planning_report/production_planning_report.py index 806d268ffde7..e27270ae8b97 100644 --- a/erpnext/manufacturing/report/production_planning_report/production_planning_report.py +++ b/erpnext/manufacturing/report/production_planning_report/production_planning_report.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.stock.doctype.warehouse.warehouse import get_child_warehouses # and bom_no is not null and bom_no !='' diff --git a/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.py b/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.py index a12ac7f9d915..54df208346c6 100644 --- a/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.py +++ b/erpnext/manufacturing/report/quality_inspection_summary/quality_inspection_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns, data = [], [] data = get_data(filters) diff --git a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py index 599a738f6f6d..5b2e2620fd75 100644 --- a/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py +++ b/erpnext/manufacturing/report/work_order_stock_report/work_order_stock_report.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.utils import cint + import frappe +from frappe.utils import cint + def execute(filters=None): wo_list = get_work_orders() diff --git a/erpnext/manufacturing/report/work_order_summary/work_order_summary.py b/erpnext/manufacturing/report/work_order_summary/work_order_summary.py index d0766f9abe51..b65af33cec51 100644 --- a/erpnext/manufacturing/report/work_order_summary/work_order_summary.py +++ b/erpnext/manufacturing/report/work_order_summary/work_order_summary.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import date_diff, today, getdate, flt from frappe import _ -from erpnext.stock.report.stock_analytics.stock_analytics import (get_period_date_ranges, get_period) +from frappe.utils import date_diff, flt, getdate, today + +from erpnext.stock.report.stock_analytics.stock_analytics import get_period, get_period_date_ranges + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/non_profit/doctype/certification_application/certification_application.py b/erpnext/non_profit/doctype/certification_application/certification_application.py index d4fc76bbfa59..8c5cdd6b31a7 100644 --- a/erpnext/non_profit/doctype/certification_application/certification_application.py +++ b/erpnext/non_profit/doctype/certification_application/certification_application.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CertificationApplication(Document): pass diff --git a/erpnext/non_profit/doctype/certification_application/test_certification_application.py b/erpnext/non_profit/doctype/certification_application/test_certification_application.py index 30cb8c0acdf6..b60dbdd81db4 100644 --- a/erpnext/non_profit/doctype/certification_application/test_certification_application.py +++ b/erpnext/non_profit/doctype/certification_application/test_certification_application.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCertificationApplication(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py index 3bc6ed74c261..e255fb42dd98 100644 --- a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py +++ b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CertifiedConsultant(Document): pass diff --git a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py index 19b485db1fbf..40e4c98282cb 100644 --- a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py +++ b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCertifiedConsultant(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/chapter/chapter.py b/erpnext/non_profit/doctype/chapter/chapter.py index e9554b1f55c7..c5c9569e74ed 100644 --- a/erpnext/non_profit/doctype/chapter/chapter.py +++ b/erpnext/non_profit/doctype/chapter/chapter.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.website.website_generator import WebsiteGenerator + class Chapter(WebsiteGenerator): _website = frappe._dict( condition_field = "published", diff --git a/erpnext/non_profit/doctype/chapter/test_chapter.py b/erpnext/non_profit/doctype/chapter/test_chapter.py index d757a1f91599..04cdc2774750 100644 --- a/erpnext/non_profit/doctype/chapter/test_chapter.py +++ b/erpnext/non_profit/doctype/chapter/test_chapter.py @@ -5,5 +5,6 @@ import unittest + class TestChapter(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/chapter_member/chapter_member.py b/erpnext/non_profit/doctype/chapter_member/chapter_member.py index a1b25f2d4e2a..1638294de120 100644 --- a/erpnext/non_profit/doctype/chapter_member/chapter_member.py +++ b/erpnext/non_profit/doctype/chapter_member/chapter_member.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class ChapterMember(Document): pass diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py index 9aa7e13433c2..e4e2b4e7d654 100644 --- a/erpnext/non_profit/doctype/donation/donation.py +++ b/erpnext/non_profit/doctype/donation/donation.py @@ -3,15 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import json + import frappe import six -import json -from frappe.model.document import Document from frappe import _ -from frappe.utils import getdate, flt, get_link_to_form from frappe.email import sendmail_to_system_managers +from frappe.model.document import Document +from frappe.utils import flt, get_link_to_form, getdate + from erpnext.non_profit.doctype.membership.membership import verify_signature + class Donation(Document): def validate(self): if not self.donor or not frappe.db.exists('Donor', self.donor): diff --git a/erpnext/non_profit/doctype/donation/donation_dashboard.py b/erpnext/non_profit/doctype/donation/donation_dashboard.py index 3da89423d37f..4a16077ef47e 100644 --- a/erpnext/non_profit/doctype/donation/donation_dashboard.py +++ b/erpnext/non_profit/doctype/donation/donation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'donation', diff --git a/erpnext/non_profit/doctype/donation/test_donation.py b/erpnext/non_profit/doctype/donation/test_donation.py index b206f54523eb..6b9ade9185c1 100644 --- a/erpnext/non_profit/doctype/donation/test_donation.py +++ b/erpnext/non_profit/doctype/donation/test_donation.py @@ -3,10 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.non_profit.doctype.donation.donation import create_donation + class TestDonation(unittest.TestCase): def setUp(self): create_donor_type() diff --git a/erpnext/non_profit/doctype/donor/donor.py b/erpnext/non_profit/doctype/donor/donor.py index ab6a197ed51e..a46163a0128c 100644 --- a/erpnext/non_profit/doctype/donor/donor.py +++ b/erpnext/non_profit/doctype/donor/donor.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + from frappe.contacts.address_and_contact import load_address_and_contact +from frappe.model.document import Document + class Donor(Document): def onload(self): diff --git a/erpnext/non_profit/doctype/donor/test_donor.py b/erpnext/non_profit/doctype/donor/test_donor.py index 3b6724eb63a2..5ce01998bc31 100644 --- a/erpnext/non_profit/doctype/donor/test_donor.py +++ b/erpnext/non_profit/doctype/donor/test_donor.py @@ -5,5 +5,6 @@ import unittest + class TestDonor(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/donor_type/donor_type.py b/erpnext/non_profit/doctype/donor_type/donor_type.py index e9262ac2a52b..4d34725d024b 100644 --- a/erpnext/non_profit/doctype/donor_type/donor_type.py +++ b/erpnext/non_profit/doctype/donor_type/donor_type.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DonorType(Document): pass diff --git a/erpnext/non_profit/doctype/donor_type/test_donor_type.py b/erpnext/non_profit/doctype/donor_type/test_donor_type.py index e7939136b71f..7857ec5ad217 100644 --- a/erpnext/non_profit/doctype/donor_type/test_donor_type.py +++ b/erpnext/non_profit/doctype/donor_type/test_donor_type.py @@ -3,8 +3,8 @@ # See license.txt from __future__ import unicode_literals - import unittest + class TestDonorType(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/grant_application/grant_application.py b/erpnext/non_profit/doctype/grant_application/grant_application.py index b810fd027af6..92a62563ab9b 100644 --- a/erpnext/non_profit/doctype/grant_application/grant_application.py +++ b/erpnext/non_profit/doctype/grant_application/grant_application.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.website.website_generator import WebsiteGenerator from frappe.contacts.address_and_contact import load_address_and_contact from frappe.utils import get_url +from frappe.website.website_generator import WebsiteGenerator + class GrantApplication(WebsiteGenerator): _website = frappe._dict( diff --git a/erpnext/non_profit/doctype/grant_application/test_grant_application.py b/erpnext/non_profit/doctype/grant_application/test_grant_application.py index da16acfaacb8..d15809112ab9 100644 --- a/erpnext/non_profit/doctype/grant_application/test_grant_application.py +++ b/erpnext/non_profit/doctype/grant_application/test_grant_application.py @@ -5,5 +5,6 @@ import unittest + class TestGrantApplication(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/member/member.py b/erpnext/non_profit/doctype/member/member.py index 67828d6efc81..f7e7f105d559 100644 --- a/erpnext/non_profit/doctype/member/member.py +++ b/erpnext/non_profit/doctype/member/member.py @@ -3,14 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.model.document import Document from frappe.contacts.address_and_contact import load_address_and_contact -from frappe.utils import cint, get_link_to_form from frappe.integrations.utils import get_payment_gateway_controller +from frappe.model.document import Document +from frappe.utils import cint, get_link_to_form + from erpnext.non_profit.doctype.membership_type.membership_type import get_membership_type + class Member(Document): def onload(self): """Load address and contacts in `__onload`""" diff --git a/erpnext/non_profit/doctype/member/member_dashboard.py b/erpnext/non_profit/doctype/member/member_dashboard.py index 743db2513af9..ff929a590939 100644 --- a/erpnext/non_profit/doctype/member/member_dashboard.py +++ b/erpnext/non_profit/doctype/member/member_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/non_profit/doctype/member/test_member.py b/erpnext/non_profit/doctype/member/test_member.py index 748a500deece..38ad87f2f674 100644 --- a/erpnext/non_profit/doctype/member/test_member.py +++ b/erpnext/non_profit/doctype/member/test_member.py @@ -5,5 +5,6 @@ import unittest + class TestMember(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py index 9eb973bfee6e..e385a6828c8f 100644 --- a/erpnext/non_profit/doctype/membership/membership.py +++ b/erpnext/non_profit/doctype/membership/membership.py @@ -3,17 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import json -import frappe -import six import os from datetime import datetime -from frappe.model.document import Document -from frappe.email import sendmail_to_system_managers -from frappe.utils import add_days, add_years, nowdate, getdate, add_months, get_link_to_form -from erpnext.non_profit.doctype.member.member import create_member + +import frappe +import six from frappe import _ +from frappe.email import sendmail_to_system_managers +from frappe.model.document import Document +from frappe.utils import add_days, add_months, add_years, get_link_to_form, getdate, nowdate + import erpnext +from erpnext.non_profit.doctype.member.member import create_member + class Membership(Document): def validate(self): diff --git a/erpnext/non_profit/doctype/membership/test_membership.py b/erpnext/non_profit/doctype/membership/test_membership.py index 5ad2088fc317..5f52cdaca81a 100644 --- a/erpnext/non_profit/doctype/membership/test_membership.py +++ b/erpnext/non_profit/doctype/membership/test_membership.py @@ -2,12 +2,16 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + import frappe +from frappe.utils import add_months, nowdate + import erpnext from erpnext.non_profit.doctype.member.member import create_member from erpnext.non_profit.doctype.membership.membership import update_halted_razorpay_subscription -from frappe.utils import nowdate, add_months + class TestMembership(unittest.TestCase): def setUp(self): diff --git a/erpnext/non_profit/doctype/membership_type/membership_type.py b/erpnext/non_profit/doctype/membership_type/membership_type.py index c712b99c3b88..1b847d94b995 100644 --- a/erpnext/non_profit/doctype/membership_type/membership_type.py +++ b/erpnext/non_profit/doctype/membership_type/membership_type.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + import frappe from frappe import _ +from frappe.model.document import Document + class MembershipType(Document): def validate(self): diff --git a/erpnext/non_profit/doctype/membership_type/test_membership_type.py b/erpnext/non_profit/doctype/membership_type/test_membership_type.py index d2c9beed0dfa..2503ba17d1c1 100644 --- a/erpnext/non_profit/doctype/membership_type/test_membership_type.py +++ b/erpnext/non_profit/doctype/membership_type/test_membership_type.py @@ -5,5 +5,6 @@ import unittest + class TestMembershipType(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.py b/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.py index 50c93516adc1..cb365cb6c103 100644 --- a/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.py +++ b/erpnext/non_profit/doctype/non_profit_settings/non_profit_settings.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.integrations.utils import get_payment_gateway_controller from frappe.model.document import Document + class NonProfitSettings(Document): @frappe.whitelist() def generate_webhook_secret(self, field="membership_webhook_secret"): diff --git a/erpnext/non_profit/doctype/non_profit_settings/test_non_profit_settings.py b/erpnext/non_profit/doctype/non_profit_settings/test_non_profit_settings.py index 3f0ede32e59d..a0a54030cc91 100644 --- a/erpnext/non_profit/doctype/non_profit_settings/test_non_profit_settings.py +++ b/erpnext/non_profit/doctype/non_profit_settings/test_non_profit_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestNonProfitSettings(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/volunteer/test_volunteer.py b/erpnext/non_profit/doctype/volunteer/test_volunteer.py index 6f3bee0edd9b..346eac567709 100644 --- a/erpnext/non_profit/doctype/volunteer/test_volunteer.py +++ b/erpnext/non_profit/doctype/volunteer/test_volunteer.py @@ -5,5 +5,6 @@ import unittest + class TestVolunteer(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/volunteer/volunteer.py b/erpnext/non_profit/doctype/volunteer/volunteer.py index 699868aeb795..6c9232b0ea1d 100644 --- a/erpnext/non_profit/doctype/volunteer/volunteer.py +++ b/erpnext/non_profit/doctype/volunteer/volunteer.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + from frappe.contacts.address_and_contact import load_address_and_contact +from frappe.model.document import Document + class Volunteer(Document): def onload(self): diff --git a/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py b/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py index dc9f82319449..157a76b5c4b4 100644 --- a/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py +++ b/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class VolunteerSkill(Document): pass diff --git a/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.py b/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.py index 78f65c731a2e..2c64d21bba4f 100644 --- a/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.py +++ b/erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.py @@ -5,5 +5,6 @@ import unittest + class TestVolunteerType(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/volunteer_type/volunteer_type.py b/erpnext/non_profit/doctype/volunteer_type/volunteer_type.py index 9776402a43f7..116f5d8b52f3 100644 --- a/erpnext/non_profit/doctype/volunteer_type/volunteer_type.py +++ b/erpnext/non_profit/doctype/volunteer_type/volunteer_type.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class VolunteerType(Document): pass diff --git a/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py b/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py index 122db45ea4e3..7c07a82dfc20 100644 --- a/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py +++ b/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import _,msgprint +from frappe import _, msgprint + def execute(filters=None): columns = get_columns(filters) diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.py b/erpnext/non_profit/web_form/certification_application/certification_application.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/non_profit/web_form/certification_application/certification_application.py +++ b/erpnext/non_profit/web_form/certification_application/certification_application.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/non_profit/web_form/grant_application/grant_application.py b/erpnext/non_profit/web_form/grant_application/grant_application.py index 186722a8bf09..dab0e9fda85f 100644 --- a/erpnext/non_profit/web_form/grant_application/grant_application.py +++ b/erpnext/non_profit/web_form/grant_application/grant_application.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_context(context): context.no_cache = True context.parents = [dict(label='View All ', diff --git a/erpnext/patches/v10_0/add_default_cash_flow_mappers.py b/erpnext/patches/v10_0/add_default_cash_flow_mappers.py index d607b2f745ed..5c28597faade 100644 --- a/erpnext/patches/v10_0/add_default_cash_flow_mappers.py +++ b/erpnext/patches/v10_0/add_default_cash_flow_mappers.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe + from erpnext.setup.install import create_default_cash_flow_mapper_templates diff --git a/erpnext/patches/v10_0/delete_hub_documents.py b/erpnext/patches/v10_0/delete_hub_documents.py index f6a14998956d..db063718f3d4 100644 --- a/erpnext/patches/v10_0/delete_hub_documents.py +++ b/erpnext/patches/v10_0/delete_hub_documents.py @@ -3,6 +3,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): for dt, dn in (("Page", "Hub"), ("DocType", "Hub Settings"), ("DocType", "Hub Category")): frappe.delete_doc(dt, dn, ignore_missing=True) diff --git a/erpnext/patches/v10_0/fichier_des_ecritures_comptables_for_france.py b/erpnext/patches/v10_0/fichier_des_ecritures_comptables_for_france.py index 0315ae72a7d1..a3e49577a33d 100644 --- a/erpnext/patches/v10_0/fichier_des_ecritures_comptables_for_france.py +++ b/erpnext/patches/v10_0/fichier_des_ecritures_comptables_for_france.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + from erpnext.setup.doctype.company.company import install_country_fixtures + def execute(): frappe.reload_doc('regional', 'report', 'fichier_des_ecritures_comptables_[fec]') for d in frappe.get_all('Company', filters = {'country': 'France'}): diff --git a/erpnext/patches/v10_0/migrate_daily_work_summary_settings_to_daily_work_summary_group.py b/erpnext/patches/v10_0/migrate_daily_work_summary_settings_to_daily_work_summary_group.py index daa258e88255..a3c61a5294af 100644 --- a/erpnext/patches/v10_0/migrate_daily_work_summary_settings_to_daily_work_summary_group.py +++ b/erpnext/patches/v10_0/migrate_daily_work_summary_settings_to_daily_work_summary_group.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe diff --git a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py index f832936b10ac..4fc419e302cd 100644 --- a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py +++ b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.table_exists("Offer Letter") and not frappe.db.table_exists("Job Offer"): frappe.rename_doc("DocType", "Offer Letter", "Job Offer", force=True) diff --git a/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py b/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py index a9dd31031007..1b8c6fb7ea5e 100644 --- a/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py +++ b/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("accounts", "doctype", "pricing_rule") diff --git a/erpnext/patches/v10_0/set_currency_in_pricing_rule.py b/erpnext/patches/v10_0/set_currency_in_pricing_rule.py index c4139312d9fb..2a3f1c03bde1 100644 --- a/erpnext/patches/v10_0/set_currency_in_pricing_rule.py +++ b/erpnext/patches/v10_0/set_currency_in_pricing_rule.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doctype("Pricing Rule") diff --git a/erpnext/patches/v10_0/update_translatable_fields.py b/erpnext/patches/v10_0/update_translatable_fields.py index 9d6bda716858..2c55a0521733 100644 --- a/erpnext/patches/v10_0/update_translatable_fields.py +++ b/erpnext/patches/v10_0/update_translatable_fields.py @@ -4,6 +4,7 @@ import frappe + def execute(): ''' Enable translatable in these fields diff --git a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py index 3d1a88e800cd..2d5b0c5bd4a4 100644 --- a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py +++ b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field diff --git a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py index f4c189553901..197b3b72676d 100644 --- a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py +++ b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import os import frappe diff --git a/erpnext/patches/v11_0/add_default_email_template_for_leave.py b/erpnext/patches/v11_0/add_default_email_template_for_leave.py index 0f1e49662310..f8538df2ef28 100644 --- a/erpnext/patches/v11_0/add_default_email_template_for_leave.py +++ b/erpnext/patches/v11_0/add_default_email_template_for_leave.py @@ -1,7 +1,11 @@ from __future__ import unicode_literals -import frappe, os + +import os + +import frappe from frappe import _ + def execute(): frappe.reload_doc("email", "doctype", "email_template") diff --git a/erpnext/patches/v11_0/add_expense_claim_default_account.py b/erpnext/patches/v11_0/add_expense_claim_default_account.py index a613bd88497e..74b93efbf80c 100644 --- a/erpnext/patches/v11_0/add_expense_claim_default_account.py +++ b/erpnext/patches/v11_0/add_expense_claim_default_account.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("setup", "doctype", "company") diff --git a/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py b/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py index a45f39d43404..9bb91dc14c15 100644 --- a/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py +++ b/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe import _ + def execute(): """ assign lft and rgt appropriately """ if "Healthcare" not in frappe.get_active_domains(): diff --git a/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py b/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py index 0243dfb38ed7..08ad855e5e2f 100644 --- a/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py +++ b/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("assets", "doctype", "Location") for dt in ("Account", "Cost Center", "File", "Employee", "Location", "Task", "Customer Group", "Sales Person", "Territory"): diff --git a/erpnext/patches/v11_0/add_item_group_defaults.py b/erpnext/patches/v11_0/add_item_group_defaults.py index 2a15ad1e2a32..6849b27feee5 100644 --- a/erpnext/patches/v11_0/add_item_group_defaults.py +++ b/erpnext/patches/v11_0/add_item_group_defaults.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): ''' diff --git a/erpnext/patches/v11_0/add_market_segments.py b/erpnext/patches/v11_0/add_market_segments.py index a8841ef3a441..23fc9925b3aa 100644 --- a/erpnext/patches/v11_0/add_market_segments.py +++ b/erpnext/patches/v11_0/add_market_segments.py @@ -2,8 +2,10 @@ import frappe from frappe import _ + from erpnext.setup.setup_wizard.operations.install_fixtures import add_market_segments + def execute(): frappe.reload_doc('crm', 'doctype', 'market_segment') diff --git a/erpnext/patches/v11_0/add_permissions_in_gst_settings.py b/erpnext/patches/v11_0/add_permissions_in_gst_settings.py index 83b2a4cc09ee..9df1b586e305 100644 --- a/erpnext/patches/v11_0/add_permissions_in_gst_settings.py +++ b/erpnext/patches/v11_0/add_permissions_in_gst_settings.py @@ -1,6 +1,8 @@ import frappe + from erpnext.regional.india.setup import add_permissions + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v11_0/add_sales_stages.py b/erpnext/patches/v11_0/add_sales_stages.py index d06c6889ff72..e30f3390dd1c 100644 --- a/erpnext/patches/v11_0/add_sales_stages.py +++ b/erpnext/patches/v11_0/add_sales_stages.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.setup.setup_wizard.operations.install_fixtures import add_sale_stages + def execute(): frappe.reload_doc('crm', 'doctype', 'sales_stage') diff --git a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py index 0a1a36007e57..5eaf21220bdf 100644 --- a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py +++ b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('setup', 'doctype', 'currency_exchange') frappe.db.sql("""update `tabCurrency Exchange` set for_buying = 1, for_selling = 1""") diff --git a/erpnext/patches/v11_0/create_default_success_action.py b/erpnext/patches/v11_0/create_default_success_action.py index 31feff25b935..4a598371f826 100644 --- a/erpnext/patches/v11_0/create_default_success_action.py +++ b/erpnext/patches/v11_0/create_default_success_action.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.setup.install import create_default_success_action + def execute(): frappe.reload_doc("core", "doctype", "success_action") create_default_success_action() diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index e9b5950a133c..7799a6504051 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils.nestedset import rebuild_tree + def execute(): frappe.local.lang = frappe.db.get_default("lang") or 'en' diff --git a/erpnext/patches/v11_0/create_salary_structure_assignments.py b/erpnext/patches/v11_0/create_salary_structure_assignments.py index d3ea7a3c1c05..c3cc9b6d309a 100644 --- a/erpnext/patches/v11_0/create_salary_structure_assignments.py +++ b/erpnext/patches/v11_0/create_salary_structure_assignments.py @@ -2,10 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + from datetime import datetime + +import frappe from frappe.utils import getdate -from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import DuplicateAssignment + +from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import ( + DuplicateAssignment, +) + def execute(): frappe.reload_doc('Payroll', 'doctype', 'Salary Structure') diff --git a/erpnext/patches/v11_0/drop_column_max_days_allowed.py b/erpnext/patches/v11_0/drop_column_max_days_allowed.py index 029f75a22588..e45d01cef584 100644 --- a/erpnext/patches/v11_0/drop_column_max_days_allowed.py +++ b/erpnext/patches/v11_0/drop_column_max_days_allowed.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists("DocType", "Leave Type"): if 'max_days_allowed' in frappe.db.get_table_columns("Leave Type"): diff --git a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py index 4247c788e33f..a59291ce420d 100644 --- a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py +++ b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v11_0/hr_ux_cleanups.py b/erpnext/patches/v11_0/hr_ux_cleanups.py index 8d187965011d..b09f4a7e7f24 100644 --- a/erpnext/patches/v11_0/hr_ux_cleanups.py +++ b/erpnext/patches/v11_0/hr_ux_cleanups.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doctype('Employee') frappe.db.sql('update tabEmployee set first_name = employee_name') diff --git a/erpnext/patches/v11_0/inter_state_field_for_gst.py b/erpnext/patches/v11_0/inter_state_field_for_gst.py index 730eebc01ce0..fa83af00655c 100644 --- a/erpnext/patches/v11_0/inter_state_field_for_gst.py +++ b/erpnext/patches/v11_0/inter_state_field_for_gst.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals + import frappe -from erpnext.regional.india.setup import make_custom_fields + +from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py b/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py index dfcf5ab28867..57606dcf1752 100644 --- a/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py +++ b/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils.nestedset import rebuild_tree + def execute(): frappe.reload_doc('assets', 'doctype', 'asset_finance_book') frappe.reload_doc('assets', 'doctype', 'depreciation_schedule') diff --git a/erpnext/patches/v11_0/make_italian_localization_fields.py b/erpnext/patches/v11_0/make_italian_localization_fields.py index 29d25c9a2d49..994df721c25c 100644 --- a/erpnext/patches/v11_0/make_italian_localization_fields.py +++ b/erpnext/patches/v11_0/make_italian_localization_fields.py @@ -2,10 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -from erpnext.regional.italy.setup import make_custom_fields, setup_report -from erpnext.regional.italy import state_codes + import frappe +from erpnext.regional.italy import state_codes +from erpnext.regional.italy.setup import make_custom_fields, setup_report + + def execute(): company = frappe.get_all('Company', filters = {'country': 'Italy'}) if not company: diff --git a/erpnext/patches/v11_0/make_job_card.py b/erpnext/patches/v11_0/make_job_card.py index 9c41c0b991f1..e361d5a8381b 100644 --- a/erpnext/patches/v11_0/make_job_card.py +++ b/erpnext/patches/v11_0/make_job_card.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + from erpnext.manufacturing.doctype.work_order.work_order import create_job_card + def execute(): frappe.reload_doc('manufacturing', 'doctype', 'work_order') frappe.reload_doc('manufacturing', 'doctype', 'work_order_item') diff --git a/erpnext/patches/v11_0/make_location_from_warehouse.py b/erpnext/patches/v11_0/make_location_from_warehouse.py index 8c92b5180d97..e855b3ee5e12 100644 --- a/erpnext/patches/v11_0/make_location_from_warehouse.py +++ b/erpnext/patches/v11_0/make_location_from_warehouse.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils.nestedset import rebuild_tree + def execute(): if not frappe.db.get_value('Asset', {'docstatus': ('<', 2) }, 'name'): return frappe.reload_doc('assets', 'doctype', 'location') diff --git a/erpnext/patches/v11_0/make_quality_inspection_template.py b/erpnext/patches/v11_0/make_quality_inspection_template.py index 9720af412199..1c3d34ee208e 100644 --- a/erpnext/patches/v11_0/make_quality_inspection_template.py +++ b/erpnext/patches/v11_0/make_quality_inspection_template.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'quality_inspection_template') frappe.reload_doc('stock', 'doctype', 'item') diff --git a/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py b/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py index 83617f77fd00..42fdf1358ad4 100644 --- a/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py +++ b/erpnext/patches/v11_0/move_item_defaults_to_child_table_for_multicompany.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): ''' diff --git a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py index ef703d0ea71f..fb7d9e8a1ae6 100644 --- a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py +++ b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("hr", "doctype", "department_approver") frappe.reload_doc("hr", "doctype", "employee") diff --git a/erpnext/patches/v11_0/rebuild_tree_for_company.py b/erpnext/patches/v11_0/rebuild_tree_for_company.py index 4cb74c7256cf..6caca4730c25 100644 --- a/erpnext/patches/v11_0/rebuild_tree_for_company.py +++ b/erpnext/patches/v11_0/rebuild_tree_for_company.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.utils.nestedset import rebuild_tree + def execute(): frappe.reload_doc("setup", "doctype", "company") rebuild_tree('Company', 'parent_company') diff --git a/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py b/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py index 7c8a822fa22f..b1ed0f598c6f 100644 --- a/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py +++ b/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields +from frappe.modules import get_doctype_module, scrub + from erpnext.domains.healthcare import data -from frappe.modules import scrub, get_doctype_module sales_invoice_referenced_doc = { "Patient Appointment": "sales_invoice", diff --git a/erpnext/patches/v11_0/refactor_erpnext_shopify.py b/erpnext/patches/v11_0/refactor_erpnext_shopify.py index 340e9fc8bf7b..2add72110901 100644 --- a/erpnext/patches/v11_0/refactor_erpnext_shopify.py +++ b/erpnext/patches/v11_0/refactor_erpnext_shopify.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.installer import remove_from_installed_apps + def execute(): frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_settings') frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_tax_account') diff --git a/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py b/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py index 97ddd41ddb63..caf74f578de0 100644 --- a/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py +++ b/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py @@ -1,5 +1,6 @@ import frappe + def execute(): '''Remove barcodes field from "Copy Fields to Variants" table because barcodes must be unique''' diff --git a/erpnext/patches/v11_0/remove_modules_setup_page.py b/erpnext/patches/v11_0/remove_modules_setup_page.py index bb0bdf59da12..eab3237878e8 100644 --- a/erpnext/patches/v11_0/remove_modules_setup_page.py +++ b/erpnext/patches/v11_0/remove_modules_setup_page.py @@ -2,7 +2,9 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.delete_doc("Page", "modules_setup") diff --git a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py index 8eb701674478..5b2c2863f2ff 100644 --- a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py +++ b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe # this patch should have been included with this PR https://github.com/frappe/erpnext/pull/14302 diff --git a/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py b/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py index 923b23048dfc..707dff75e24e 100644 --- a/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py +++ b/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe diff --git a/erpnext/patches/v11_0/rename_bom_wo_fields.py b/erpnext/patches/v11_0/rename_bom_wo_fields.py index 0e6036b07400..4ad6ea9999dc 100644 --- a/erpnext/patches/v11_0/rename_bom_wo_fields.py +++ b/erpnext/patches/v11_0/rename_bom_wo_fields.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): # updating column value to handle field change from Data to Currency changed_field = "base_scrap_material_cost" diff --git a/erpnext/patches/v11_0/rename_duplicate_item_code_values.py b/erpnext/patches/v11_0/rename_duplicate_item_code_values.py index 00ab562c3534..61f3856e8ebc 100644 --- a/erpnext/patches/v11_0/rename_duplicate_item_code_values.py +++ b/erpnext/patches/v11_0/rename_duplicate_item_code_values.py @@ -1,5 +1,6 @@ import frappe + def execute(): items = [] items = frappe.db.sql("""select item_code from `tabItem` group by item_code having count(*) > 1""", as_dict=True) diff --git a/erpnext/patches/v11_0/rename_field_max_days_allowed.py b/erpnext/patches/v11_0/rename_field_max_days_allowed.py index 4e99fac82249..48f73fb2f416 100644 --- a/erpnext/patches/v11_0/rename_field_max_days_allowed.py +++ b/erpnext/patches/v11_0/rename_field_max_days_allowed.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.db.sql(""" UPDATE `tabLeave Type` diff --git a/erpnext/patches/v11_0/rename_health_insurance.py b/erpnext/patches/v11_0/rename_health_insurance.py index 06fc6151675b..a4f53b078e17 100644 --- a/erpnext/patches/v11_0/rename_health_insurance.py +++ b/erpnext/patches/v11_0/rename_health_insurance.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.rename_doc('DocType', 'Health Insurance', 'Employee Health Insurance', force=True) frappe.reload_doc('hr', 'doctype', 'employee_health_insurance') diff --git a/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py index 9705681b33f5..7a8c52f102f7 100644 --- a/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py +++ b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field -from frappe.modules import scrub, get_doctype_module +from frappe.modules import get_doctype_module, scrub field_rename_map = { "Patient Encounter": [ diff --git a/erpnext/patches/v11_0/rename_healthcare_fields.py b/erpnext/patches/v11_0/rename_healthcare_fields.py index 9aeb433cff82..5c96367a7372 100644 --- a/erpnext/patches/v11_0/rename_healthcare_fields.py +++ b/erpnext/patches/v11_0/rename_healthcare_fields.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field -from frappe.modules import scrub, get_doctype_module +from frappe.modules import get_doctype_module, scrub lab_test_name = ["test_name", "lab_test_name"] lab_test_code = ["test_code", "lab_test_code"] diff --git a/erpnext/patches/v11_0/rename_members_with_naming_series.py b/erpnext/patches/v11_0/rename_members_with_naming_series.py index 84f5518926fa..a3d7970aa1f6 100644 --- a/erpnext/patches/v11_0/rename_members_with_naming_series.py +++ b/erpnext/patches/v11_0/rename_members_with_naming_series.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("non_profit", "doctype", "member") old_named_members = frappe.get_all("Member", filters = {"name": ("not like", "MEM-%")}) diff --git a/erpnext/patches/v11_0/rename_overproduction_percent_field.py b/erpnext/patches/v11_0/rename_overproduction_percent_field.py index fbf925d955cc..c7124af2e45d 100644 --- a/erpnext/patches/v11_0/rename_overproduction_percent_field.py +++ b/erpnext/patches/v11_0/rename_overproduction_percent_field.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -from frappe.model.utils.rename_field import rename_field + import frappe +from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc('manufacturing', 'doctype', 'manufacturing_settings') diff --git a/erpnext/patches/v11_0/rename_production_order_to_work_order.py b/erpnext/patches/v11_0/rename_production_order_to_work_order.py index 2f620f413bac..995f1affe4e6 100644 --- a/erpnext/patches/v11_0/rename_production_order_to_work_order.py +++ b/erpnext/patches/v11_0/rename_production_order_to_work_order.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.rename_doc('DocType', 'Production Order', 'Work Order', force=True) frappe.reload_doc('manufacturing', 'doctype', 'work_order') diff --git a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py index c4b3838c71de..2e53fb832fe4 100644 --- a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py +++ b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py @@ -1,9 +1,11 @@ from __future__ import unicode_literals + import frappe -from frappe.model.utils.rename_field import rename_field from frappe import _ +from frappe.model.utils.rename_field import rename_field from frappe.utils.nestedset import rebuild_tree + def execute(): if frappe.db.table_exists("Supplier Group"): frappe.reload_doc('setup', 'doctype', 'supplier_group') diff --git a/erpnext/patches/v11_0/renamed_from_to_fields_in_project.py b/erpnext/patches/v11_0/renamed_from_to_fields_in_project.py index d5ca4cc57491..894aaee5f0bf 100644 --- a/erpnext/patches/v11_0/renamed_from_to_fields_in_project.py +++ b/erpnext/patches/v11_0/renamed_from_to_fields_in_project.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc('projects', 'doctype', 'project') diff --git a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py index 56e95e032861..a664baf6dd67 100644 --- a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py +++ b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'item') frappe.db.sql("""update `tabItem` set publish_in_hub = 0""") diff --git a/erpnext/patches/v11_0/set_default_email_template_in_hr.py b/erpnext/patches/v11_0/set_default_email_template_in_hr.py index 46223761095b..ff754247fba0 100644 --- a/erpnext/patches/v11_0/set_default_email_template_in_hr.py +++ b/erpnext/patches/v11_0/set_default_email_template_in_hr.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals -from frappe import _ + import frappe +from frappe import _ + def execute(): hr_settings = frappe.get_single("HR Settings") diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py index 175d2a189f35..c9699655db32 100644 --- a/erpnext/patches/v11_0/set_department_for_doctypes.py +++ b/erpnext/patches/v11_0/set_department_for_doctypes.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe # Set department value based on employee value diff --git a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py index 8f8a545c4101..7a0a98902521 100644 --- a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py +++ b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html + def execute(): company = frappe.db.sql_list("select name from tabCompany where country = 'India'") if not company: diff --git a/erpnext/patches/v11_0/set_salary_component_properties.py b/erpnext/patches/v11_0/set_salary_component_properties.py index d8ce31f30768..b70dc357aa76 100644 --- a/erpnext/patches/v11_0/set_salary_component_properties.py +++ b/erpnext/patches/v11_0/set_salary_component_properties.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('Payroll', 'doctype', 'salary_detail') frappe.reload_doc('Payroll', 'doctype', 'salary_component') diff --git a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py index d0cabb383590..da4d4bd943aa 100644 --- a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py +++ b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.workflow import get_workflow_name + def execute(): for doctype in ['Expense Claim', 'Leave Application']: diff --git a/erpnext/patches/v11_0/set_user_permissions_for_department.py b/erpnext/patches/v11_0/set_user_permissions_for_department.py index 2f90f14db3ec..7840d5e0feb4 100644 --- a/erpnext/patches/v11_0/set_user_permissions_for_department.py +++ b/erpnext/patches/v11_0/set_user_permissions_for_department.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): user_permissions = frappe.db.sql("""select name, for_value from `tabUser Permission` where allow='Department'""", as_dict=1) diff --git a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py index 4e72917547b2..66d1b6b40abe 100644 --- a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py +++ b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe from frappe.desk.form.linked_with import get_linked_doctypes diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py index 91470b3558a8..310ab30b55f5 100644 --- a/erpnext/patches/v11_0/uom_conversion_data.py +++ b/erpnext/patches/v11_0/uom_conversion_data.py @@ -1,5 +1,9 @@ from __future__ import unicode_literals -import frappe, json + +import json + +import frappe + def execute(): from erpnext.setup.setup_wizard.operations.install_fixtures import add_uom_data diff --git a/erpnext/patches/v11_0/update_account_type_in_party_type.py b/erpnext/patches/v11_0/update_account_type_in_party_type.py index dabaeffc94a3..e51874f48a0d 100644 --- a/erpnext/patches/v11_0/update_account_type_in_party_type.py +++ b/erpnext/patches/v11_0/update_account_type_in_party_type.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('setup', 'doctype', 'party_type') party_types = {'Customer': 'Receivable', 'Supplier': 'Payable', diff --git a/erpnext/patches/v11_0/update_allow_transfer_for_manufacture.py b/erpnext/patches/v11_0/update_allow_transfer_for_manufacture.py index 799e91a3e226..bfcfc9f6f443 100644 --- a/erpnext/patches/v11_0/update_allow_transfer_for_manufacture.py +++ b/erpnext/patches/v11_0/update_allow_transfer_for_manufacture.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'item') frappe.db.sql(""" update `tabItem` set include_item_in_manufacturing = 1 diff --git a/erpnext/patches/v11_0/update_backflush_subcontract_rm_based_on_bom.py b/erpnext/patches/v11_0/update_backflush_subcontract_rm_based_on_bom.py index 37a616c7021f..c3b18bd98170 100644 --- a/erpnext/patches/v11_0/update_backflush_subcontract_rm_based_on_bom.py +++ b/erpnext/patches/v11_0/update_backflush_subcontract_rm_based_on_bom.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('buying', 'doctype', 'buying_settings') frappe.db.set_value('Buying Settings', None, 'backflush_raw_materials_of_subcontract_based_on', 'BOM') diff --git a/erpnext/patches/v11_0/update_brand_in_item_price.py b/erpnext/patches/v11_0/update_brand_in_item_price.py index 977d84fefe86..a489378895d4 100644 --- a/erpnext/patches/v11_0/update_brand_in_item_price.py +++ b/erpnext/patches/v11_0/update_brand_in_item_price.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'item_price') diff --git a/erpnext/patches/v11_0/update_delivery_trip_status.py b/erpnext/patches/v11_0/update_delivery_trip_status.py index 42f017e04d2b..da259582747f 100755 --- a/erpnext/patches/v11_0/update_delivery_trip_status.py +++ b/erpnext/patches/v11_0/update_delivery_trip_status.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('setup', 'doctype', 'global_defaults', force=True) frappe.reload_doc('stock', 'doctype', 'delivery_trip') diff --git a/erpnext/patches/v11_0/update_department_lft_rgt.py b/erpnext/patches/v11_0/update_department_lft_rgt.py index 2b3820371091..f7ecf6e4523d 100644 --- a/erpnext/patches/v11_0/update_department_lft_rgt.py +++ b/erpnext/patches/v11_0/update_department_lft_rgt.py @@ -4,6 +4,7 @@ from frappe import _ from frappe.utils.nestedset import rebuild_tree + def execute(): """ assign lft and rgt appropriately """ frappe.reload_doc("hr", "doctype", "department") diff --git a/erpnext/patches/v11_0/update_hub_url.py b/erpnext/patches/v11_0/update_hub_url.py index 6c6ca3c5c285..c89b9b50607b 100644 --- a/erpnext/patches/v11_0/update_hub_url.py +++ b/erpnext/patches/v11_0/update_hub_url.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('hub_node', 'doctype', 'Marketplace Settings') frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'marketplace_url', 'https://hubmarket.org') diff --git a/erpnext/patches/v11_0/update_sales_partner_type.py b/erpnext/patches/v11_0/update_sales_partner_type.py index b393926b2370..1369805349de 100644 --- a/erpnext/patches/v11_0/update_sales_partner_type.py +++ b/erpnext/patches/v11_0/update_sales_partner_type.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe import _ + def execute(): from erpnext.setup.setup_wizard.operations.install_fixtures import default_sales_partner_type diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index 9407256acfaa..e79a5f9e6bcf 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('buying', 'doctype', 'purchase_order') frappe.reload_doc('buying', 'doctype', 'supplier_quotation') diff --git a/erpnext/patches/v11_1/delete_bom_browser.py b/erpnext/patches/v11_1/delete_bom_browser.py index 2892674d374f..aad3df267c8c 100644 --- a/erpnext/patches/v11_1/delete_bom_browser.py +++ b/erpnext/patches/v11_1/delete_bom_browser.py @@ -2,7 +2,9 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.delete_doc_if_exists('Page', 'bom-browser') diff --git a/erpnext/patches/v11_1/delete_scheduling_tool.py b/erpnext/patches/v11_1/delete_scheduling_tool.py index b7ad28a3fd6f..56d0dbf1a1f5 100644 --- a/erpnext/patches/v11_1/delete_scheduling_tool.py +++ b/erpnext/patches/v11_1/delete_scheduling_tool.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists("DocType", "Scheduling Tool"): frappe.delete_doc("DocType", "Scheduling Tool", ignore_permissions=True) diff --git a/erpnext/patches/v11_1/make_job_card_time_logs.py b/erpnext/patches/v11_1/make_job_card_time_logs.py index b706e5c1ffb9..db0c3454c744 100644 --- a/erpnext/patches/v11_1/make_job_card_time_logs.py +++ b/erpnext/patches/v11_1/make_job_card_time_logs.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('manufacturing', 'doctype', 'job_card_time_log') diff --git a/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py b/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py index fc3ec74083af..9ea6cd82c9c9 100644 --- a/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py +++ b/erpnext/patches/v11_1/move_customer_lead_to_dynamic_column.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doctype("Quotation") frappe.db.sql(""" UPDATE `tabQuotation` set party_name = lead WHERE quotation_to = 'Lead' """) diff --git a/erpnext/patches/v11_1/rename_depends_on_lwp.py b/erpnext/patches/v11_1/rename_depends_on_lwp.py index 4c4b14fd4e70..95a8225832ce 100644 --- a/erpnext/patches/v11_1/rename_depends_on_lwp.py +++ b/erpnext/patches/v11_1/rename_depends_on_lwp.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import scrub from frappe.model.utils.rename_field import rename_field + def execute(): for doctype in ("Salary Component", "Salary Detail"): if "depends_on_lwp" in frappe.db.get_table_columns(doctype): diff --git a/erpnext/patches/v11_1/renamed_delayed_item_report.py b/erpnext/patches/v11_1/renamed_delayed_item_report.py index 8e8725c8af6e..21285637c4e5 100644 --- a/erpnext/patches/v11_1/renamed_delayed_item_report.py +++ b/erpnext/patches/v11_1/renamed_delayed_item_report.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): for report in ["Delayed Order Item Summary", "Delayed Order Summary"]: if frappe.db.exists("Report", report): diff --git a/erpnext/patches/v11_1/set_default_action_for_quality_inspection.py b/erpnext/patches/v11_1/set_default_action_for_quality_inspection.py index b13239f7d126..4325490c7930 100644 --- a/erpnext/patches/v11_1/set_default_action_for_quality_inspection.py +++ b/erpnext/patches/v11_1/set_default_action_for_quality_inspection.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): stock_settings = frappe.get_doc('Stock Settings') if stock_settings.default_warehouse and not frappe.db.exists("Warehouse", stock_settings.default_warehouse): diff --git a/erpnext/patches/v11_1/set_missing_opportunity_from.py b/erpnext/patches/v11_1/set_missing_opportunity_from.py index cb444b2e5dd2..6569200a14c5 100644 --- a/erpnext/patches/v11_1/set_missing_opportunity_from.py +++ b/erpnext/patches/v11_1/set_missing_opportunity_from.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doctype("Opportunity") diff --git a/erpnext/patches/v11_1/set_missing_title_for_quotation.py b/erpnext/patches/v11_1/set_missing_title_for_quotation.py index e2ef3433d3ee..93d9f0e7d89f 100644 --- a/erpnext/patches/v11_1/set_missing_title_for_quotation.py +++ b/erpnext/patches/v11_1/set_missing_title_for_quotation.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doctype("Quotation") # update customer_name from Customer document if quotation_to is set to Customer diff --git a/erpnext/patches/v11_1/set_salary_details_submittable.py b/erpnext/patches/v11_1/set_salary_details_submittable.py index 6d847ec3d05d..4a4cf302575d 100644 --- a/erpnext/patches/v11_1/set_salary_details_submittable.py +++ b/erpnext/patches/v11_1/set_salary_details_submittable.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql(""" update `tabSalary Structure` ss, `tabSalary Detail` sd diff --git a/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py b/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py index ec01fbb642e6..64db97e92bc8 100644 --- a/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py +++ b/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql(""" update `tabMaterial Request` diff --git a/erpnext/patches/v11_1/set_variant_based_on.py b/erpnext/patches/v11_1/set_variant_based_on.py index 49a9a1772468..b69767d7ea46 100644 --- a/erpnext/patches/v11_1/set_variant_based_on.py +++ b/erpnext/patches/v11_1/set_variant_based_on.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql("""update tabItem set variant_based_on = 'Item Attribute' where ifnull(variant_based_on, '') = '' diff --git a/erpnext/patches/v11_1/setup_guardian_role.py b/erpnext/patches/v11_1/setup_guardian_role.py index 6ccfed9617cf..bb33f19e9cff 100644 --- a/erpnext/patches/v11_1/setup_guardian_role.py +++ b/erpnext/patches/v11_1/setup_guardian_role.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if 'Education' in frappe.get_active_domains() and not frappe.db.exists("Role", "Guardian"): doc = frappe.new_doc("Role") diff --git a/erpnext/patches/v11_1/update_bank_transaction_status.py b/erpnext/patches/v11_1/update_bank_transaction_status.py index 354e636c9b0c..33007afcd8ce 100644 --- a/erpnext/patches/v11_1/update_bank_transaction_status.py +++ b/erpnext/patches/v11_1/update_bank_transaction_status.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "bank_transaction") diff --git a/erpnext/patches/v11_1/update_default_supplier_in_item_defaults.py b/erpnext/patches/v11_1/update_default_supplier_in_item_defaults.py index 8c360ad9353c..22dabae7d2e0 100644 --- a/erpnext/patches/v11_1/update_default_supplier_in_item_defaults.py +++ b/erpnext/patches/v11_1/update_default_supplier_in_item_defaults.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): ''' default supplier was not set in the item defaults for multi company instance, diff --git a/erpnext/patches/v11_1/woocommerce_set_creation_user.py b/erpnext/patches/v11_1/woocommerce_set_creation_user.py index 074b904002c3..e7218b1ade54 100644 --- a/erpnext/patches/v11_1/woocommerce_set_creation_user.py +++ b/erpnext/patches/v11_1/woocommerce_set_creation_user.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.utils import cint + def execute(): frappe.reload_doc("erpnext_integrations", "doctype","woocommerce_settings") doc = frappe.get_doc("Woocommerce Settings") diff --git a/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py b/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py index 712eb4f61c2f..98e7d1db7a6d 100644 --- a/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py +++ b/erpnext/patches/v12_0/add_company_link_to_einvoice_settings.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/add_default_buying_selling_terms_in_company.py b/erpnext/patches/v12_0/add_default_buying_selling_terms_in_company.py index 855d21dd9922..384a1f5022a2 100644 --- a/erpnext/patches/v12_0/add_default_buying_selling_terms_in_company.py +++ b/erpnext/patches/v12_0/add_default_buying_selling_terms_in_company.py @@ -6,6 +6,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("setup", "doctype", "company") if frappe.db.has_column('Company', 'default_terms'): diff --git a/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py b/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py index 6fe578dbd95a..7f39dfef59df 100644 --- a/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py +++ b/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals -from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'Italy'}) diff --git a/erpnext/patches/v12_0/add_einvoice_status_field.py b/erpnext/patches/v12_0/add_einvoice_status_field.py index 2dfd30714c8c..aeff9ca8413b 100644 --- a/erpnext/patches/v12_0/add_einvoice_status_field.py +++ b/erpnext/patches/v12_0/add_einvoice_status_field.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import json + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/add_einvoice_summary_report_permissions.py b/erpnext/patches/v12_0/add_einvoice_summary_report_permissions.py index c1c11e260069..e837786138ff 100644 --- a/erpnext/patches/v12_0/add_einvoice_summary_report_permissions.py +++ b/erpnext/patches/v12_0/add_einvoice_summary_report_permissions.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/add_eway_bill_in_delivery_note.py b/erpnext/patches/v12_0/add_eway_bill_in_delivery_note.py index cf1ed3676bfe..973da895623d 100644 --- a/erpnext/patches/v12_0/add_eway_bill_in_delivery_note.py +++ b/erpnext/patches/v12_0/add_eway_bill_in_delivery_note.py @@ -1,6 +1,7 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_field + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/add_ewaybill_validity_field.py b/erpnext/patches/v12_0/add_ewaybill_validity_field.py index f29b71437e8c..247140d21d07 100644 --- a/erpnext/patches/v12_0/add_ewaybill_validity_field.py +++ b/erpnext/patches/v12_0/add_ewaybill_validity_field.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/add_export_type_field_in_party_master.py b/erpnext/patches/v12_0/add_export_type_field_in_party_master.py index a0b1f87d61b0..e05c8211c03b 100644 --- a/erpnext/patches/v12_0/add_export_type_field_in_party_master.py +++ b/erpnext/patches/v12_0/add_export_type_field_in_party_master.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py b/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py index c90819238c8c..30e47cb333c1 100644 --- a/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py +++ b/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/add_permission_in_lower_deduction.py b/erpnext/patches/v12_0/add_permission_in_lower_deduction.py index 2e42368b1522..1d77e5ad3d11 100644 --- a/erpnext/patches/v12_0/add_permission_in_lower_deduction.py +++ b/erpnext/patches/v12_0/add_permission_in_lower_deduction.py @@ -1,6 +1,7 @@ import frappe from frappe.permissions import add_permission, update_permission_property + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/add_state_code_for_ladakh.py b/erpnext/patches/v12_0/add_state_code_for_ladakh.py index 29a7b4bd6025..6722b7bcef0d 100644 --- a/erpnext/patches/v12_0/add_state_code_for_ladakh.py +++ b/erpnext/patches/v12_0/add_state_code_for_ladakh.py @@ -1,6 +1,8 @@ import frappe + from erpnext.regional.india import states + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/add_taxjar_integration_field.py b/erpnext/patches/v12_0/add_taxjar_integration_field.py index 4c823e13bdfc..d10a6d79f296 100644 --- a/erpnext/patches/v12_0/add_taxjar_integration_field.py +++ b/erpnext/patches/v12_0/add_taxjar_integration_field.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import frappe + from erpnext.regional.united_states.setup import make_custom_fields diff --git a/erpnext/patches/v12_0/add_variant_of_in_item_attribute_table.py b/erpnext/patches/v12_0/add_variant_of_in_item_attribute_table.py index 893f7a4909ed..c3a422c49e52 100644 --- a/erpnext/patches/v12_0/add_variant_of_in_item_attribute_table.py +++ b/erpnext/patches/v12_0/add_variant_of_in_item_attribute_table.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'item_variant_attribute') frappe.db.sql(''' diff --git a/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py b/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py index f171542df168..02fbe62837ab 100644 --- a/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py +++ b/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_field + def execute(): frappe.reload_doc('accounts', 'doctype', 'accounting_dimension') diff --git a/erpnext/patches/v12_0/create_default_energy_point_rules.py b/erpnext/patches/v12_0/create_default_energy_point_rules.py index 93d2576bb6df..35eaca7f400f 100644 --- a/erpnext/patches/v12_0/create_default_energy_point_rules.py +++ b/erpnext/patches/v12_0/create_default_energy_point_rules.py @@ -1,6 +1,8 @@ import frappe + from erpnext.setup.install import create_default_energy_point_rules + def execute(): frappe.reload_doc('social', 'doctype', 'energy_point_rule') create_default_energy_point_rules() diff --git a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py index 23a8f24d780a..65265c4c8e8b 100644 --- a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py +++ b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.united_states.setup import make_custom_fields + def execute(): frappe.reload_doc('accounts', 'doctype', 'allowed_to_transact_with', force=True) diff --git a/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py b/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py index a6230f427718..9267ebffb276 100644 --- a/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py +++ b/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py @@ -1,9 +1,12 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.custom.doctype.property_setter.property_setter import make_property_setter + from erpnext.regional.india.utils import get_gst_accounts + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}, fields=['name']) if not company: diff --git a/erpnext/patches/v12_0/create_taxable_value_field.py b/erpnext/patches/v12_0/create_taxable_value_field.py index b9ee81df50e7..40de8d8aef26 100644 --- a/erpnext/patches/v12_0/create_taxable_value_field.py +++ b/erpnext/patches/v12_0/create_taxable_value_field.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/delete_priority_property_setter.py b/erpnext/patches/v12_0/delete_priority_property_setter.py index 163855729df8..cacc463d4b46 100644 --- a/erpnext/patches/v12_0/delete_priority_property_setter.py +++ b/erpnext/patches/v12_0/delete_priority_property_setter.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.db.sql(""" DELETE FROM `tabProperty Setter` diff --git a/erpnext/patches/v12_0/fix_percent_complete_for_projects.py b/erpnext/patches/v12_0/fix_percent_complete_for_projects.py index 3622df6bc811..36f51bca60df 100644 --- a/erpnext/patches/v12_0/fix_percent_complete_for_projects.py +++ b/erpnext/patches/v12_0/fix_percent_complete_for_projects.py @@ -1,6 +1,7 @@ import frappe from frappe.utils import flt + def execute(): for project in frappe.get_all("Project", fields=["name", "percent_complete_method"]): total = frappe.db.count('Task', dict(project=project.name)) diff --git a/erpnext/patches/v12_0/fix_quotation_expired_status.py b/erpnext/patches/v12_0/fix_quotation_expired_status.py index ac7e82d2d0d2..e5c4b8c524f4 100644 --- a/erpnext/patches/v12_0/fix_quotation_expired_status.py +++ b/erpnext/patches/v12_0/fix_quotation_expired_status.py @@ -1,5 +1,6 @@ import frappe + def execute(): # fixes status of quotations which have status 'Expired' despite having valid sales order created diff --git a/erpnext/patches/v12_0/generate_leave_ledger_entries.py b/erpnext/patches/v12_0/generate_leave_ledger_entries.py index fe072d7eb96a..aed56d621b84 100644 --- a/erpnext/patches/v12_0/generate_leave_ledger_entries.py +++ b/erpnext/patches/v12_0/generate_leave_ledger_entries.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils import getdate, today + def execute(): """ Generates leave ledger entries for leave allocation/application/encashment for last allocation """ diff --git a/erpnext/patches/v12_0/make_item_manufacturer.py b/erpnext/patches/v12_0/make_item_manufacturer.py index ebc28320aeab..cfc2472e9e28 100644 --- a/erpnext/patches/v12_0/make_item_manufacturer.py +++ b/erpnext/patches/v12_0/make_item_manufacturer.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("stock", "doctype", "item_manufacturer") diff --git a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py index a670adebfd6a..3e9d429ed189 100644 --- a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py +++ b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('accounts', 'doctype', 'bank', force=1) diff --git a/erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py b/erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py index c9293b9b63c5..2662632b52b5 100644 --- a/erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py +++ b/erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): ''' Move credit limit and bypass credit limit to the child table of customer credit limit ''' frappe.reload_doc("Selling", "doctype", "Customer Credit Limit") diff --git a/erpnext/patches/v12_0/move_due_advance_amount_to_pending_amount.py b/erpnext/patches/v12_0/move_due_advance_amount_to_pending_amount.py index 6013eaa29c60..55f5cd52a35b 100644 --- a/erpnext/patches/v12_0/move_due_advance_amount_to_pending_amount.py +++ b/erpnext/patches/v12_0/move_due_advance_amount_to_pending_amount.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): ''' Move from due_advance_amount to pending_amount ''' diff --git a/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py b/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py index 5c3fa5991c92..677a564af0d1 100644 --- a/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py +++ b/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py @@ -1,7 +1,9 @@ -import frappe import json -from six import iteritems + +import frappe from frappe.model.naming import make_autoname +from six import iteritems + def execute(): if "tax_type" not in frappe.db.get_table_columns("Item Tax"): diff --git a/erpnext/patches/v12_0/move_plaid_settings_to_doctype.py b/erpnext/patches/v12_0/move_plaid_settings_to_doctype.py index d2bcb12070c3..dafea280c283 100644 --- a/erpnext/patches/v12_0/move_plaid_settings_to_doctype.py +++ b/erpnext/patches/v12_0/move_plaid_settings_to_doctype.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe diff --git a/erpnext/patches/v12_0/move_target_distribution_from_parent_to_child.py b/erpnext/patches/v12_0/move_target_distribution_from_parent_to_child.py index 97badf355d98..72f4df5cabc3 100644 --- a/erpnext/patches/v12_0/move_target_distribution_from_parent_to_child.py +++ b/erpnext/patches/v12_0/move_target_distribution_from_parent_to_child.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("setup", "doctype", "target_detail") diff --git a/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py b/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py index 46794bebe706..a19e9a96dbaa 100644 --- a/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py +++ b/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals + import frappe -from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty + +from erpnext.stock.stock_balance import get_indented_qty, update_bin_qty + def execute(): bin_details = frappe.db.sql(""" diff --git a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py index be884f94d15e..a690443b52ae 100644 --- a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py +++ b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): frappe.reload_doc("accounts", "doctype", "tax_category") frappe.reload_doc("stock", "doctype", "item_manufacturer") diff --git a/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py b/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py index 4fcffb702a43..fb596d61dd84 100644 --- a/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py +++ b/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils import getdate, today + def execute(): ''' Delete leave ledger entry created via leave applications with status != Approved ''' diff --git a/erpnext/patches/v12_0/remove_duplicate_leave_ledger_entries.py b/erpnext/patches/v12_0/remove_duplicate_leave_ledger_entries.py index 6b1b601db195..6fa1c04dad30 100644 --- a/erpnext/patches/v12_0/remove_duplicate_leave_ledger_entries.py +++ b/erpnext/patches/v12_0/remove_duplicate_leave_ledger_entries.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): """Delete duplicate leave ledger entries of type allocation created.""" frappe.reload_doc('hr', 'doctype', 'leave_ledger_entry') diff --git a/erpnext/patches/v12_0/remove_patient_medical_record_page.py b/erpnext/patches/v12_0/remove_patient_medical_record_page.py index 904bfe4bf19f..bf71c4810ff6 100644 --- a/erpnext/patches/v12_0/remove_patient_medical_record_page.py +++ b/erpnext/patches/v12_0/remove_patient_medical_record_page.py @@ -1,7 +1,9 @@ # Copyright (c) 2019 from __future__ import unicode_literals + import frappe + def execute(): frappe.delete_doc("Page", "medical_record") diff --git a/erpnext/patches/v12_0/rename_account_type_doctype.py b/erpnext/patches/v12_0/rename_account_type_doctype.py index 9a08ad452137..27357a8ef151 100644 --- a/erpnext/patches/v12_0/rename_account_type_doctype.py +++ b/erpnext/patches/v12_0/rename_account_type_doctype.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.rename_doc('DocType', 'Account Type', 'Bank Account Type', force=True) frappe.rename_doc('DocType', 'Account Subtype', 'Bank Account Subtype', force=True) diff --git a/erpnext/patches/v12_0/rename_bank_account_field_in_journal_entry_account.py b/erpnext/patches/v12_0/rename_bank_account_field_in_journal_entry_account.py index 7489ea30a09f..7e02fff4d822 100644 --- a/erpnext/patches/v12_0/rename_bank_account_field_in_journal_entry_account.py +++ b/erpnext/patches/v12_0/rename_bank_account_field_in_journal_entry_account.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): ''' Change the fieldname from bank_account_no to bank_account ''' if not frappe.get_meta("Journal Entry Account").has_field("bank_account"): diff --git a/erpnext/patches/v12_0/rename_bank_reconciliation.py b/erpnext/patches/v12_0/rename_bank_reconciliation.py index 2efa854fba9f..5c79ce2a81b9 100644 --- a/erpnext/patches/v12_0/rename_bank_reconciliation.py +++ b/erpnext/patches/v12_0/rename_bank_reconciliation.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.table_exists("Bank Reconciliation"): frappe.rename_doc('DocType', 'Bank Reconciliation', 'Bank Clearance', force=True) diff --git a/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py b/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py index 978b1c92b964..629cd5bda66f 100644 --- a/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py +++ b/erpnext/patches/v12_0/rename_bank_reconciliation_fields.py @@ -3,6 +3,7 @@ import frappe + def _rename_single_field(**kwargs): count = frappe.db.sql("SELECT COUNT(*) FROM tabSingles WHERE doctype='{doctype}' AND field='{new_name}';".format(**kwargs))[0][0] #nosec if count == 0: diff --git a/erpnext/patches/v12_0/rename_lost_reason_detail.py b/erpnext/patches/v12_0/rename_lost_reason_detail.py index c71b91c92569..337302a3c18e 100644 --- a/erpnext/patches/v12_0/rename_lost_reason_detail.py +++ b/erpnext/patches/v12_0/rename_lost_reason_detail.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists("DocType", "Lost Reason Detail"): frappe.reload_doc("crm", "doctype", "opportunity_lost_reason") diff --git a/erpnext/patches/v12_0/rename_mws_settings_fields.py b/erpnext/patches/v12_0/rename_mws_settings_fields.py index e08e37691533..d5bf38d204d2 100644 --- a/erpnext/patches/v12_0/rename_mws_settings_fields.py +++ b/erpnext/patches/v12_0/rename_mws_settings_fields.py @@ -3,6 +3,7 @@ import frappe + def execute(): count = frappe.db.sql("SELECT COUNT(*) FROM `tabSingles` WHERE doctype='Amazon MWS Settings' AND field='enable_sync';")[0][0] if count == 0: diff --git a/erpnext/patches/v12_0/rename_pos_closing_doctype.py b/erpnext/patches/v12_0/rename_pos_closing_doctype.py index 9d8626b85271..e6fb1f31e165 100644 --- a/erpnext/patches/v12_0/rename_pos_closing_doctype.py +++ b/erpnext/patches/v12_0/rename_pos_closing_doctype.py @@ -1,8 +1,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.table_exists("POS Closing Voucher"): if not frappe.db.exists("DocType", "POS Closing Entry"): diff --git a/erpnext/patches/v12_0/rename_pricing_rule_child_doctypes.py b/erpnext/patches/v12_0/rename_pricing_rule_child_doctypes.py index b9ad622b0ea6..4bf3840b7834 100644 --- a/erpnext/patches/v12_0/rename_pricing_rule_child_doctypes.py +++ b/erpnext/patches/v12_0/rename_pricing_rule_child_doctypes.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe doctypes = { diff --git a/erpnext/patches/v12_0/rename_tolerance_fields.py b/erpnext/patches/v12_0/rename_tolerance_fields.py index 20b096331edf..ca2427bc3dd8 100644 --- a/erpnext/patches/v12_0/rename_tolerance_fields.py +++ b/erpnext/patches/v12_0/rename_tolerance_fields.py @@ -1,6 +1,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("stock", "doctype", "item") frappe.reload_doc("stock", "doctype", "stock_settings") diff --git a/erpnext/patches/v12_0/replace_accounting_with_accounts_in_home_settings.py b/erpnext/patches/v12_0/replace_accounting_with_accounts_in_home_settings.py index f88a22f6c9d6..ff332f771d35 100644 --- a/erpnext/patches/v12_0/replace_accounting_with_accounts_in_home_settings.py +++ b/erpnext/patches/v12_0/replace_accounting_with_accounts_in_home_settings.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.db.sql("""UPDATE `tabUser` SET `home_settings` = REPLACE(`home_settings`, 'Accounting', 'Accounts')""") frappe.cache().delete_key('home_settings') diff --git a/erpnext/patches/v12_0/repost_stock_ledger_entries_for_target_warehouse.py b/erpnext/patches/v12_0/repost_stock_ledger_entries_for_target_warehouse.py index c52f380d8c26..5150430dbb9f 100644 --- a/erpnext/patches/v12_0/repost_stock_ledger_entries_for_target_warehouse.py +++ b/erpnext/patches/v12_0/repost_stock_ledger_entries_for_target_warehouse.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): warehouse_perm = frappe.get_all("User Permission", fields=["count(*) as p_count", "is_default", "user"], filters={"allow": "Warehouse"}, group_by="user") diff --git a/erpnext/patches/v12_0/set_against_blanket_order_in_sales_and_purchase_order.py b/erpnext/patches/v12_0/set_against_blanket_order_in_sales_and_purchase_order.py index 85202bff4d6b..b76e34abe132 100644 --- a/erpnext/patches/v12_0/set_against_blanket_order_in_sales_and_purchase_order.py +++ b/erpnext/patches/v12_0/set_against_blanket_order_in_sales_and_purchase_order.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc('selling', 'doctype', 'sales_order_item', force=True) diff --git a/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py b/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py index b5d7e3dcb9e7..849e96e96658 100644 --- a/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py +++ b/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "accounts_settings") diff --git a/erpnext/patches/v12_0/set_cost_center_in_child_table_of_expense_claim.py b/erpnext/patches/v12_0/set_cost_center_in_child_table_of_expense_claim.py index 4415cfeaba99..d3045a1a5766 100644 --- a/erpnext/patches/v12_0/set_cost_center_in_child_table_of_expense_claim.py +++ b/erpnext/patches/v12_0/set_cost_center_in_child_table_of_expense_claim.py @@ -1,4 +1,6 @@ import frappe + + def execute(): frappe.reload_doc('hr', 'doctype', 'expense_claim_detail') frappe.db.sql(""" diff --git a/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py b/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py index 13110dfe03f5..e363c26a86f9 100644 --- a/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py +++ b/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe from frappe.utils import cint diff --git a/erpnext/patches/v12_0/set_default_homepage_type.py b/erpnext/patches/v12_0/set_default_homepage_type.py index a290e31cf240..1e4333aa4667 100644 --- a/erpnext/patches/v12_0/set_default_homepage_type.py +++ b/erpnext/patches/v12_0/set_default_homepage_type.py @@ -1,4 +1,5 @@ import frappe + def execute(): frappe.db.set_value('Homepage', 'Homepage', 'hero_section_based_on', 'Default') diff --git a/erpnext/patches/v12_0/set_default_payroll_based_on.py b/erpnext/patches/v12_0/set_default_payroll_based_on.py index 038bd6d21ae6..85112f2a540d 100644 --- a/erpnext/patches/v12_0/set_default_payroll_based_on.py +++ b/erpnext/patches/v12_0/set_default_payroll_based_on.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("hr", "doctype", "hr_settings") frappe.db.set_value("HR Settings", None, "payroll_based_on", "Leave") diff --git a/erpnext/patches/v12_0/set_default_shopify_app_type.py b/erpnext/patches/v12_0/set_default_shopify_app_type.py index 65958a25afdf..621564a939d3 100644 --- a/erpnext/patches/v12_0/set_default_shopify_app_type.py +++ b/erpnext/patches/v12_0/set_default_shopify_app_type.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('erpnext_integrations', 'doctype', 'shopify_settings') frappe.db.set_value('Shopify Settings', None, 'app_type', 'Private') diff --git a/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py b/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py index a27c7b24a8cd..49b3bff0f827 100644 --- a/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py +++ b/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from six import iteritems + def execute(): frappe.reload_doctype('Landed Cost Taxes and Charges') diff --git a/erpnext/patches/v12_0/set_gst_category.py b/erpnext/patches/v12_0/set_gst_category.py index cc093953bf4f..094e2a3134b5 100644 --- a/erpnext/patches/v12_0/set_gst_category.py +++ b/erpnext/patches/v12_0/set_gst_category.py @@ -1,6 +1,8 @@ import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/set_italian_import_supplier_invoice_permissions.py b/erpnext/patches/v12_0/set_italian_import_supplier_invoice_permissions.py index 8fdc73b8ff16..a991b3c15df3 100644 --- a/erpnext/patches/v12_0/set_italian_import_supplier_invoice_permissions.py +++ b/erpnext/patches/v12_0/set_italian_import_supplier_invoice_permissions.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + from erpnext.regional.italy.setup import add_permissions + def execute(): countries = frappe.get_all("Company", fields="country") countries = [country["country"] for country in countries] diff --git a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py index a5c8f7524a7f..decc49cb382d 100644 --- a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py +++ b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py @@ -2,10 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils import flt + from erpnext.stock.get_item_details import get_conversion_factor + def execute(): frappe.reload_doc('buying', 'doctype', 'request_for_quotation_item') diff --git a/erpnext/patches/v12_0/set_payment_entry_status.py b/erpnext/patches/v12_0/set_payment_entry_status.py index 84645a386390..f8792952d8be 100644 --- a/erpnext/patches/v12_0/set_payment_entry_status.py +++ b/erpnext/patches/v12_0/set_payment_entry_status.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doctype("Payment Entry") frappe.db.sql("""update `tabPayment Entry` set status = CASE diff --git a/erpnext/patches/v12_0/set_permission_einvoicing.py b/erpnext/patches/v12_0/set_permission_einvoicing.py index e2235105f947..01cab14db9de 100644 --- a/erpnext/patches/v12_0/set_permission_einvoicing.py +++ b/erpnext/patches/v12_0/set_permission_einvoicing.py @@ -1,7 +1,9 @@ import frappe -from erpnext.regional.italy.setup import make_custom_fields from frappe.permissions import add_permission, update_permission_property +from erpnext.regional.italy.setup import make_custom_fields + + def execute(): company = frappe.get_all('Company', filters = {'country': 'Italy'}) diff --git a/erpnext/patches/v12_0/set_priority_for_support.py b/erpnext/patches/v12_0/set_priority_for_support.py index 66696bee5414..6d7d09934603 100644 --- a/erpnext/patches/v12_0/set_priority_for_support.py +++ b/erpnext/patches/v12_0/set_priority_for_support.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc("support", "doctype", "issue_priority") frappe.reload_doc("support", "doctype", "service_level_priority") diff --git a/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py b/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py index 6c11cb415f96..f8ed689a657e 100644 --- a/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py +++ b/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py @@ -1,7 +1,9 @@ import frappe from frappe.utils import flt + from erpnext.selling.doctype.sales_order.sales_order import update_produced_qty_in_so_item + def execute(): frappe.reload_doctype('Sales Order Item') frappe.reload_doctype('Sales Order') diff --git a/erpnext/patches/v12_0/set_production_capacity_in_workstation.py b/erpnext/patches/v12_0/set_production_capacity_in_workstation.py index babaebeaefc5..248d33504e15 100644 --- a/erpnext/patches/v12_0/set_production_capacity_in_workstation.py +++ b/erpnext/patches/v12_0/set_production_capacity_in_workstation.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("manufacturing", "doctype", "workstation") diff --git a/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py b/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py index e54c7f315c62..73c6ce8220e6 100644 --- a/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py +++ b/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("Hub Node", "doctype", "Hub Tracked Item") if not frappe.db.a_row_exists("Hub Tracked Item"): diff --git a/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py b/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py index 52c9a2d7b3c4..cad947fadcd8 100644 --- a/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py +++ b/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals -import frappe + from collections import defaultdict +import frappe + + def execute(): frappe.reload_doc('stock', 'doctype', 'delivery_note_item', force=True) diff --git a/erpnext/patches/v12_0/set_quotation_status.py b/erpnext/patches/v12_0/set_quotation_status.py index 87643a235451..bb172769ebb5 100644 --- a/erpnext/patches/v12_0/set_quotation_status.py +++ b/erpnext/patches/v12_0/set_quotation_status.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql(""" UPDATE `tabQuotation` set status = 'Open' diff --git a/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py b/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py index 88c3e2e30245..f8b510e3c378 100644 --- a/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py +++ b/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): purchase_receipts = frappe.db.sql(""" SELECT diff --git a/erpnext/patches/v12_0/set_serial_no_status.py b/erpnext/patches/v12_0/set_serial_no_status.py index 3b5f5ef34078..9a05e707a65c 100644 --- a/erpnext/patches/v12_0/set_serial_no_status.py +++ b/erpnext/patches/v12_0/set_serial_no_status.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.utils import getdate, nowdate + def execute(): frappe.reload_doc('stock', 'doctype', 'serial_no') diff --git a/erpnext/patches/v12_0/set_task_status.py b/erpnext/patches/v12_0/set_task_status.py index dbd7e5a8181f..1b4955a75be7 100644 --- a/erpnext/patches/v12_0/set_task_status.py +++ b/erpnext/patches/v12_0/set_task_status.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doctype('Task') diff --git a/erpnext/patches/v12_0/set_updated_purpose_in_pick_list.py b/erpnext/patches/v12_0/set_updated_purpose_in_pick_list.py index 1cc37caba42b..21ee23b20727 100644 --- a/erpnext/patches/v12_0/set_updated_purpose_in_pick_list.py +++ b/erpnext/patches/v12_0/set_updated_purpose_in_pick_list.py @@ -5,6 +5,7 @@ import frappe + def execute(): frappe.reload_doc("stock", "doctype", "pick_list") frappe.db.sql("""UPDATE `tabPick List` set purpose = 'Delivery' diff --git a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py index 4a6e2288564d..72d5521f44d4 100644 --- a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py +++ b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("buying", "doctype", "supplier_quotation") frappe.db.sql("""UPDATE `tabSupplier Quotation` diff --git a/erpnext/patches/v12_0/setup_einvoice_fields.py b/erpnext/patches/v12_0/setup_einvoice_fields.py index 82b14fc9d604..c17666add188 100644 --- a/erpnext/patches/v12_0/setup_einvoice_fields.py +++ b/erpnext/patches/v12_0/setup_einvoice_fields.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + from erpnext.regional.india.setup import add_permissions, add_print_formats + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py b/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py index 2319c17b34c6..3f90a03020f6 100644 --- a/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py +++ b/erpnext/patches/v12_0/show_einvoice_irn_cancelled_field.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v12_0/stock_entry_enhancements.py b/erpnext/patches/v12_0/stock_entry_enhancements.py index 17fdcd9395ad..b99501d942d0 100644 --- a/erpnext/patches/v12_0/stock_entry_enhancements.py +++ b/erpnext/patches/v12_0/stock_entry_enhancements.py @@ -3,9 +3,11 @@ from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): create_stock_entry_types() diff --git a/erpnext/patches/v12_0/unhide_cost_center_field.py b/erpnext/patches/v12_0/unhide_cost_center_field.py index 3474a34af4be..823dd226372d 100644 --- a/erpnext/patches/v12_0/unhide_cost_center_field.py +++ b/erpnext/patches/v12_0/unhide_cost_center_field.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql(""" DELETE FROM `tabProperty Setter` diff --git a/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py b/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py index b8efb210a033..61c4c601b55f 100644 --- a/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py +++ b/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe diff --git a/erpnext/patches/v12_0/update_address_template_for_india.py b/erpnext/patches/v12_0/update_address_template_for_india.py index 0d582da4b5c9..d41aae2a8761 100644 --- a/erpnext/patches/v12_0/update_address_template_for_india.py +++ b/erpnext/patches/v12_0/update_address_template_for_india.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + from erpnext.regional.address_template.setup import set_up_address_templates + def execute(): if frappe.db.get_value('Company', {'country': 'India'}, 'name'): address_template = frappe.db.get_value('Address Template', 'India', 'template') diff --git a/erpnext/patches/v12_0/update_appointment_reminder_scheduler_entry.py b/erpnext/patches/v12_0/update_appointment_reminder_scheduler_entry.py index f45166496100..024cb2b76306 100644 --- a/erpnext/patches/v12_0/update_appointment_reminder_scheduler_entry.py +++ b/erpnext/patches/v12_0/update_appointment_reminder_scheduler_entry.py @@ -1,5 +1,6 @@ import frappe + def execute(): job = frappe.db.exists('Scheduled Job Type', 'patient_appointment.send_appointment_reminder') if job: diff --git a/erpnext/patches/v12_0/update_bom_in_so_mr.py b/erpnext/patches/v12_0/update_bom_in_so_mr.py index 8a871718133d..283407567f26 100644 --- a/erpnext/patches/v12_0/update_bom_in_so_mr.py +++ b/erpnext/patches/v12_0/update_bom_in_so_mr.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("stock", "doctype", "material_request_item") frappe.reload_doc("selling", "doctype", "sales_order_item") diff --git a/erpnext/patches/v12_0/update_due_date_in_gle.py b/erpnext/patches/v12_0/update_due_date_in_gle.py index 34848725cec8..60ad32511460 100644 --- a/erpnext/patches/v12_0/update_due_date_in_gle.py +++ b/erpnext/patches/v12_0/update_due_date_in_gle.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "gl_entry") diff --git a/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py b/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py index c45f6221f932..208076b14964 100644 --- a/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py +++ b/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.utils import add_days, getdate, today + def execute(): if frappe.db.exists('DocType', 'Email Campaign'): email_campaign = frappe.get_all('Email Campaign') diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py index 9e5f599d2c8a..dd2dce7dd33c 100644 --- a/erpnext/patches/v12_0/update_ewaybill_field_position.py +++ b/erpnext/patches/v12_0/update_ewaybill_field_position.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/update_gst_category.py b/erpnext/patches/v12_0/update_gst_category.py index 1a54216b8850..bee89199316e 100644 --- a/erpnext/patches/v12_0/update_gst_category.py +++ b/erpnext/patches/v12_0/update_gst_category.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/update_healthcare_refactored_changes.py b/erpnext/patches/v12_0/update_healthcare_refactored_changes.py index d0b04433979c..bfad3ddcba74 100644 --- a/erpnext/patches/v12_0/update_healthcare_refactored_changes.py +++ b/erpnext/patches/v12_0/update_healthcare_refactored_changes.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field -from frappe.modules import scrub, get_doctype_module +from frappe.modules import get_doctype_module, scrub field_rename_map = { 'Healthcare Settings': [ diff --git a/erpnext/patches/v12_0/update_is_cancelled_field.py b/erpnext/patches/v12_0/update_is_cancelled_field.py index f69dcc95794a..3e7c37f0d196 100644 --- a/erpnext/patches/v12_0/update_is_cancelled_field.py +++ b/erpnext/patches/v12_0/update_is_cancelled_field.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): try: frappe.db.sql("UPDATE `tabStock Ledger Entry` SET is_cancelled = 0 where is_cancelled in ('', NULL, 'No')") diff --git a/erpnext/patches/v12_0/update_item_tax_template_company.py b/erpnext/patches/v12_0/update_item_tax_template_company.py index e15894df890f..3ad983d686f8 100644 --- a/erpnext/patches/v12_0/update_item_tax_template_company.py +++ b/erpnext/patches/v12_0/update_item_tax_template_company.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('accounts', 'doctype', 'item_tax_template') diff --git a/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py b/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py index 6ebaf48e0e83..09e2319eb806 100644 --- a/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py +++ b/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py @@ -1,6 +1,11 @@ from __future__ import unicode_literals + import frappe -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_doctypes_with_dimensions + +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_doctypes_with_dimensions, +) + def execute(): accounting_dimensions = frappe.db.sql("""select fieldname from diff --git a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py index 09f070742992..b85a8e084b6b 100644 --- a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py +++ b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import frappe -from frappe.utils import getdate, flt +from frappe.utils import flt, getdate + from erpnext.setup.utils import get_exchange_rate + def execute(): frappe.reload_doc("manufacturing", "doctype", "bom") frappe.reload_doc("manufacturing", "doctype", "bom_item") diff --git a/erpnext/patches/v12_0/update_price_or_product_discount.py b/erpnext/patches/v12_0/update_price_or_product_discount.py index 3a8cd43e302d..4ff39257688c 100644 --- a/erpnext/patches/v12_0/update_price_or_product_discount.py +++ b/erpnext/patches/v12_0/update_price_or_product_discount.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "pricing_rule") diff --git a/erpnext/patches/v12_0/update_pricing_rule_fields.py b/erpnext/patches/v12_0/update_pricing_rule_fields.py index 985613a9739b..6f102e9b42b6 100644 --- a/erpnext/patches/v12_0/update_pricing_rule_fields.py +++ b/erpnext/patches/v12_0/update_pricing_rule_fields.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe parentfield = { diff --git a/erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py b/erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py index 8dbfa1866d36..25cf6b97e3b8 100644 --- a/erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py +++ b/erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py @@ -1,6 +1,8 @@ import frappe + from erpnext.regional.india import states + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/update_uom_conversion_factor.py b/erpnext/patches/v12_0/update_uom_conversion_factor.py index 24914fd13bc6..eaabd56825e6 100644 --- a/erpnext/patches/v12_0/update_uom_conversion_factor.py +++ b/erpnext/patches/v12_0/update_uom_conversion_factor.py @@ -1,5 +1,9 @@ from __future__ import unicode_literals -import frappe, json + +import json + +import frappe + def execute(): from erpnext.setup.setup_wizard.operations.install_fixtures import add_uom_data diff --git a/erpnext/patches/v12_0/update_vehicle_no_reqd_condition.py b/erpnext/patches/v12_0/update_vehicle_no_reqd_condition.py index 01a4ae04add3..69bfaaa2cb16 100644 --- a/erpnext/patches/v12_0/update_vehicle_no_reqd_condition.py +++ b/erpnext/patches/v12_0/update_vehicle_no_reqd_condition.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc('custom', 'doctype', 'custom_field') company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v13_0/add_custom_field_for_south_africa.py b/erpnext/patches/v13_0/add_custom_field_for_south_africa.py index 73ff1cad5b62..93a7de6a2105 100644 --- a/erpnext/patches/v13_0/add_custom_field_for_south_africa.py +++ b/erpnext/patches/v13_0/add_custom_field_for_south_africa.py @@ -2,8 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.regional.south_africa.setup import make_custom_fields, add_permissions + +from erpnext.regional.south_africa.setup import add_permissions, make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'South Africa'}) diff --git a/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py b/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py index 0d8109c41ad9..bd18b9bd173a 100644 --- a/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py +++ b/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt import frappe -from frappe.utils import cstr, flt, cint -from erpnext.stock.stock_ledger import make_sl_entries +from frappe.utils import cint, cstr, flt + from erpnext.controllers.stock_controller import create_repost_item_valuation_entry +from erpnext.stock.stock_ledger import make_sl_entries + def execute(): if not frappe.db.has_column('Work Order', 'has_batch_no'): diff --git a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py index a7b66f0d2bb9..600a8787d444 100644 --- a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py +++ b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py @@ -1,6 +1,11 @@ from __future__ import unicode_literals + import frappe -from frappe.custom.doctype.property_setter.property_setter import make_property_setter, delete_property_setter +from frappe.custom.doctype.property_setter.property_setter import ( + delete_property_setter, + make_property_setter, +) + def execute(): frappe.reload_doc("projects", "doctype", "project") diff --git a/erpnext/patches/v13_0/add_po_to_global_search.py b/erpnext/patches/v13_0/add_po_to_global_search.py index 1c60b18e5b2e..15b7c71dc2c0 100644 --- a/erpnext/patches/v13_0/add_po_to_global_search.py +++ b/erpnext/patches/v13_0/add_po_to_global_search.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe diff --git a/erpnext/patches/v13_0/add_standard_navbar_items.py b/erpnext/patches/v13_0/add_standard_navbar_items.py index d05b258db0c9..699c480c8721 100644 --- a/erpnext/patches/v13_0/add_standard_navbar_items.py +++ b/erpnext/patches/v13_0/add_standard_navbar_items.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + # import frappe from erpnext.setup.install import add_standard_navbar_items + def execute(): # Add standard navbar items for ERPNext in Navbar Settings add_standard_navbar_items() diff --git a/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py index 7de9fa1e23e9..07d1cee64f8e 100644 --- a/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py +++ b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doctype("Buying Settings") buying_settings = frappe.get_single("Buying Settings") diff --git a/erpnext/patches/v13_0/change_default_pos_print_format.py b/erpnext/patches/v13_0/change_default_pos_print_format.py index 1e4f383dda69..5a0320a7eb2b 100644 --- a/erpnext/patches/v13_0/change_default_pos_print_format.py +++ b/erpnext/patches/v13_0/change_default_pos_print_format.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.db.sql( """UPDATE `tabPOS Profile` profile diff --git a/erpnext/patches/v13_0/check_is_income_tax_component.py b/erpnext/patches/v13_0/check_is_income_tax_component.py index 7a52dc88d210..aac87ba36fa1 100644 --- a/erpnext/patches/v13_0/check_is_income_tax_component.py +++ b/erpnext/patches/v13_0/check_is_income_tax_component.py @@ -3,9 +3,12 @@ from __future__ import unicode_literals -import frappe, erpnext +import frappe + +import erpnext from erpnext.regional.india.setup import setup + def execute(): doctypes = ['salary_component', diff --git a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py index 341955aa35f3..66ac62fdc4ca 100644 --- a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py +++ b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('stock', 'doctype', 'quality_inspection_parameter') diff --git a/erpnext/patches/v13_0/create_healthcare_custom_fields_in_stock_entry_detail.py b/erpnext/patches/v13_0/create_healthcare_custom_fields_in_stock_entry_detail.py index 08d4876c0d1f..543faeb74ac8 100644 --- a/erpnext/patches/v13_0/create_healthcare_custom_fields_in_stock_entry_detail.py +++ b/erpnext/patches/v13_0/create_healthcare_custom_fields_in_stock_entry_detail.py @@ -1,7 +1,9 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + from erpnext.domains.healthcare import data + def execute(): if 'Healthcare' not in frappe.get_active_domains(): return diff --git a/erpnext/patches/v13_0/create_leave_policy_assignment_based_on_employee_current_leave_policy.py b/erpnext/patches/v13_0/create_leave_policy_assignment_based_on_employee_current_leave_policy.py index 9a354537f7df..b1b5c24adc87 100644 --- a/erpnext/patches/v13_0/create_leave_policy_assignment_based_on_employee_current_leave_policy.py +++ b/erpnext/patches/v13_0/create_leave_policy_assignment_based_on_employee_current_leave_policy.py @@ -5,6 +5,7 @@ import frappe + def execute(): if "leave_policy" in frappe.db.get_table_columns("Employee"): employees_with_leave_policy = frappe.db.sql("SELECT name, leave_policy FROM `tabEmployee` WHERE leave_policy IS NOT NULL and leave_policy != ''", as_dict = 1) diff --git a/erpnext/patches/v13_0/create_uae_pos_invoice_fields.py b/erpnext/patches/v13_0/create_uae_pos_invoice_fields.py index 6ad3402ba022..3bfa78fa2826 100644 --- a/erpnext/patches/v13_0/create_uae_pos_invoice_fields.py +++ b/erpnext/patches/v13_0/create_uae_pos_invoice_fields.py @@ -4,8 +4,10 @@ from __future__ import unicode_literals import frappe + from erpnext.regional.united_arab_emirates.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': ['in', ['Saudi Arabia', 'United Arab Emirates']]}) if not company: diff --git a/erpnext/patches/v13_0/delete_old_bank_reconciliation_doctypes.py b/erpnext/patches/v13_0/delete_old_bank_reconciliation_doctypes.py index 77a23cfc3f8f..089bbe3b48fc 100644 --- a/erpnext/patches/v13_0/delete_old_bank_reconciliation_doctypes.py +++ b/erpnext/patches/v13_0/delete_old_bank_reconciliation_doctypes.py @@ -6,6 +6,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): doctypes = [ "Bank Statement Settings", diff --git a/erpnext/patches/v13_0/delete_old_purchase_reports.py b/erpnext/patches/v13_0/delete_old_purchase_reports.py index 57620d3e9868..3cb7e120d673 100644 --- a/erpnext/patches/v13_0/delete_old_purchase_reports.py +++ b/erpnext/patches/v13_0/delete_old_purchase_reports.py @@ -4,8 +4,10 @@ from __future__ import unicode_literals import frappe + from erpnext.accounts.utils import check_and_delete_linked_reports + def execute(): reports_to_delete = ["Requested Items To Be Ordered", "Purchase Order Items To Be Received or Billed","Purchase Order Items To Be Received", diff --git a/erpnext/patches/v13_0/delete_old_sales_reports.py b/erpnext/patches/v13_0/delete_old_sales_reports.py index 905a42c0c4c1..c9a366655ce6 100644 --- a/erpnext/patches/v13_0/delete_old_sales_reports.py +++ b/erpnext/patches/v13_0/delete_old_sales_reports.py @@ -4,8 +4,10 @@ from __future__ import unicode_literals import frappe + from erpnext.accounts.utils import check_and_delete_linked_reports + def execute(): reports_to_delete = ["Ordered Items To Be Delivered", "Ordered Items To Be Billed"] diff --git a/erpnext/patches/v13_0/delete_orphaned_tables.py b/erpnext/patches/v13_0/delete_orphaned_tables.py index 50a4a0efcbed..1ea22d635613 100644 --- a/erpnext/patches/v13_0/delete_orphaned_tables.py +++ b/erpnext/patches/v13_0/delete_orphaned_tables.py @@ -6,6 +6,7 @@ import frappe from frappe.utils import getdate + def execute(): frappe.reload_doc('setup', 'doctype', 'transaction_deletion_record') diff --git a/erpnext/patches/v13_0/delete_report_requested_items_to_order.py b/erpnext/patches/v13_0/delete_report_requested_items_to_order.py index 8d6340d44ef1..87565f0fe421 100644 --- a/erpnext/patches/v13_0/delete_report_requested_items_to_order.py +++ b/erpnext/patches/v13_0/delete_report_requested_items_to_order.py @@ -1,5 +1,6 @@ import frappe + def execute(): """ Check for one or multiple Auto Email Reports and delete """ auto_email_reports = frappe.db.get_values("Auto Email Report", {"report": "Requested Items to Order"}, ["name"]) diff --git a/erpnext/patches/v13_0/drop_razorpay_payload_column.py b/erpnext/patches/v13_0/drop_razorpay_payload_column.py index 76b8041cd946..a7aee521983f 100644 --- a/erpnext/patches/v13_0/drop_razorpay_payload_column.py +++ b/erpnext/patches/v13_0/drop_razorpay_payload_column.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists("DocType", "Membership"): if 'webhook_payload' in frappe.db.get_table_columns("Membership"): diff --git a/erpnext/patches/v13_0/fix_non_unique_represents_company.py b/erpnext/patches/v13_0/fix_non_unique_represents_company.py index f20c73ae1026..e91c1db4dd48 100644 --- a/erpnext/patches/v13_0/fix_non_unique_represents_company.py +++ b/erpnext/patches/v13_0/fix_non_unique_represents_company.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.db.sql(""" update tabCustomer diff --git a/erpnext/patches/v13_0/germany_make_custom_fields.py b/erpnext/patches/v13_0/germany_make_custom_fields.py index 41ab945eb12b..86ad18859907 100644 --- a/erpnext/patches/v13_0/germany_make_custom_fields.py +++ b/erpnext/patches/v13_0/germany_make_custom_fields.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe + from erpnext.regional.germany.setup import make_custom_fields diff --git a/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py b/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py index 2549a1e91eed..f2976544a406 100644 --- a/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py +++ b/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field diff --git a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py index c4ad1b7ff4fb..9afa868c94fc 100644 --- a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py +++ b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py @@ -1,8 +1,10 @@ import frappe from frappe import _ -from frappe.utils import getdate, get_time, today -from erpnext.stock.stock_ledger import update_entries_after +from frappe.utils import get_time, getdate, today + from erpnext.accounts.utils import update_gl_entries_after +from erpnext.stock.stock_ledger import update_entries_after + def execute(): for doctype in ('repost_item_valuation', 'stock_entry_detail', 'purchase_receipt_item', diff --git a/erpnext/patches/v13_0/loyalty_points_entry_for_pos_invoice.py b/erpnext/patches/v13_0/loyalty_points_entry_for_pos_invoice.py index d2228c3bf319..43c6c4941ea7 100644 --- a/erpnext/patches/v13_0/loyalty_points_entry_for_pos_invoice.py +++ b/erpnext/patches/v13_0/loyalty_points_entry_for_pos_invoice.py @@ -5,6 +5,7 @@ import frappe + def execute(): '''`sales_invoice` field from loyalty point entry is splitted into `invoice_type` & `invoice` fields''' diff --git a/erpnext/patches/v13_0/make_non_standard_user_type.py b/erpnext/patches/v13_0/make_non_standard_user_type.py index 73361f00262a..746e4080b69e 100644 --- a/erpnext/patches/v13_0/make_non_standard_user_type.py +++ b/erpnext/patches/v13_0/make_non_standard_user_type.py @@ -2,10 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from six import iteritems + from erpnext.setup.install import add_non_standard_user_types + def execute(): doctype_dict = { 'projects': ['Timesheet'], diff --git a/erpnext/patches/v13_0/move_branch_code_to_bank_account.py b/erpnext/patches/v13_0/move_branch_code_to_bank_account.py index 24d9196d29f6..9116f5835a17 100644 --- a/erpnext/patches/v13_0/move_branch_code_to_bank_account.py +++ b/erpnext/patches/v13_0/move_branch_code_to_bank_account.py @@ -5,6 +5,7 @@ import frappe + def execute(): frappe.reload_doc('accounts', 'doctype', 'bank_account') diff --git a/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py b/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py index 4d7c85ce2d15..064e8d71a04b 100644 --- a/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py +++ b/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py @@ -5,6 +5,7 @@ import frappe + def execute(): frappe.db.sql("""UPDATE `tabPrint Format` SET module = 'Payroll' diff --git a/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py b/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py index a901064b8899..85d5109248d6 100644 --- a/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py +++ b/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py @@ -5,6 +5,7 @@ import frappe + def execute(): data = frappe.db.sql('''SELECT * FROM `tabSingles` diff --git a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py index 426292067ab5..1dbebff8ae61 100644 --- a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py +++ b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py @@ -6,6 +6,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): if not (frappe.db.table_exists("Payroll Period") and frappe.db.table_exists("Taxable Salary Slab")): return diff --git a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py index 15aeb76e53f2..bb539a7962c7 100644 --- a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py +++ b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py @@ -2,6 +2,7 @@ import frappe + def execute(): if not frappe.db.table_exists("Additional Salary"): return diff --git a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py index 0de3728f5c61..e74ffc714c22 100644 --- a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py +++ b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py @@ -4,7 +4,9 @@ from __future__ import unicode_literals import frappe + from erpnext.setup.install import create_print_uom_after_qty_custom_field + def execute(): create_print_uom_after_qty_custom_field() diff --git a/erpnext/patches/v13_0/remove_attribute_field_from_item_variant_setting.py b/erpnext/patches/v13_0/remove_attribute_field_from_item_variant_setting.py index 53da7006b98f..bbe3eb5815b7 100644 --- a/erpnext/patches/v13_0/remove_attribute_field_from_item_variant_setting.py +++ b/erpnext/patches/v13_0/remove_attribute_field_from_item_variant_setting.py @@ -1,5 +1,6 @@ import frappe + def execute(): """Remove has_variants and attribute fields from item variant settings.""" frappe.reload_doc("stock", "doctype", "Item Variant Settings") diff --git a/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py b/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py index 491dc82f7844..2a04211a407e 100644 --- a/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py +++ b/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("Healthcare", "doctype", "Inpatient Record") if frappe.db.has_column("Inpatient Record", "discharge_date"): diff --git a/erpnext/patches/v13_0/rename_discharge_ordered_date_in_ip_record.py b/erpnext/patches/v13_0/rename_discharge_ordered_date_in_ip_record.py index 52a5885fc2f0..cf5cae438e6d 100644 --- a/erpnext/patches/v13_0/rename_discharge_ordered_date_in_ip_record.py +++ b/erpnext/patches/v13_0/rename_discharge_ordered_date_in_ip_record.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("Healthcare", "doctype", "Inpatient Record") if frappe.db.has_column("Inpatient Record", "discharge_ordered_date"): diff --git a/erpnext/patches/v13_0/rename_issue_doctype_fields.py b/erpnext/patches/v13_0/rename_issue_doctype_fields.py index 4885c0b7afa6..4aeafeabe743 100644 --- a/erpnext/patches/v13_0/rename_issue_doctype_fields.py +++ b/erpnext/patches/v13_0/rename_issue_doctype_fields.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): if frappe.db.exists('DocType', 'Issue'): issues = frappe.db.get_all('Issue', fields=['name', 'response_by_variance', 'resolution_by_variance', 'mins_to_first_response'], diff --git a/erpnext/patches/v13_0/rename_issue_status_hold_to_on_hold.py b/erpnext/patches/v13_0/rename_issue_status_hold_to_on_hold.py index 4ef04ad9b1b1..1d245db4d596 100644 --- a/erpnext/patches/v13_0/rename_issue_status_hold_to_on_hold.py +++ b/erpnext/patches/v13_0/rename_issue_status_hold_to_on_hold.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists('DocType', 'Issue'): frappe.reload_doc("support", "doctype", "issue") diff --git a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py index f60567b6b218..23a782a1e82a 100644 --- a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py +++ b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): if frappe.db.table_exists("Membership Settings"): frappe.rename_doc("DocType", "Membership Settings", "Non Profit Settings") diff --git a/erpnext/patches/v13_0/rename_stop_to_send_birthday_reminders.py b/erpnext/patches/v13_0/rename_stop_to_send_birthday_reminders.py index b3ff610a6c2e..28054317ad37 100644 --- a/erpnext/patches/v13_0/rename_stop_to_send_birthday_reminders.py +++ b/erpnext/patches/v13_0/rename_stop_to_send_birthday_reminders.py @@ -1,6 +1,7 @@ import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc('hr', 'doctype', 'hr_settings') diff --git a/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py b/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py index d8bcd7f07752..989f1a0a281f 100644 --- a/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py +++ b/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): if frappe.db.exists("Page", "point-of-sale"): frappe.rename_doc("Page", "pos", "point-of-sale", 1, 1) diff --git a/erpnext/patches/v13_0/replace_pos_payment_mode_table.py b/erpnext/patches/v13_0/replace_pos_payment_mode_table.py index bc1fc98e4da3..103c79177f10 100644 --- a/erpnext/patches/v13_0/replace_pos_payment_mode_table.py +++ b/erpnext/patches/v13_0/replace_pos_payment_mode_table.py @@ -5,6 +5,7 @@ import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "pos_payment_method") pos_profiles = frappe.get_all("POS Profile") diff --git a/erpnext/patches/v13_0/reset_clearance_date_for_intracompany_payment_entries.py b/erpnext/patches/v13_0/reset_clearance_date_for_intracompany_payment_entries.py index 120633fbb333..f8c4c1031a0f 100644 --- a/erpnext/patches/v13_0/reset_clearance_date_for_intracompany_payment_entries.py +++ b/erpnext/patches/v13_0/reset_clearance_date_for_intracompany_payment_entries.py @@ -5,6 +5,7 @@ import frappe + def execute(): """ Reset Clearance Date for Payment Entries of type Internal Transfer that have only been reconciled with one Bank Transaction. diff --git a/erpnext/patches/v13_0/set_app_name.py b/erpnext/patches/v13_0/set_app_name.py index 3f886f1d1593..75d28283c8c6 100644 --- a/erpnext/patches/v13_0/set_app_name.py +++ b/erpnext/patches/v13_0/set_app_name.py @@ -1,6 +1,7 @@ import frappe from frappe import _ + def execute(): frappe.reload_doctype("System Settings") settings = frappe.get_doc("System Settings") diff --git a/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py b/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py index a5b93f630713..e9396c2df29c 100644 --- a/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py +++ b/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): company = frappe.db.get_single_value('Global Defaults', 'default_company') doctypes = ['Clinical Procedure', 'Inpatient Record', 'Lab Test', 'Sample Collection', 'Patient Appointment', 'Patient Encounter', 'Vital Signs', 'Therapy Session', 'Therapy Plan', 'Patient Assessment'] diff --git a/erpnext/patches/v13_0/set_company_in_leave_ledger_entry.py b/erpnext/patches/v13_0/set_company_in_leave_ledger_entry.py index 13ec41ec55ef..c744f35b72f6 100644 --- a/erpnext/patches/v13_0/set_company_in_leave_ledger_entry.py +++ b/erpnext/patches/v13_0/set_company_in_leave_ledger_entry.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc('HR', 'doctype', 'Leave Allocation') frappe.reload_doc('HR', 'doctype', 'Leave Ledger Entry') diff --git a/erpnext/patches/v13_0/set_operation_time_based_on_operating_cost.py b/erpnext/patches/v13_0/set_operation_time_based_on_operating_cost.py index 4acbdd63a001..0366d4902dcd 100644 --- a/erpnext/patches/v13_0/set_operation_time_based_on_operating_cost.py +++ b/erpnext/patches/v13_0/set_operation_time_based_on_operating_cost.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc('manufacturing', 'doctype', 'bom') frappe.reload_doc('manufacturing', 'doctype', 'bom_operation') diff --git a/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py b/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py index 7f75946af9fb..da889e61babb 100644 --- a/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py +++ b/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): """Set the payment gateway account as Email for all the existing payment channel.""" doc_meta = frappe.get_meta("Payment Gateway Account") diff --git a/erpnext/patches/v13_0/set_pos_closing_as_failed.py b/erpnext/patches/v13_0/set_pos_closing_as_failed.py index 7968e74f50f8..8c7f5088b742 100644 --- a/erpnext/patches/v13_0/set_pos_closing_as_failed.py +++ b/erpnext/patches/v13_0/set_pos_closing_as_failed.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('accounts', 'doctype', 'pos_closing_entry') diff --git a/erpnext/patches/v13_0/set_training_event_attendance.py b/erpnext/patches/v13_0/set_training_event_attendance.py index 3db183fb2ab6..4e3d8f5e6a5b 100644 --- a/erpnext/patches/v13_0/set_training_event_attendance.py +++ b/erpnext/patches/v13_0/set_training_event_attendance.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('hr', 'doctype', 'training_event') frappe.reload_doc('hr', 'doctype', 'training_event_employee') diff --git a/erpnext/patches/v13_0/set_youtube_video_id.py b/erpnext/patches/v13_0/set_youtube_video_id.py index f6104d1579f2..1594e52e4e51 100644 --- a/erpnext/patches/v13_0/set_youtube_video_id.py +++ b/erpnext/patches/v13_0/set_youtube_video_id.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.utilities.doctype.video.video import get_id_from_url + def execute(): frappe.reload_doc("utilities", "doctype","video") diff --git a/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py b/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py index c8c160fae715..a6a3ff3be4bc 100644 --- a/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py +++ b/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.regional.india.setup import add_custom_roles_for_reports + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py b/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py index 833c355d5f89..7a2a25396703 100644 --- a/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py +++ b/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py @@ -1,6 +1,8 @@ import frappe + from erpnext.regional.india.setup import make_custom_fields + def execute(): if frappe.get_all('Company', filters = {'country': 'India'}): make_custom_fields() diff --git a/erpnext/patches/v13_0/setup_gratuity_rule_for_india_and_uae.py b/erpnext/patches/v13_0/setup_gratuity_rule_for_india_and_uae.py index 01fd6a158e9c..01e75a6009b3 100644 --- a/erpnext/patches/v13_0/setup_gratuity_rule_for_india_and_uae.py +++ b/erpnext/patches/v13_0/setup_gratuity_rule_for_india_and_uae.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('payroll', 'doctype', 'gratuity_rule') frappe.reload_doc('payroll', 'doctype', 'gratuity_rule_slab') diff --git a/erpnext/patches/v13_0/setup_patient_history_settings_for_standard_doctypes.py b/erpnext/patches/v13_0/setup_patient_history_settings_for_standard_doctypes.py index 83581dd41447..80622d46096f 100644 --- a/erpnext/patches/v13_0/setup_patient_history_settings_for_standard_doctypes.py +++ b/erpnext/patches/v13_0/setup_patient_history_settings_for_standard_doctypes.py @@ -1,7 +1,10 @@ from __future__ import unicode_literals + import frappe + from erpnext.healthcare.setup import setup_patient_history_settings + def execute(): if "Healthcare" not in frappe.get_active_domains(): return diff --git a/erpnext/patches/v13_0/setup_uae_vat_fields.py b/erpnext/patches/v13_0/setup_uae_vat_fields.py index 1830bab02ba2..d89e0521d8d4 100644 --- a/erpnext/patches/v13_0/setup_uae_vat_fields.py +++ b/erpnext/patches/v13_0/setup_uae_vat_fields.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt import frappe + from erpnext.regional.united_arab_emirates.setup import setup + def execute(): company = frappe.get_all('Company', filters = {'country': 'United Arab Emirates'}) if not company: diff --git a/erpnext/patches/v13_0/stock_entry_enhancements.py b/erpnext/patches/v13_0/stock_entry_enhancements.py index 7b93ce357680..5fcd6a3a6253 100644 --- a/erpnext/patches/v13_0/stock_entry_enhancements.py +++ b/erpnext/patches/v13_0/stock_entry_enhancements.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3.See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("stock", "doctype", "stock_entry") if frappe.db.has_column("Stock Entry", "add_to_transit"): diff --git a/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py b/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py index 50f233deef49..dd87a5302d2f 100644 --- a/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py +++ b/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py @@ -7,6 +7,7 @@ import frappe from frappe.utils import add_to_date + def execute(): frappe.reload_doc("manufacturing", "doctype", "work_order") frappe.reload_doc("manufacturing", "doctype", "work_order_item") diff --git a/erpnext/patches/v13_0/update_amt_in_work_order_required_items.py b/erpnext/patches/v13_0/update_amt_in_work_order_required_items.py index dc9ed18eade6..dc973a9d451e 100644 --- a/erpnext/patches/v13_0/update_amt_in_work_order_required_items.py +++ b/erpnext/patches/v13_0/update_amt_in_work_order_required_items.py @@ -1,5 +1,6 @@ import frappe + def execute(): """ Correct amount in child table of required items table.""" diff --git a/erpnext/patches/v13_0/update_custom_fields_for_shopify.py b/erpnext/patches/v13_0/update_custom_fields_for_shopify.py index f1d2ea2d747c..828bde69cf95 100644 --- a/erpnext/patches/v13_0/update_custom_fields_for_shopify.py +++ b/erpnext/patches/v13_0/update_custom_fields_for_shopify.py @@ -2,8 +2,13 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import setup_custom_fields + +from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import ( + setup_custom_fields, +) + def execute(): if frappe.db.get_single_value('Shopify Settings', 'enable_shopify'): diff --git a/erpnext/patches/v13_0/update_deferred_settings.py b/erpnext/patches/v13_0/update_deferred_settings.py index bcc09527a299..54059318c753 100644 --- a/erpnext/patches/v13_0/update_deferred_settings.py +++ b/erpnext/patches/v13_0/update_deferred_settings.py @@ -1,8 +1,10 @@ # Copyright (c) 2019, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): accounts_settings = frappe.get_doc('Accounts Settings', 'Accounts Settings') accounts_settings.book_deferred_entries_based_on = 'Days' diff --git a/erpnext/patches/v13_0/update_export_type_for_gst.py b/erpnext/patches/v13_0/update_export_type_for_gst.py index ef70b55d94c0..de578612f7dd 100644 --- a/erpnext/patches/v13_0/update_export_type_for_gst.py +++ b/erpnext/patches/v13_0/update_export_type_for_gst.py @@ -1,5 +1,6 @@ import frappe + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) if not company: diff --git a/erpnext/patches/v13_0/update_job_card_details.py b/erpnext/patches/v13_0/update_job_card_details.py index 733b3a960cfa..a0405e50396c 100644 --- a/erpnext/patches/v13_0/update_job_card_details.py +++ b/erpnext/patches/v13_0/update_job_card_details.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("manufacturing", "doctype", "job_card") frappe.reload_doc("manufacturing", "doctype", "job_card_item") diff --git a/erpnext/patches/v13_0/update_level_in_bom.py b/erpnext/patches/v13_0/update_level_in_bom.py index 0d03c42e980b..6223500e6b6d 100644 --- a/erpnext/patches/v13_0/update_level_in_bom.py +++ b/erpnext/patches/v13_0/update_level_in_bom.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): for document in ["bom", "bom_item", "bom_explosion_item"]: frappe.reload_doc('manufacturing', 'doctype', document) diff --git a/erpnext/patches/v13_0/update_member_email_address.py b/erpnext/patches/v13_0/update_member_email_address.py index 4056f84069cf..769658e2b8a3 100644 --- a/erpnext/patches/v13_0/update_member_email_address.py +++ b/erpnext/patches/v13_0/update_member_email_address.py @@ -2,9 +2,11 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): """add value to email_id column from email""" diff --git a/erpnext/patches/v13_0/update_old_loans.py b/erpnext/patches/v13_0/update_old_loans.py index 8cf09aa6925e..b423a3a8e1a8 100644 --- a/erpnext/patches/v13_0/update_old_loans.py +++ b/erpnext/patches/v13_0/update_old_loans.py @@ -1,12 +1,19 @@ from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import nowdate, flt +from frappe.model.naming import make_autoname +from frappe.utils import flt, nowdate + from erpnext.accounts.doctype.account.test_account import create_account -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans from erpnext.loan_management.doctype.loan.loan import make_repayment_entry -from erpnext.loan_management.doctype.loan_repayment.loan_repayment import get_accrued_interest_entries -from frappe.model.naming import make_autoname +from erpnext.loan_management.doctype.loan_repayment.loan_repayment import ( + get_accrued_interest_entries, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_term_loans, +) + def execute(): diff --git a/erpnext/patches/v13_0/update_payment_terms_outstanding.py b/erpnext/patches/v13_0/update_payment_terms_outstanding.py index 4816b40250e6..c9e920b7cb59 100644 --- a/erpnext/patches/v13_0/update_payment_terms_outstanding.py +++ b/erpnext/patches/v13_0/update_payment_terms_outstanding.py @@ -2,8 +2,10 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "Payment Schedule") if frappe.db.count('Payment Schedule'): diff --git a/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py b/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py index 262e38dd056a..71fe9ed6805e 100644 --- a/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py +++ b/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py @@ -2,8 +2,10 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("accounts", "doctype", "POS Invoice Merge Log") frappe.reload_doc("accounts", "doctype", "POS Closing Entry") diff --git a/erpnext/patches/v13_0/update_project_template_tasks.py b/erpnext/patches/v13_0/update_project_template_tasks.py index b41b74205c72..f0d0a5a7ef5e 100644 --- a/erpnext/patches/v13_0/update_project_template_tasks.py +++ b/erpnext/patches/v13_0/update_project_template_tasks.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("projects", "doctype", "project_template") frappe.reload_doc("projects", "doctype", "project_template_task") diff --git a/erpnext/patches/v13_0/update_reason_for_resignation_in_employee.py b/erpnext/patches/v13_0/update_reason_for_resignation_in_employee.py index ccdc334f3065..84075024a47a 100644 --- a/erpnext/patches/v13_0/update_reason_for_resignation_in_employee.py +++ b/erpnext/patches/v13_0/update_reason_for_resignation_in_employee.py @@ -2,8 +2,10 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("hr", "doctype", "employee") diff --git a/erpnext/patches/v13_0/update_recipient_email_digest.py b/erpnext/patches/v13_0/update_recipient_email_digest.py index ed90e1266703..6cd27dc609cd 100644 --- a/erpnext/patches/v13_0/update_recipient_email_digest.py +++ b/erpnext/patches/v13_0/update_recipient_email_digest.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc("setup", "doctype", "Email Digest") frappe.reload_doc("setup", "doctype", "Email Digest Recipient") diff --git a/erpnext/patches/v13_0/update_returned_qty_in_pr_dn.py b/erpnext/patches/v13_0/update_returned_qty_in_pr_dn.py index a5769d2957cd..efb3a5961f9d 100644 --- a/erpnext/patches/v13_0/update_returned_qty_in_pr_dn.py +++ b/erpnext/patches/v13_0/update_returned_qty_in_pr_dn.py @@ -1,8 +1,10 @@ # Copyright (c) 2021, Frappe and Contributors # License: GNU General Public License v3. See license.txt import frappe + from erpnext.controllers.status_updater import OverAllowanceError + def execute(): frappe.reload_doc('stock', 'doctype', 'purchase_receipt') frappe.reload_doc('stock', 'doctype', 'purchase_receipt_item') diff --git a/erpnext/patches/v13_0/update_shipment_status.py b/erpnext/patches/v13_0/update_shipment_status.py index c425599e26b9..f2d7d1d1e3ff 100644 --- a/erpnext/patches/v13_0/update_shipment_status.py +++ b/erpnext/patches/v13_0/update_shipment_status.py @@ -1,5 +1,6 @@ import frappe + def execute(): frappe.reload_doc("stock", "doctype", "shipment") diff --git a/erpnext/patches/v13_0/update_sla_enhancements.py b/erpnext/patches/v13_0/update_sla_enhancements.py index c156ba957720..bcfbf8b24cb2 100644 --- a/erpnext/patches/v13_0/update_sla_enhancements.py +++ b/erpnext/patches/v13_0/update_sla_enhancements.py @@ -5,6 +5,7 @@ import frappe + def execute(): # add holiday list and employee group fields in SLA # change response and resolution time in priorities child table diff --git a/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py b/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py index 0f521cb57a83..bcdf72ec69cb 100644 --- a/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py +++ b/erpnext/patches/v13_0/update_start_end_date_for_old_shift_assignment.py @@ -5,6 +5,7 @@ import frappe + def execute(): frappe.reload_doc('hr', 'doctype', 'shift_assignment') if frappe.db.has_column('Shift Assignment', 'date'): diff --git a/erpnext/patches/v13_0/update_subscription.py b/erpnext/patches/v13_0/update_subscription.py index d25e9c805b79..e0ea78fa4d99 100644 --- a/erpnext/patches/v13_0/update_subscription.py +++ b/erpnext/patches/v13_0/update_subscription.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from six import iteritems + def execute(): frappe.reload_doc('accounts', 'doctype', 'subscription') diff --git a/erpnext/patches/v13_0/update_subscription_status_in_memberships.py b/erpnext/patches/v13_0/update_subscription_status_in_memberships.py index d9c3e453d478..e21fe5782125 100644 --- a/erpnext/patches/v13_0/update_subscription_status_in_memberships.py +++ b/erpnext/patches/v13_0/update_subscription_status_in_memberships.py @@ -1,5 +1,6 @@ import frappe + def execute(): if frappe.db.exists('DocType', 'Member'): frappe.reload_doc('Non Profit', 'doctype', 'Member') diff --git a/erpnext/patches/v13_0/update_tds_check_field.py b/erpnext/patches/v13_0/update_tds_check_field.py index 341b0e8e2e25..436d2e6a6dae 100644 --- a/erpnext/patches/v13_0/update_tds_check_field.py +++ b/erpnext/patches/v13_0/update_tds_check_field.py @@ -1,5 +1,6 @@ import frappe + def execute(): if frappe.db.has_table("Tax Withholding Category") \ and frappe.db.has_column("Tax Withholding Category", "round_off_tax_amount"): diff --git a/erpnext/patches/v13_0/update_timesheet_changes.py b/erpnext/patches/v13_0/update_timesheet_changes.py index a36c84ea6e21..d993d54191f2 100644 --- a/erpnext/patches/v13_0/update_timesheet_changes.py +++ b/erpnext/patches/v13_0/update_timesheet_changes.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc("projects", "doctype", "timesheet") frappe.reload_doc("projects", "doctype", "timesheet_detail") diff --git a/erpnext/patches/v13_0/updates_for_multi_currency_payroll.py b/erpnext/patches/v13_0/updates_for_multi_currency_payroll.py index 7d344f9cd7ea..c760a6a52f10 100644 --- a/erpnext/patches/v13_0/updates_for_multi_currency_payroll.py +++ b/erpnext/patches/v13_0/updates_for_multi_currency_payroll.py @@ -5,6 +5,7 @@ from frappe import _ from frappe.model.utils.rename_field import rename_field + def execute(): frappe.reload_doc('Accounts', 'doctype', 'Salary Component Account') diff --git a/erpnext/patches/v13_0/validate_options_for_data_field.py b/erpnext/patches/v13_0/validate_options_for_data_field.py index 03f9929c5c60..41a38fe29c11 100644 --- a/erpnext/patches/v13_0/validate_options_for_data_field.py +++ b/erpnext/patches/v13_0/validate_options_for_data_field.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.model import data_field_options + def execute(): for field in frappe.get_all('Custom Field', diff --git a/erpnext/patches/v4_2/repost_reserved_qty.py b/erpnext/patches/v4_2/repost_reserved_qty.py index 36117aad8cce..4fa3b4687193 100644 --- a/erpnext/patches/v4_2/repost_reserved_qty.py +++ b/erpnext/patches/v4_2/repost_reserved_qty.py @@ -2,8 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty + +from erpnext.stock.stock_balance import get_reserved_qty, update_bin_qty + def execute(): for doctype in ("Sales Order Item", "Bin"): diff --git a/erpnext/patches/v4_2/update_requested_and_ordered_qty.py b/erpnext/patches/v4_2/update_requested_and_ordered_qty.py index 8a31c73e1e42..9330a443bf3f 100644 --- a/erpnext/patches/v4_2/update_requested_and_ordered_qty.py +++ b/erpnext/patches/v4_2/update_requested_and_ordered_qty.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): - from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty, get_ordered_qty + from erpnext.stock.stock_balance import get_indented_qty, get_ordered_qty, update_bin_qty count=0 for item_code, warehouse in frappe.db.sql("""select distinct item_code, warehouse from diff --git a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py index 2045358ddb2e..82b5b1cc2d29 100644 --- a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py +++ b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): name = frappe.db.sql(""" select name from `tabPatch Log` \ where \ diff --git a/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py index 55f5f8201fbe..ecfdc41f9b83 100644 --- a/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py +++ b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def execute(): frappe.reload_doc('core', 'doctype', 'has_role') company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v8_1/setup_gst_india.py b/erpnext/patches/v8_1/setup_gst_india.py index c214990693c8..140b22656b1c 100644 --- a/erpnext/patches/v8_1/setup_gst_india.py +++ b/erpnext/patches/v8_1/setup_gst_india.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.email import sendmail_to_system_managers + def execute(): frappe.reload_doc('stock', 'doctype', 'item') frappe.reload_doc("stock", "doctype", "customs_tariff_number") diff --git a/erpnext/patches/v8_7/sync_india_custom_fields.py b/erpnext/patches/v8_7/sync_india_custom_fields.py index eb24a90f0139..65ec14e88264 100644 --- a/erpnext/patches/v8_7/sync_india_custom_fields.py +++ b/erpnext/patches/v8_7/sync_india_custom_fields.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals + import frappe -from erpnext.regional.india.setup import make_custom_fields + +from erpnext.regional.india.setup import make_custom_fields + def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/payroll/doctype/additional_salary/additional_salary.py b/erpnext/payroll/doctype/additional_salary/additional_salary.py index 381f399e9fa3..ed10f2bc67a4 100644 --- a/erpnext/payroll/doctype/additional_salary/additional_salary.py +++ b/erpnext/payroll/doctype/additional_salary/additional_salary.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _, bold -from frappe.utils import getdate, date_diff, comma_and, formatdate +from frappe.model.document import Document +from frappe.utils import comma_and, date_diff, formatdate, getdate + from erpnext.hr.utils import validate_active_employee + class AdditionalSalary(Document): def on_submit(self): if self.ref_doctype == "Employee Advance" and self.ref_docname: diff --git a/erpnext/payroll/doctype/additional_salary/test_additional_salary.py b/erpnext/payroll/doctype/additional_salary/test_additional_salary.py index 2a9c56179e7e..2ad4afef251f 100644 --- a/erpnext/payroll/doctype/additional_salary/test_additional_salary.py +++ b/erpnext/payroll/doctype/additional_salary/test_additional_salary.py @@ -2,12 +2,19 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest -import frappe, erpnext -from frappe.utils import nowdate, add_days + +import frappe +from frappe.utils import add_days, nowdate + +import erpnext from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.payroll.doctype.salary_component.test_salary_component import create_salary_component -from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, setup_test +from erpnext.payroll.doctype.salary_slip.test_salary_slip import ( + make_employee_salary_slip, + setup_test, +) from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure diff --git a/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py index a1cde08a74c1..db64ec797900 100644 --- a/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py +++ b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py @@ -3,13 +3,26 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt from frappe.model.document import Document -from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor -from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure -from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holiday_dates_for_employee, get_previous_claimed_amount, validate_active_employee +from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, rounded + +from erpnext.hr.utils import ( + get_holiday_dates_for_employee, + get_previous_claimed_amount, + get_sal_slip_total_benefit_given, + validate_active_employee, +) +from erpnext.payroll.doctype.payroll_period.payroll_period import ( + get_payroll_period_days, + get_period_factor, +) +from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import ( + get_assigned_salary_structure, +) + class EmployeeBenefitApplication(Document): def validate(self): diff --git a/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py b/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py index 34e1a8fbc1d6..ea05e0e0e052 100644 --- a/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py +++ b/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py @@ -2,7 +2,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestEmployeeBenefitApplication(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py index 65405feaf19f..ddcbaa206198 100644 --- a/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py +++ b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeBenefitApplicationDetail(Document): pass diff --git a/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py index c6713f3aa46b..7898e04cf44d 100644 --- a/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py +++ b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py @@ -3,14 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt from frappe.model.document import Document -from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits +from frappe.utils import flt + from erpnext.hr.utils import get_previous_claimed_amount, validate_active_employee +from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import ( + get_max_benefits, +) from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period -from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure +from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import ( + get_assigned_salary_structure, +) + class EmployeeBenefitClaim(Document): def validate(self): diff --git a/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py b/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py index aff73e5c8160..f3f2229fb2eb 100644 --- a/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py +++ b/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py @@ -2,7 +2,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + import unittest + class TestEmployeeBenefitClaim(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_incentive/employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/employee_incentive.py index 6b918ba76d15..74d073668d7f 100644 --- a/erpnext/payroll/doctype/employee_incentive/employee_incentive.py +++ b/erpnext/payroll/doctype/employee_incentive/employee_incentive.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + from erpnext.hr.utils import validate_active_employee + class EmployeeIncentive(Document): def validate(self): validate_active_employee(self.employee) diff --git a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py index f7597ad6057f..834394182de5 100644 --- a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py +++ b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeIncentive(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_other_income/employee_other_income.py b/erpnext/payroll/doctype/employee_other_income/employee_other_income.py index ab63c0de623a..73a0321c8fe3 100644 --- a/erpnext/payroll/doctype/employee_other_income/employee_other_income.py +++ b/erpnext/payroll/doctype/employee_other_income/employee_other_income.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeOtherIncome(Document): pass diff --git a/erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py b/erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py index 2eeca7a23dee..5b735b37a167 100644 --- a/erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py +++ b/erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestEmployeeOtherIncome(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py index 4f705db22e52..d9c82d236225 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class EmployeeTaxExemptionCategory(Document): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py index 669fb71f46e7..69de6b119691 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeTaxExemptionCategory(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py index e11d60a4649b..53fcd33e6cbc 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py @@ -3,13 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import flt +from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from erpnext.hr.utils import validate_tax_declaration, get_total_exemption_amount, validate_active_employee, \ - calculate_annual_eligible_hra_exemption, validate_duplicate_exemption_for_payroll_period +from frappe.utils import flt + +from erpnext.hr.utils import ( + calculate_annual_eligible_hra_exemption, + get_total_exemption_amount, + validate_active_employee, + validate_duplicate_exemption_for_payroll_period, + validate_tax_declaration, +) + class EmployeeTaxExemptionDeclaration(Document): def validate(self): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py index 311f3527f6e4..b7154a4da159 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py @@ -3,11 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe, erpnext import unittest + +import frappe + +import erpnext from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.utils import DuplicateDeclarationError + class TestEmployeeTaxExemptionDeclaration(unittest.TestCase): def setUp(self): make_employee("employee@taxexepmtion.com") diff --git a/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py index bff747f90de7..2923e57333d0 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeTaxExemptionDeclarationCategory(Document): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py index 8131ae0fa854..53d91f611505 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py @@ -3,12 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import flt -from erpnext.hr.utils import validate_tax_declaration, get_total_exemption_amount, validate_active_employee, \ - calculate_hra_exemption_for_period, validate_duplicate_exemption_for_payroll_period + +from erpnext.hr.utils import ( + calculate_hra_exemption_for_period, + get_total_exemption_amount, + validate_active_employee, + validate_duplicate_exemption_for_payroll_period, + validate_tax_declaration, +) + class EmployeeTaxExemptionProofSubmission(Document): def validate(self): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py index cb9ed5f971c6..aafc0a132112 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py @@ -3,9 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_exemption_category, create_payroll_period + +import frappe + +from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import ( + create_exemption_category, + create_payroll_period, +) + class TestEmployeeTaxExemptionProofSubmission(unittest.TestCase): def setup(self): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py index 0244ae66468c..e0a11aec162c 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmployeeTaxExemptionProofSubmissionDetail(Document): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py index d3f24c937805..5948ef208bfc 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt from frappe.model.document import Document +from frappe.utils import flt + class EmployeeTaxExemptionSubCategory(Document): def validate(self): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py index 5d705567a2d0..fc2de6836bec 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestEmployeeTaxExemptionSubCategory(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/gratuity/gratuity.py b/erpnext/payroll/doctype/gratuity/gratuity.py index 31a6af3a0776..1e2877298082 100644 --- a/erpnext/payroll/doctype/gratuity/gratuity.py +++ b/erpnext/payroll/doctype/gratuity/gratuity.py @@ -3,12 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from math import floor + import frappe from frappe import _, bold from frappe.utils import flt, get_datetime, get_link_to_form + from erpnext.accounts.general_ledger import make_gl_entries from erpnext.controllers.accounts_controller import AccountsController -from math import floor + class Gratuity(AccountsController): def validate(self): diff --git a/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py b/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py index 483e346a32d4..d0fda57016c6 100644 --- a/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py +++ b/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'reference_name', diff --git a/erpnext/payroll/doctype/gratuity/test_gratuity.py b/erpnext/payroll/doctype/gratuity/test_gratuity.py index 6c3b6fbae58e..66cbbd7d1490 100644 --- a/erpnext/payroll/doctype/gratuity/test_gratuity.py +++ b/erpnext/payroll/doctype/gratuity/test_gratuity.py @@ -3,15 +3,20 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe +from frappe.utils import add_days, flt, get_datetime, getdate + from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, make_earning_salary_component, \ - make_deduction_salary_component +from erpnext.hr.doctype.expense_claim.test_expense_claim import get_payable_account from erpnext.payroll.doctype.gratuity.gratuity import get_last_salary_slip +from erpnext.payroll.doctype.salary_slip.test_salary_slip import ( + make_deduction_salary_component, + make_earning_salary_component, + make_employee_salary_slip, +) from erpnext.regional.united_arab_emirates.setup import create_gratuity_rule -from erpnext.hr.doctype.expense_claim.test_expense_claim import get_payable_account -from frappe.utils import getdate, add_days, get_datetime, flt test_dependencies = ["Salary Component", "Salary Slip", "Account"] class TestGratuity(unittest.TestCase): diff --git a/erpnext/payroll/doctype/gratuity_applicable_component/gratuity_applicable_component.py b/erpnext/payroll/doctype/gratuity_applicable_component/gratuity_applicable_component.py index 23e4340b04fa..d76b26d05f67 100644 --- a/erpnext/payroll/doctype/gratuity_applicable_component/gratuity_applicable_component.py +++ b/erpnext/payroll/doctype/gratuity_applicable_component/gratuity_applicable_component.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class GratuityApplicableComponent(Document): pass diff --git a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.py b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.py index 49705ddae753..95d2929fffa8 100644 --- a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.py +++ b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class GratuityRule(Document): diff --git a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py index 0f27315cfbf8..60dcfa452970 100644 --- a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py +++ b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'gratuity_rule', diff --git a/erpnext/payroll/doctype/gratuity_rule/test_gratuity_rule.py b/erpnext/payroll/doctype/gratuity_rule/test_gratuity_rule.py index 1f5dc4e571e6..c81d7b7b9e6f 100644 --- a/erpnext/payroll/doctype/gratuity_rule/test_gratuity_rule.py +++ b/erpnext/payroll/doctype/gratuity_rule/test_gratuity_rule.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestGratuityRule(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/gratuity_rule_slab/gratuity_rule_slab.py b/erpnext/payroll/doctype/gratuity_rule_slab/gratuity_rule_slab.py index fa468e77bebe..dcd7e4686551 100644 --- a/erpnext/payroll/doctype/gratuity_rule_slab/gratuity_rule_slab.py +++ b/erpnext/payroll/doctype/gratuity_rule_slab/gratuity_rule_slab.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class GratuityRuleSlab(Document): pass diff --git a/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py index 81e364778ca2..f778fd90e13a 100644 --- a/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py +++ b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py @@ -3,9 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from frappe.model.document import Document + #import frappe import erpnext -from frappe.model.document import Document + class IncomeTaxSlab(Document): def validate(self): diff --git a/erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py b/erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py index deaaf650a967..d76299049ded 100644 --- a/erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py +++ b/erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestIncomeTaxSlab(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py b/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py index b4098ecbf3e6..3314677485fd 100644 --- a/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py +++ b/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class IncomeTaxSlabOtherCharges(Document): pass diff --git a/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py b/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py index aeb11fd7e27e..074d2232245b 100644 --- a/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py +++ b/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class PayrollEmployeeDetail(Document): pass diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry.py index 13cc423fc2ce..f1557c78a378 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry.py +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.py @@ -3,15 +3,30 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.model.document import Document + +import frappe from dateutil.relativedelta import relativedelta -from frappe.utils import cint, flt, add_days, getdate, add_to_date, DATE_FORMAT, date_diff, comma_and from frappe import _ +from frappe.desk.reportview import get_filters_cond, get_match_cond +from frappe.model.document import Document +from frappe.utils import ( + DATE_FORMAT, + add_days, + add_to_date, + cint, + comma_and, + date_diff, + flt, + getdate, +) + +import erpnext +from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( + get_accounting_dimensions, +) from erpnext.accounts.utils import get_fiscal_year from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee -from frappe.desk.reportview import get_match_cond, get_filters_cond -from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions + class PayrollEntry(Document): def onload(self): @@ -529,7 +544,8 @@ def get_end_date(start_date, frequency): def get_month_details(year, month): ysd = frappe.db.get_value("Fiscal Year", year, "year_start_date") if ysd: - import calendar, datetime + import calendar + import datetime diff_mnt = cint(month)-cint(ysd.month) if diff_mnt<0: diff_mnt = 12-int(ysd.month)+cint(month) diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py index 0346a7cc594f..41f15993efe4 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'payroll_entry', diff --git a/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py b/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py index b80b32061f3e..dd0e12708007 100644 --- a/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py +++ b/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py @@ -1,19 +1,37 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest -import erpnext + import frappe from dateutil.relativedelta import relativedelta -from erpnext.accounts.utils import get_fiscal_year, getdate, nowdate from frappe.utils import add_months -from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates, get_end_date + +import erpnext +from erpnext.accounts.utils import get_fiscal_year, getdate, nowdate from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.payroll.doctype.salary_slip.test_salary_slip import get_salary_component_account, \ - make_earning_salary_component, make_deduction_salary_component, create_account, make_employee_salary_slip -from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure, create_salary_structure_assignment -from erpnext.loan_management.doctype.loan.test_loan import create_loan, make_loan_disbursement_entry, create_loan_type, create_loan_accounts -from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans +from erpnext.loan_management.doctype.loan.test_loan import ( + create_loan, + create_loan_accounts, + create_loan_type, + make_loan_disbursement_entry, +) +from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_term_loans, +) +from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_end_date, get_start_end_dates +from erpnext.payroll.doctype.salary_slip.test_salary_slip import ( + create_account, + get_salary_component_account, + make_deduction_salary_component, + make_earning_salary_component, + make_employee_salary_slip, +) +from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + create_salary_structure_assignment, + make_salary_structure, +) test_dependencies = ['Holiday List'] diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period.py b/erpnext/payroll/doctype/payroll_period/payroll_period.py index 66dec075d8fb..0de8d63df739 100644 --- a/erpnext/payroll/doctype/payroll_period/payroll_period.py +++ b/erpnext/payroll/doctype/payroll_period/payroll_period.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt, add_months from frappe.model.document import Document +from frappe.utils import add_months, cint, date_diff, flt, formatdate, getdate, month_diff + from erpnext.hr.utils import get_holiday_dates_for_employee + class PayrollPeriod(Document): def validate(self): self.validate_dates() diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py index e33299559cc9..b24af9d610b4 100644 --- a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'payroll_period', diff --git a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py index d06dc739a6e9..5296b7853951 100644 --- a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py +++ b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestPayrollPeriod(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py index a3ee269d8e6f..fa6835da53b9 100644 --- a/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py +++ b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PayrollPeriodDate(Document): pass diff --git a/erpnext/payroll/doctype/payroll_settings/payroll_settings.py b/erpnext/payroll/doctype/payroll_settings/payroll_settings.py index 459b7eacb43d..b85d5545d042 100644 --- a/erpnext/payroll/doctype/payroll_settings/payroll_settings.py +++ b/erpnext/payroll/doctype/payroll_settings/payroll_settings.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from frappe import _ +from frappe.custom.doctype.property_setter.property_setter import make_property_setter from frappe.model.document import Document from frappe.utils import cint -from frappe.custom.doctype.property_setter.property_setter import make_property_setter -from frappe import _ + class PayrollSettings(Document): def validate(self): diff --git a/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py b/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py index 314866e128ee..30a6a332b7c5 100644 --- a/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py +++ b/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestPayrollSettings(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/retention_bonus/retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py index 055bea741081..7e731e7fce17 100644 --- a/erpnext/payroll/doctype/retention_bonus/retention_bonus.py +++ b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import getdate + from erpnext.hr.utils import validate_active_employee + + class RetentionBonus(Document): def validate(self): validate_active_employee(self.employee) diff --git a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py index eef4f1444e16..ab25d73ef420 100644 --- a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py +++ b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestRetentionBonus(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/salary_component/salary_component.py b/erpnext/payroll/doctype/salary_component/salary_component.py index 7c926314a214..761d4436f37d 100644 --- a/erpnext/payroll/doctype/salary_component/salary_component.py +++ b/erpnext/payroll/doctype/salary_component/salary_component.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document from frappe.model.naming import append_number_if_name_exists + class SalaryComponent(Document): def validate(self): self.validate_abbr() diff --git a/erpnext/payroll/doctype/salary_component/test_salary_component.py b/erpnext/payroll/doctype/salary_component/test_salary_component.py index 4f7db0c71cac..939fa4aade16 100644 --- a/erpnext/payroll/doctype/salary_component/test_salary_component.py +++ b/erpnext/payroll/doctype/salary_component/test_salary_component.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Salary Component') class TestSalaryComponent(unittest.TestCase): diff --git a/erpnext/payroll/doctype/salary_detail/salary_detail.py b/erpnext/payroll/doctype/salary_detail/salary_detail.py index 0b187543d484..52ba92e972c8 100644 --- a/erpnext/payroll/doctype/salary_detail/salary_detail.py +++ b/erpnext/payroll/doctype/salary_detail/salary_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SalaryDetail(Document): pass diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py index e1e7745f2d60..fdccd2dd7c8a 100644 --- a/erpnext/payroll/doctype/salary_slip/salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py @@ -2,26 +2,51 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -import datetime, math -from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, formatdate, get_first_day +import datetime +import math + +import frappe +from frappe import _, msgprint from frappe.model.naming import make_autoname +from frappe.utils import ( + add_days, + cint, + cstr, + date_diff, + flt, + formatdate, + get_first_day, + getdate, + money_in_words, + rounded, +) +from frappe.utils.background_jobs import enqueue +from six import iteritems -from frappe import msgprint, _ -from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates +import erpnext +from erpnext.accounts.utils import get_fiscal_year from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee -from erpnext.hr.utils import get_holiday_dates_for_employee -from erpnext.utilities.transaction_base import TransactionBase -from frappe.utils.background_jobs import enqueue +from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee +from erpnext.loan_management.doctype.loan_repayment.loan_repayment import ( + calculate_amounts, + create_repayment_entry, +) from erpnext.payroll.doctype.additional_salary.additional_salary import get_additional_salaries -from erpnext.payroll.doctype.payroll_period.payroll_period import get_period_factor, get_payroll_period -from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_benefit_component_amount -from erpnext.payroll.doctype.employee_benefit_claim.employee_benefit_claim import get_benefit_claim_amount, get_last_payroll_period_benefits -from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts, create_repayment_entry -from erpnext.accounts.utils import get_fiscal_year -from erpnext.hr.utils import validate_active_employee -from six import iteritems +from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import ( + get_benefit_component_amount, +) +from erpnext.payroll.doctype.employee_benefit_claim.employee_benefit_claim import ( + get_benefit_claim_amount, + get_last_payroll_period_benefits, +) +from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates +from erpnext.payroll.doctype.payroll_period.payroll_period import ( + get_payroll_period, + get_period_factor, +) +from erpnext.utilities.transaction_base import TransactionBase + class SalarySlip(TransactionBase): def __init__(self, *args, **kwargs): diff --git a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py index 6e8d3b3f3067..e91dae39066d 100644 --- a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py @@ -2,20 +2,34 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals +import calendar +import random import unittest + import frappe +from frappe.utils import ( + add_days, + add_months, + cstr, + flt, + get_first_day, + get_last_day, + getdate, + nowdate, +) + import erpnext -import calendar -import random from erpnext.accounts.utils import get_fiscal_year -from frappe.utils import getdate, nowdate, add_days, add_months, flt, get_first_day, get_last_day, cstr -from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip -from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.leave_allocation.test_leave_allocation import create_leave_allocation from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type -from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration \ - import create_payroll_period, create_exemption_category +from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import ( + create_exemption_category, + create_payroll_period, +) +from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details +from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip + class TestSalarySlip(unittest.TestCase): def setUp(self): @@ -154,7 +168,9 @@ def test_salary_slip_with_holidays_excluded(self): self.assertEqual(ss.gross_pay, 78000) def test_payment_days(self): - from erpnext.payroll.doctype.salary_structure.test_salary_structure import create_salary_structure_assignment + from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + create_salary_structure_assignment, + ) no_of_days = self.get_no_of_days() # Holidays not included in working days @@ -231,8 +247,15 @@ def test_email_salary_slip(self): self.assertTrue(email_queue) def test_loan_repayment_salary_slip(self): - from erpnext.loan_management.doctype.loan.test_loan import create_loan_type, create_loan, make_loan_disbursement_entry, create_loan_accounts - from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans + from erpnext.loan_management.doctype.loan.test_loan import ( + create_loan, + create_loan_accounts, + create_loan_type, + make_loan_disbursement_entry, + ) + from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( + process_loan_interest_accrual_for_term_loans, + ) from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure applicant = make_employee("test_loan_repayment_salary_slip@salary.com", company="_Test Company") @@ -386,8 +409,10 @@ def test_tax_for_payroll_period(self): for doc in delete_docs: frappe.db.sql("delete from `tab%s` where employee='%s'" % (doc, employee)) - from erpnext.payroll.doctype.salary_structure.test_salary_structure import \ - make_salary_structure, create_salary_structure_assignment + from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + create_salary_structure_assignment, + make_salary_structure, + ) salary_structure = make_salary_structure("Stucture to test tax", "Monthly", other_details={"max_benefits": 100000}, test_tax=True, diff --git a/erpnext/payroll/doctype/salary_slip_leave/salary_slip_leave.py b/erpnext/payroll/doctype/salary_slip_leave/salary_slip_leave.py index 7a92bf18f763..fc8282b82ba8 100644 --- a/erpnext/payroll/doctype/salary_slip_leave/salary_slip_leave.py +++ b/erpnext/payroll/doctype/salary_slip_leave/salary_slip_leave.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class SalarySlipLeave(Document): pass diff --git a/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py index 7adb12e83a45..79c4c6e5715f 100644 --- a/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py +++ b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class SalarySlipTimesheet(Document): pass diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure.py b/erpnext/payroll/doctype/salary_structure/salary_structure.py index 6dfb3a57d5df..9af7da358888 100644 --- a/erpnext/payroll/doctype/salary_structure/salary_structure.py +++ b/erpnext/payroll/doctype/salary_structure/salary_structure.py @@ -2,14 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import flt, cint, cstr +import frappe from frappe import _ -from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document +from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, cstr, flt from six import iteritems +import erpnext + + class SalaryStructure(Document): def validate(self): self.set_missing_values() diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py index 0159e3530fb0..907adea7034b 100644 --- a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'salary_structure', diff --git a/erpnext/payroll/doctype/salary_structure/test_salary_structure.py b/erpnext/payroll/doctype/salary_structure/test_salary_structure.py index 3957d834d33d..ff4a55e29cfa 100644 --- a/erpnext/payroll/doctype/salary_structure/test_salary_structure.py +++ b/erpnext/payroll/doctype/salary_structure/test_salary_structure.py @@ -2,17 +2,24 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -import erpnext + +import frappe +from frappe.utils import add_years, date_diff, get_first_day, nowdate from frappe.utils.make_random import get_random -from frappe.utils import nowdate, add_years, get_first_day, date_diff -from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip -from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_earning_salary_component,\ - make_deduction_salary_component, make_employee_salary_slip, create_tax_slab -from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_payroll_period +import erpnext +from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import ( + create_payroll_period, +) +from erpnext.payroll.doctype.salary_slip.test_salary_slip import ( + create_tax_slab, + make_deduction_salary_component, + make_earning_salary_component, + make_employee_salary_slip, +) +from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip test_dependencies = ["Fiscal Year"] diff --git a/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py index 5fb3ce2a98e4..385cf36b7f5b 100644 --- a/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py +++ b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate from frappe.model.document import Document +from frappe.utils import getdate + class DuplicateAssignment(frappe.ValidationError): pass diff --git a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py index a9833bf7338d..bfc181343f57 100644 --- a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py +++ b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestSalaryStructureAssignment(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py index 49c52557dbc2..c0827c445db4 100644 --- a/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py +++ b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TaxableSalarySlab(Document): pass diff --git a/erpnext/payroll/notification/retention_bonus/retention_bonus.py b/erpnext/payroll/notification/retention_bonus/retention_bonus.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/payroll/notification/retention_bonus/retention_bonus.py +++ b/erpnext/payroll/notification/retention_bonus/retention_bonus.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/payroll/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py index 05a5366a5c1e..e8d01c45c24d 100644 --- a/erpnext/payroll/report/bank_remittance/bank_remittance.py +++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import formatdate + import itertools + +import frappe from frappe import _, get_all +from frappe.utils import formatdate + def execute(filters=None): columns = [ diff --git a/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py index 8a79416edbf7..296a7c233f31 100644 --- a/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py +++ b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py @@ -2,9 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ +import erpnext + + def execute(filters=None): data = get_data(filters) columns = get_columns(filters) if len(data) else [] diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py index a0dab63654e6..57ea1b3c283d 100644 --- a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py +++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py @@ -2,9 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import get_conditions + +import erpnext +from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import ( + get_conditions, +) + def execute(filters=None): mode_of_payments = get_payment_modes() diff --git a/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py index d09745c37bbe..bc8fd9d40b2a 100644 --- a/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py +++ b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py @@ -2,9 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ +import erpnext + + def execute(filters=None): columns = get_columns(filters) data = get_data(filters) diff --git a/erpnext/payroll/report/salary_register/salary_register.py b/erpnext/payroll/report/salary_register/salary_register.py index a1b1a8c56b52..2a9dad66e25b 100644 --- a/erpnext/payroll/report/salary_register/salary_register.py +++ b/erpnext/payroll/report/salary_register/salary_register.py @@ -2,9 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import flt + +import frappe from frappe import _ +from frappe.utils import flt + +import erpnext + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/portal/doctype/homepage/homepage.py b/erpnext/portal/doctype/homepage/homepage.py index 54ea7c62df46..7eeaf4b80a06 100644 --- a/erpnext/portal/doctype/homepage/homepage.py +++ b/erpnext/portal/doctype/homepage/homepage.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document from frappe.website.utils import delete_page_cache + class Homepage(Document): def validate(self): if not self.description: diff --git a/erpnext/portal/doctype/homepage/test_homepage.py b/erpnext/portal/doctype/homepage/test_homepage.py index b717491a821c..6f0517867d76 100644 --- a/erpnext/portal/doctype/homepage/test_homepage.py +++ b/erpnext/portal/doctype/homepage/test_homepage.py @@ -3,11 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import set_request from frappe.website.render import render + class TestHomepage(unittest.TestCase): def test_homepage_load(self): set_request(method='GET', path='home') diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py index 936e07d34ea6..82b9a8e6b2b4 100644 --- a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class HomepageFeaturedProduct(Document): pass diff --git a/erpnext/portal/doctype/homepage_section/homepage_section.py b/erpnext/portal/doctype/homepage_section/homepage_section.py index 1ed703050b83..081786126e78 100644 --- a/erpnext/portal/doctype/homepage_section/homepage_section.py +++ b/erpnext/portal/doctype/homepage_section/homepage_section.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document from frappe.utils import cint + class HomepageSection(Document): @property def column_value(self): diff --git a/erpnext/portal/doctype/homepage_section/test_homepage_section.py b/erpnext/portal/doctype/homepage_section/test_homepage_section.py index f0aa554858ac..75aa5b28f118 100644 --- a/erpnext/portal/doctype/homepage_section/test_homepage_section.py +++ b/erpnext/portal/doctype/homepage_section/test_homepage_section.py @@ -3,12 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from bs4 import BeautifulSoup from frappe.utils import set_request from frappe.website.render import render + class TestHomepageSection(unittest.TestCase): def test_homepage_section_card(self): try: diff --git a/erpnext/portal/doctype/homepage_section_card/homepage_section_card.py b/erpnext/portal/doctype/homepage_section_card/homepage_section_card.py index bd17279f99a3..b71045207cc9 100644 --- a/erpnext/portal/doctype/homepage_section_card/homepage_section_card.py +++ b/erpnext/portal/doctype/homepage_section_card/homepage_section_card.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class HomepageSectionCard(Document): pass diff --git a/erpnext/portal/doctype/products_settings/products_settings.py b/erpnext/portal/doctype/products_settings/products_settings.py index 9a708924ae0f..d4f09b9c8c28 100644 --- a/erpnext/portal/doctype/products_settings/products_settings.py +++ b/erpnext/portal/doctype/products_settings/products_settings.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint from frappe import _ from frappe.model.document import Document +from frappe.utils import cint + class ProductsSettings(Document): def validate(self): diff --git a/erpnext/portal/doctype/products_settings/test_products_settings.py b/erpnext/portal/doctype/products_settings/test_products_settings.py index d04a00988297..05e38f5f2dfd 100644 --- a/erpnext/portal/doctype/products_settings/test_products_settings.py +++ b/erpnext/portal/doctype/products_settings/test_products_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestProductsSettings(unittest.TestCase): pass diff --git a/erpnext/portal/doctype/website_attribute/website_attribute.py b/erpnext/portal/doctype/website_attribute/website_attribute.py index b8b667a61354..f9ba733b85de 100644 --- a/erpnext/portal/doctype/website_attribute/website_attribute.py +++ b/erpnext/portal/doctype/website_attribute/website_attribute.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class WebsiteAttribute(Document): pass diff --git a/erpnext/portal/doctype/website_filter_field/website_filter_field.py b/erpnext/portal/doctype/website_filter_field/website_filter_field.py index 2aa8a6f98d42..335d4575b619 100644 --- a/erpnext/portal/doctype/website_filter_field/website_filter_field.py +++ b/erpnext/portal/doctype/website_filter_field/website_filter_field.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class WebsiteFilterField(Document): pass diff --git a/erpnext/portal/product_configurator/item_variants_cache.py b/erpnext/portal/product_configurator/item_variants_cache.py index fc294ce58bb9..636ae8d49170 100644 --- a/erpnext/portal/product_configurator/item_variants_cache.py +++ b/erpnext/portal/product_configurator/item_variants_cache.py @@ -1,5 +1,6 @@ import frappe + class ItemVariantsCacheManager: def __init__(self, item_code): self.item_code = item_code diff --git a/erpnext/portal/product_configurator/test_product_configurator.py b/erpnext/portal/product_configurator/test_product_configurator.py index 28e064218b1e..ded5287b45cb 100644 --- a/erpnext/portal/product_configurator/test_product_configurator.py +++ b/erpnext/portal/product_configurator/test_product_configurator.py @@ -1,9 +1,12 @@ from __future__ import unicode_literals +import unittest + +import frappe from bs4 import BeautifulSoup -import frappe, unittest -from frappe.utils import set_request, get_html_for_route +from frappe.utils import get_html_for_route, set_request from frappe.website.render import render + from erpnext.portal.product_configurator.utils import get_products_for_website from erpnext.stock.doctype.item.test_item import make_item_variant diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py index d60b1a2b05ea..cf623c8d429b 100644 --- a/erpnext/portal/product_configurator/utils.py +++ b/erpnext/portal/product_configurator/utils.py @@ -1,8 +1,10 @@ import frappe from frappe.utils import cint + from erpnext.portal.product_configurator.item_variants_cache import ItemVariantsCacheManager -from erpnext.shopping_cart.product_info import get_product_info_for_website from erpnext.setup.doctype.item_group.item_group import get_child_groups +from erpnext.shopping_cart.product_info import get_product_info_for_website + def get_field_filter_data(): product_settings = get_product_settings() diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py index d6d446942030..bae8f353b356 100644 --- a/erpnext/portal/utils.py +++ b/erpnext/portal/utils.py @@ -1,9 +1,14 @@ from __future__ import unicode_literals + import frappe -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings -from erpnext.shopping_cart.cart import get_debtors_account from frappe.utils.nestedset import get_root_of +from erpnext.shopping_cart.cart import get_debtors_account +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + get_shopping_cart_settings, +) + + def set_default_role(doc, method): '''Set customer, supplier, student, guardian based on email''' if frappe.flags.setting_role or frappe.flags.in_migrate: diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.py b/erpnext/projects/doctype/activity_cost/activity_cost.py index 99226ea581c9..e210324862b2 100644 --- a/erpnext/projects/doctype/activity_cost/activity_cost.py +++ b/erpnext/projects/doctype/activity_cost/activity_cost.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class DuplicationError(frappe.ValidationError): pass class ActivityCost(Document): diff --git a/erpnext/projects/doctype/activity_cost/test_activity_cost.py b/erpnext/projects/doctype/activity_cost/test_activity_cost.py index 5f35f299b36f..c031f3cedab3 100644 --- a/erpnext/projects/doctype/activity_cost/test_activity_cost.py +++ b/erpnext/projects/doctype/activity_cost/test_activity_cost.py @@ -3,11 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + from erpnext.projects.doctype.activity_cost.activity_cost import DuplicationError + class TestActivityCost(unittest.TestCase): def test_duplication(self): frappe.db.sql("delete from `tabActivity Cost`") diff --git a/erpnext/projects/doctype/activity_type/activity_type.py b/erpnext/projects/doctype/activity_type/activity_type.py index 50e18ef4de94..4c94fe456504 100644 --- a/erpnext/projects/doctype/activity_type/activity_type.py +++ b/erpnext/projects/doctype/activity_type/activity_type.py @@ -2,7 +2,9 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class ActivityType(Document): pass diff --git a/erpnext/projects/doctype/activity_type/test_activity_type.py b/erpnext/projects/doctype/activity_type/test_activity_type.py index dcb01018de0e..02619af7abdc 100644 --- a/erpnext/projects/doctype/activity_type/test_activity_type.py +++ b/erpnext/projects/doctype/activity_type/test_activity_type.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Activity Type') diff --git a/erpnext/projects/doctype/dependent_task/dependent_task.py b/erpnext/projects/doctype/dependent_task/dependent_task.py index 90a96ac1b7c2..1c346df1107a 100644 --- a/erpnext/projects/doctype/dependent_task/dependent_task.py +++ b/erpnext/projects/doctype/dependent_task/dependent_task.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DependentTask(Document): pass diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index c8fbe0bf7be8..772bf66ad887 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -2,18 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from email_reply_parser import EmailReplyParser from frappe import _ +from frappe.desk.reportview import get_match_cond +from frappe.model.document import Document +from frappe.utils import ( + add_days, + flt, + get_datetime, + get_time, + get_url, + getdate, + now, + nowtime, + today, +) from six import iteritems -from email_reply_parser import EmailReplyParser -from frappe.utils import (flt, getdate, get_url, now, - nowtime, get_time, today, get_datetime, add_days) + from erpnext.controllers.queries import get_filters_cond -from frappe.desk.reportview import get_match_cond +from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_users_email from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday -from frappe.model.document import Document -from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list + class Project(Document): def get_feed(self): diff --git a/erpnext/projects/doctype/project/project_dashboard.py b/erpnext/projects/doctype/project/project_dashboard.py index 39cf016d61f9..64fbbf5ebab8 100644 --- a/erpnext/projects/doctype/project/project_dashboard.py +++ b/erpnext/projects/doctype/project/project_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/projects/doctype/project/test_project.py b/erpnext/projects/doctype/project/test_project.py index 70139c6da84a..ebc132626ca6 100644 --- a/erpnext/projects/doctype/project/test_project.py +++ b/erpnext/projects/doctype/project/test_project.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals +import unittest -import frappe, unittest -from frappe.utils import getdate, nowdate, add_days +import frappe +from frappe.utils import add_days, getdate, nowdate from erpnext.projects.doctype.project_template.test_project_template import make_project_template from erpnext.projects.doctype.task.test_task import create_task diff --git a/erpnext/projects/doctype/project_template/project_template.py b/erpnext/projects/doctype/project_template/project_template.py index 2426fd2af894..493ce5b07cbb 100644 --- a/erpnext/projects/doctype/project_template/project_template.py +++ b/erpnext/projects/doctype/project_template/project_template.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import get_link_to_form + class ProjectTemplate(Document): def validate(self): diff --git a/erpnext/projects/doctype/project_template/project_template_dashboard.py b/erpnext/projects/doctype/project_template/project_template_dashboard.py index 67f74f54f063..8eeaa8d6bd8f 100644 --- a/erpnext/projects/doctype/project_template/project_template_dashboard.py +++ b/erpnext/projects/doctype/project_template/project_template_dashboard.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals + def get_data(): return { 'fieldname': 'project_template', diff --git a/erpnext/projects/doctype/project_template/test_project_template.py b/erpnext/projects/doctype/project_template/test_project_template.py index d546fd09a30b..f71984f3a414 100644 --- a/erpnext/projects/doctype/project_template/test_project_template.py +++ b/erpnext/projects/doctype/project_template/test_project_template.py @@ -3,10 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.projects.doctype.task.test_task import create_task + class TestProjectTemplate(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/project_template_task/project_template_task.py b/erpnext/projects/doctype/project_template_task/project_template_task.py index 57bc4f1835ef..e08614198861 100644 --- a/erpnext/projects/doctype/project_template_task/project_template_task.py +++ b/erpnext/projects/doctype/project_template_task/project_template_task.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ProjectTemplateTask(Document): pass diff --git a/erpnext/projects/doctype/project_type/project_type.py b/erpnext/projects/doctype/project_type/project_type.py index 36137ca0186c..1089483cb3f1 100644 --- a/erpnext/projects/doctype/project_type/project_type.py +++ b/erpnext/projects/doctype/project_type/project_type.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.model.document import Document + import frappe from frappe import _ +from frappe.model.document import Document + class ProjectType(Document): def on_trash(self): diff --git a/erpnext/projects/doctype/project_type/test_project_type.py b/erpnext/projects/doctype/project_type/test_project_type.py index ee23390f53fc..a79020f14ff2 100644 --- a/erpnext/projects/doctype/project_type/test_project_type.py +++ b/erpnext/projects/doctype/project_type/test_project_type.py @@ -5,5 +5,6 @@ import unittest + class TestProjectType(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/project_update/project_update.py b/erpnext/projects/doctype/project_update/project_update.py index 2e1ec746ed63..147e591f8fd4 100644 --- a/erpnext/projects/doctype/project_update/project_update.py +++ b/erpnext/projects/doctype/project_update/project_update.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProjectUpdate(Document): pass diff --git a/erpnext/projects/doctype/project_update/test_project_update.py b/erpnext/projects/doctype/project_update/test_project_update.py index 2edd2f85a310..159660397995 100644 --- a/erpnext/projects/doctype/project_update/test_project_update.py +++ b/erpnext/projects/doctype/project_update/test_project_update.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestProjectUpdate(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/project_user/project_user.py b/erpnext/projects/doctype/project_user/project_user.py index 3198f3b08936..9ec4776fa5d7 100644 --- a/erpnext/projects/doctype/project_user/project_user.py +++ b/erpnext/projects/doctype/project_user/project_user.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProjectUser(Document): pass diff --git a/erpnext/projects/doctype/projects_settings/projects_settings.py b/erpnext/projects/doctype/projects_settings/projects_settings.py index 9dcac14f9adf..5e7fe1f20611 100644 --- a/erpnext/projects/doctype/projects_settings/projects_settings.py +++ b/erpnext/projects/doctype/projects_settings/projects_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProjectsSettings(Document): pass diff --git a/erpnext/projects/doctype/projects_settings/test_projects_settings.py b/erpnext/projects/doctype/projects_settings/test_projects_settings.py index d671da73b774..7a43aac87aa7 100644 --- a/erpnext/projects/doctype/projects_settings/test_projects_settings.py +++ b/erpnext/projects/doctype/projects_settings/test_projects_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestProjectsSettings(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 39a6024e2cc2..e0f328116451 100755 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -9,7 +9,7 @@ from frappe import _, throw from frappe.desk.form.assign_to import clear, close_all_assignments from frappe.model.mapper import get_mapped_doc -from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today, flt +from frappe.utils import add_days, cstr, date_diff, flt, get_link_to_form, getdate, today from frappe.utils.nestedset import NestedSet diff --git a/erpnext/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py index 0fad5e880743..41a9c168dfa1 100644 --- a/erpnext/projects/doctype/task/test_task.py +++ b/erpnext/projects/doctype/task/test_task.py @@ -1,12 +1,15 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import unittest -from frappe.utils import getdate, nowdate, add_days + +import frappe +from frappe.utils import add_days, getdate, nowdate from erpnext.projects.doctype.task.task import CircularReferenceError + class TestTask(unittest.TestCase): def test_circular_reference(self): task1 = create_task("_Test Task 1", add_days(nowdate(), -15), add_days(nowdate(), -10)) diff --git a/erpnext/projects/doctype/task_depends_on/task_depends_on.py b/erpnext/projects/doctype/task_depends_on/task_depends_on.py index 723a0fc339b5..dc1e81bf90de 100644 --- a/erpnext/projects/doctype/task_depends_on/task_depends_on.py +++ b/erpnext/projects/doctype/task_depends_on/task_depends_on.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TaskDependsOn(Document): pass diff --git a/erpnext/projects/doctype/task_type/task_type.py b/erpnext/projects/doctype/task_type/task_type.py index 9c0b5325c645..5aacf8a2395c 100644 --- a/erpnext/projects/doctype/task_type/task_type.py +++ b/erpnext/projects/doctype/task_type/task_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TaskType(Document): pass diff --git a/erpnext/projects/doctype/task_type/test_task_type.py b/erpnext/projects/doctype/task_type/test_task_type.py index 1db6e27ed744..e2916205d76f 100644 --- a/erpnext/projects/doctype/task_type/test_task_type.py +++ b/erpnext/projects/doctype/task_type/test_task_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTaskType(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/timesheet/test_timesheet.py b/erpnext/projects/doctype/timesheet/test_timesheet.py index 2b0c3abdd775..e9467e280778 100644 --- a/erpnext/projects/doctype/timesheet/test_timesheet.py +++ b/erpnext/projects/doctype/timesheet/test_timesheet.py @@ -3,21 +3,29 @@ # See license.txt from __future__ import unicode_literals -import frappe -import unittest import datetime +import unittest + +import frappe +from frappe.utils import add_days, add_months, now_datetime, nowdate from frappe.utils.make_random import get_random -from frappe.utils import now_datetime, nowdate, add_days, add_months -from erpnext.projects.doctype.timesheet.timesheet import OverlapError -from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice + from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.payroll.doctype.salary_structure.test_salary_structure \ - import make_salary_structure, create_salary_structure_assignment +from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.payroll.doctype.salary_slip.test_salary_slip import ( + make_deduction_salary_component, make_earning_salary_component, - make_deduction_salary_component ) -from erpnext.hr.doctype.employee.test_employee import make_employee +from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( + create_salary_structure_assignment, + make_salary_structure, +) +from erpnext.projects.doctype.timesheet.timesheet import ( + OverlapError, + make_salary_slip, + make_sales_invoice, +) + class TestTimesheet(unittest.TestCase): @classmethod diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 3a3d9e2c2a5a..d22ceda31b55 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -3,19 +3,34 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe import _ import json from datetime import timedelta -from erpnext.controllers.queries import get_match_cond -from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, date_diff, add_to_date + +import frappe +from frappe import _ from frappe.model.document import Document -from erpnext.manufacturing.doctype.workstation.workstation import (check_if_within_operating_hours, - WorkstationHolidayError) -from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import get_mins_between_operations -from erpnext.setup.utils import get_exchange_rate +from frappe.utils import ( + add_to_date, + cint, + date_diff, + flt, + get_datetime, + getdate, + time_diff_in_hours, +) + +from erpnext.controllers.queries import get_match_cond from erpnext.hr.utils import validate_active_employee +from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( + get_mins_between_operations, +) +from erpnext.manufacturing.doctype.workstation.workstation import ( + WorkstationHolidayError, + check_if_within_operating_hours, +) +from erpnext.setup.utils import get_exchange_rate + class OverlapError(frappe.ValidationError): pass class OverWorkLoggedError(frappe.ValidationError): pass diff --git a/erpnext/projects/doctype/timesheet/timesheet_dashboard.py b/erpnext/projects/doctype/timesheet/timesheet_dashboard.py index 088d98c4d5fb..3ef1d92dcdb9 100644 --- a/erpnext/projects/doctype/timesheet/timesheet_dashboard.py +++ b/erpnext/projects/doctype/timesheet/timesheet_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'time_sheet', diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py index 7da94b777721..b113ca59b2db 100644 --- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py +++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class TimesheetDetail(Document): pass diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py index a22ed7b83386..dec2824fcc0d 100644 --- a/erpnext/projects/report/billing_summary.py +++ b/erpnext/projects/report/billing_summary.py @@ -3,9 +3,11 @@ from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import time_diff_in_hours, flt +from frappe.utils import flt, time_diff_in_hours + def get_columns(): return [ diff --git a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py index 3dcae5b1b53d..3a33b4b1a7e7 100644 --- a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py +++ b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.desk.reportview import build_match_conditions + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py index cdabe6487ea3..301639015c37 100644 --- a/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py +++ b/erpnext/projects/report/delayed_tasks_summary/delayed_tasks_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.utils import date_diff, nowdate + def execute(filters=None): columns, data = [], [] data = get_data(filters) diff --git a/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py b/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py index 78291b2d7818..88c77c88b431 100644 --- a/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py +++ b/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py @@ -1,10 +1,14 @@ from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import nowdate, add_days, add_months +from frappe.utils import add_days, add_months, nowdate + from erpnext.projects.doctype.task.test_task import create_task from erpnext.projects.report.delayed_tasks_summary.delayed_tasks_summary import execute + class TestDelayedTasksSummary(unittest.TestCase): @classmethod def setUp(self): diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py index 17c92c234d5e..e71dded3f354 100644 --- a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py +++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.projects.report.billing_summary import get_columns, get_data + def execute(filters=None): filters = frappe._dict(filters or {}) columns = get_columns() diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py index 4d22f4624635..d59a2ac52a61 100644 --- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py +++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py @@ -2,11 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt, getdate from six import iteritems + def execute(filters=None): return EmployeeHoursReport(filters).run() diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py index 969fc556e8d5..f456c84a5881 100644 --- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py +++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py @@ -1,11 +1,16 @@ from __future__ import unicode_literals + import unittest -import frappe +import frappe from frappe.utils.make_random import get_random -from erpnext.projects.report.employee_hours_utilization_based_on_timesheet.employee_hours_utilization_based_on_timesheet import execute + from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.projects.doctype.project.test_project import make_project +from erpnext.projects.report.employee_hours_utilization_based_on_timesheet.employee_hours_utilization_based_on_timesheet import ( + execute, +) + class TestEmployeeUtilization(unittest.TestCase): @classmethod diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.py b/erpnext/projects/report/project_billing_summary/project_billing_summary.py index 17c92c234d5e..e71dded3f354 100644 --- a/erpnext/projects/report/project_billing_summary/project_billing_summary.py +++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext.projects.report.billing_summary import get_columns, get_data + def execute(filters=None): filters = frappe._dict(filters or {}) columns = get_columns() diff --git a/erpnext/projects/report/project_profitability/project_profitability.py b/erpnext/projects/report/project_profitability/project_profitability.py index 0a52f7bf904c..13e02c89355a 100644 --- a/erpnext/projects/report/project_profitability/project_profitability.py +++ b/erpnext/projects/report/project_profitability/project_profitability.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): columns, data = [], [] data = get_data(filters) diff --git a/erpnext/projects/report/project_profitability/test_project_profitability.py b/erpnext/projects/report/project_profitability/test_project_profitability.py index 180926fe258d..8cf169b38f4f 100644 --- a/erpnext/projects/report/project_profitability/test_project_profitability.py +++ b/erpnext/projects/report/project_profitability/test_project_profitability.py @@ -1,12 +1,19 @@ from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import getdate, nowdate, add_days +from frappe.utils import add_days, getdate, nowdate + from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.projects.doctype.timesheet.test_timesheet import make_salary_structure_for_timesheet, make_timesheet +from erpnext.projects.doctype.timesheet.test_timesheet import ( + make_salary_structure_for_timesheet, + make_timesheet, +) from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice from erpnext.projects.report.project_profitability.project_profitability import execute + class TestProjectProfitability(unittest.TestCase): def setUp(self): diff --git a/erpnext/projects/report/project_summary/project_summary.py b/erpnext/projects/report/project_summary/project_summary.py index 98dd617f9b3f..dbb4e8485783 100644 --- a/erpnext/projects/report/project_summary/project_summary.py +++ b/erpnext/projects/report/project_summary/project_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns() data = [] diff --git a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py index c13d7cf3344c..5d2b7dbc5be4 100644 --- a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py +++ b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py @@ -5,6 +5,7 @@ import frappe from frappe import _ + def execute(filters=None): columns = get_columns() proj_details = get_project_details() diff --git a/erpnext/projects/utils.py b/erpnext/projects/utils.py index c39f908e43e5..69264704b4b0 100644 --- a/erpnext/projects/utils.py +++ b/erpnext/projects/utils.py @@ -4,8 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe + @frappe.whitelist() @frappe.validate_and_sanitize_search_inputs def query_task(doctype, txt, searchfield, start, page_len, filters): diff --git a/erpnext/projects/web_form/tasks/tasks.py b/erpnext/projects/web_form/tasks/tasks.py index e5a94048be1b..aed794261eab 100644 --- a/erpnext/projects/web_form/tasks/tasks.py +++ b/erpnext/projects/web_form/tasks/tasks.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): if frappe.form_dict.project: context.parents = [{'title': frappe.form_dict.project, 'route': '/projects?project='+ frappe.form_dict.project}] diff --git a/erpnext/quality_management/doctype/non_conformance/non_conformance.py b/erpnext/quality_management/doctype/non_conformance/non_conformance.py index d4e8cc7a7167..a4613fdaf6b2 100644 --- a/erpnext/quality_management/doctype/non_conformance/non_conformance.py +++ b/erpnext/quality_management/doctype/non_conformance/non_conformance.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class NonConformance(Document): pass diff --git a/erpnext/quality_management/doctype/non_conformance/test_non_conformance.py b/erpnext/quality_management/doctype/non_conformance/test_non_conformance.py index 54f8b58cfb0d..759b117f9b09 100644 --- a/erpnext/quality_management/doctype/non_conformance/test_non_conformance.py +++ b/erpnext/quality_management/doctype/non_conformance/test_non_conformance.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestNonConformance(unittest.TestCase): pass diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.py b/erpnext/quality_management/doctype/quality_action/quality_action.py index 02401ba689d0..5e459a159539 100644 --- a/erpnext/quality_management/doctype/quality_action/quality_action.py +++ b/erpnext/quality_management/doctype/quality_action/quality_action.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QualityAction(Document): def validate(self): self.status = 'Open' if any([d.status=='Open' for d in self.resolutions]) else 'Completed' diff --git a/erpnext/quality_management/doctype/quality_action/test_quality_action.py b/erpnext/quality_management/doctype/quality_action/test_quality_action.py index 98d665f3910b..2864b5e550f5 100644 --- a/erpnext/quality_management/doctype/quality_action/test_quality_action.py +++ b/erpnext/quality_management/doctype/quality_action/test_quality_action.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQualityAction(unittest.TestCase): # quality action has no code pass diff --git a/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py index de8873feb0c2..b456fb7e9a07 100644 --- a/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py +++ b/erpnext/quality_management/doctype/quality_action_resolution/quality_action_resolution.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityActionResolution(Document): pass diff --git a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py index d3e96cf2d94d..9189c2829736 100644 --- a/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py +++ b/erpnext/quality_management/doctype/quality_feedback/quality_feedback.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QualityFeedback(Document): @frappe.whitelist() def set_parameters(self): diff --git a/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py b/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py index 5a8bd5ce30c1..7a87c362446b 100644 --- a/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py +++ b/erpnext/quality_management/doctype/quality_feedback/test_quality_feedback.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + class TestQualityFeedback(unittest.TestCase): def test_quality_feedback(self): diff --git a/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py index d652e8a57bbc..9a21b2636035 100644 --- a/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py +++ b/erpnext/quality_management/doctype/quality_feedback_parameter/quality_feedback_parameter.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityFeedbackParameter(Document): pass diff --git a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py index 0c6dfc078027..c6a520a3c590 100644 --- a/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py +++ b/erpnext/quality_management/doctype/quality_feedback_template/quality_feedback_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityFeedbackTemplate(Document): pass diff --git a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py index afed14b6ad0e..bf1a1117e09e 100644 --- a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py +++ b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQualityFeedbackTemplate(unittest.TestCase): pass diff --git a/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py index 3f3348fd7fa6..44a6b014a0cf 100644 --- a/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py +++ b/erpnext/quality_management/doctype/quality_feedback_template_parameter/quality_feedback_template_parameter.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityFeedbackTemplateParameter(Document): pass diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.py b/erpnext/quality_management/doctype/quality_goal/quality_goal.py index 3e616b75ceb2..f2f44d98f0ae 100644 --- a/erpnext/quality_management/doctype/quality_goal/quality_goal.py +++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.py @@ -3,10 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class QualityGoal(Document): def validate(self): pass diff --git a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py index 0e135b50212b..7024abdc35a9 100644 --- a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py +++ b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py @@ -3,9 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import create_procedure + +import frappe + +from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import ( + create_procedure, +) + class TestQualityGoal(unittest.TestCase): def test_quality_goal(self): diff --git a/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py index f4bd357f1b2f..c9c2c6e564cc 100644 --- a/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py +++ b/erpnext/quality_management/doctype/quality_goal_objective/quality_goal_objective.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityGoalObjective(Document): pass diff --git a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py index 9e453ebfc2eb..0ac0484399e7 100644 --- a/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py +++ b/erpnext/quality_management/doctype/quality_meeting/quality_meeting.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class QualityMeeting(Document): pass diff --git a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py index 6bf4c179c6bb..bf4451d63feb 100644 --- a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py +++ b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestQualityMeeting(unittest.TestCase): # nothing to test pass diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py index 5d77975d74c5..5e4d9ff37a7e 100644 --- a/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py +++ b/erpnext/quality_management/doctype/quality_meeting_agenda/quality_meeting_agenda.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityMeetingAgenda(Document): pass diff --git a/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py b/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py index 4750cc1f7af1..8744d275ed8b 100644 --- a/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py +++ b/erpnext/quality_management/doctype/quality_meeting_agenda/test_quality_meeting_agenda.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestQualityMeetingAgenda(unittest.TestCase): pass diff --git a/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py index 47b2c95bd9e6..e3d061b36cad 100644 --- a/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py +++ b/erpnext/quality_management/doctype/quality_meeting_minutes/quality_meeting_minutes.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityMeetingMinutes(Document): pass diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py index 117db0012ba8..0c724a73c67b 100644 --- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py +++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils.nestedset import NestedSet, rebuild_tree from frappe import _ +from frappe.utils.nestedset import NestedSet, rebuild_tree + class QualityProcedure(NestedSet): nsm_parent_field = 'parent_quality_procedure' diff --git a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py index 4fa7734bc685..b064011bf6ca 100644 --- a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py +++ b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py @@ -3,11 +3,13 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + from .quality_procedure import add_node + class TestQualityProcedure(unittest.TestCase): def test_add_node(self): try: diff --git a/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py index 0d9a286052de..e281294643df 100644 --- a/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py +++ b/erpnext/quality_management/doctype/quality_procedure_process/quality_procedure_process.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityProcedureProcess(Document): pass diff --git a/erpnext/quality_management/doctype/quality_review/quality_review.py b/erpnext/quality_management/doctype/quality_review/quality_review.py index 34cc890e2197..b766623510a7 100644 --- a/erpnext/quality_management/doctype/quality_review/quality_review.py +++ b/erpnext/quality_management/doctype/quality_review/quality_review.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QualityReview(Document): def validate(self): # fetch targets from goal diff --git a/erpnext/quality_management/doctype/quality_review/test_quality_review.py b/erpnext/quality_management/doctype/quality_review/test_quality_review.py index 161ecd01ef1c..2f28ddac45e6 100644 --- a/erpnext/quality_management/doctype/quality_review/test_quality_review.py +++ b/erpnext/quality_management/doctype/quality_review/test_quality_review.py @@ -3,12 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + from ..quality_goal.test_quality_goal import get_quality_goal from .quality_review import review + class TestQualityReview(unittest.TestCase): def test_review_creation(self): quality_goal = get_quality_goal() diff --git a/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py index 3092a1e9979d..23b11e87e6a7 100644 --- a/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py +++ b/erpnext/quality_management/doctype/quality_review_objective/quality_review_objective.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityReviewObjective(Document): pass diff --git a/erpnext/regional/__init__.py b/erpnext/regional/__init__.py index faa59129a5aa..45a689efa8ba 100644 --- a/erpnext/regional/__init__.py +++ b/erpnext/regional/__init__.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + from erpnext import get_region + def check_deletion_permission(doc, method): region = get_region(doc.company) if region in ["Nepal", "France"] and doc.docstatus != 0: diff --git a/erpnext/regional/address_template/setup.py b/erpnext/regional/address_template/setup.py index 1b4087d77bad..0f9a1b19f53a 100644 --- a/erpnext/regional/address_template/setup.py +++ b/erpnext/regional/address_template/setup.py @@ -1,7 +1,9 @@ """Import Address Templates from ./templates directory.""" import os + import frappe + def set_up_address_templates(default_country=None): for country, html in get_address_templates(): is_default = 1 if country == default_country else 0 diff --git a/erpnext/regional/address_template/test_regional_address_template.py b/erpnext/regional/address_template/test_regional_address_template.py index 8a05ea26f450..2880d6253f91 100644 --- a/erpnext/regional/address_template/test_regional_address_template.py +++ b/erpnext/regional/address_template/test_regional_address_template.py @@ -1,9 +1,11 @@ from __future__ import unicode_literals + from unittest import TestCase import frappe -from erpnext.regional.address_template.setup import get_address_templates -from erpnext.regional.address_template.setup import update_address_template + +from erpnext.regional.address_template.setup import get_address_templates, update_address_template + def ensure_country(country): if frappe.db.exists("Country", country): diff --git a/erpnext/regional/doctype/datev_settings/datev_settings.py b/erpnext/regional/doctype/datev_settings/datev_settings.py index cff5bba58fd0..0d2d9eb4b478 100644 --- a/erpnext/regional/doctype/datev_settings/datev_settings.py +++ b/erpnext/regional/doctype/datev_settings/datev_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class DATEVSettings(Document): pass diff --git a/erpnext/regional/doctype/datev_settings/test_datev_settings.py b/erpnext/regional/doctype/datev_settings/test_datev_settings.py index 0271329f4d24..73412f755d75 100644 --- a/erpnext/regional/doctype/datev_settings/test_datev_settings.py +++ b/erpnext/regional/doctype/datev_settings/test_datev_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestDATEVSettings(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/e_invoice_request_log/e_invoice_request_log.py b/erpnext/regional/doctype/e_invoice_request_log/e_invoice_request_log.py index 9150bdd92607..38fe3089412a 100644 --- a/erpnext/regional/doctype/e_invoice_request_log/e_invoice_request_log.py +++ b/erpnext/regional/doctype/e_invoice_request_log/e_invoice_request_log.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EInvoiceRequestLog(Document): pass diff --git a/erpnext/regional/doctype/e_invoice_request_log/test_e_invoice_request_log.py b/erpnext/regional/doctype/e_invoice_request_log/test_e_invoice_request_log.py index c84e9a249bdc..091cc88e4541 100644 --- a/erpnext/regional/doctype/e_invoice_request_log/test_e_invoice_request_log.py +++ b/erpnext/regional/doctype/e_invoice_request_log/test_e_invoice_request_log.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestEInvoiceRequestLog(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/e_invoice_settings/e_invoice_settings.py b/erpnext/regional/doctype/e_invoice_settings/e_invoice_settings.py index 4f6b3eca7a63..70ec2ed0679f 100644 --- a/erpnext/regional/doctype/e_invoice_settings/e_invoice_settings.py +++ b/erpnext/regional/doctype/e_invoice_settings/e_invoice_settings.py @@ -7,6 +7,7 @@ from frappe import _ from frappe.model.document import Document + class EInvoiceSettings(Document): def validate(self): if self.enable and not self.credentials: diff --git a/erpnext/regional/doctype/e_invoice_settings/test_e_invoice_settings.py b/erpnext/regional/doctype/e_invoice_settings/test_e_invoice_settings.py index a11ce63ee6c3..10770deb0ee5 100644 --- a/erpnext/regional/doctype/e_invoice_settings/test_e_invoice_settings.py +++ b/erpnext/regional/doctype/e_invoice_settings/test_e_invoice_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestEInvoiceSettings(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/e_invoice_user/e_invoice_user.py b/erpnext/regional/doctype/e_invoice_user/e_invoice_user.py index 056c54f069d6..a0fe399f1103 100644 --- a/erpnext/regional/doctype/e_invoice_user/e_invoice_user.py +++ b/erpnext/regional/doctype/e_invoice_user/e_invoice_user.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EInvoiceUser(Document): pass diff --git a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.py b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.py index 4791dc26753d..0704de8387f5 100644 --- a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.py +++ b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class GSTHSNCode(Document): pass diff --git a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py index ed54f207139b..3171cf49bc6e 100644 --- a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py +++ b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestGSTHSNCode(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/gst_settings/gst_settings.py b/erpnext/regional/doctype/gst_settings/gst_settings.py index af3d92e59a7a..7b27fb6c5bce 100644 --- a/erpnext/regional/doctype/gst_settings/gst_settings.py +++ b/erpnext/regional/doctype/gst_settings/gst_settings.py @@ -3,11 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, os + +import os + +import frappe from frappe import _ -from frappe.utils import get_url, nowdate, date_diff -from frappe.model.document import Document from frappe.contacts.doctype.contact.contact import get_default_contact +from frappe.model.document import Document +from frappe.utils import date_diff, get_url, nowdate + class EmailMissing(frappe.ValidationError): pass diff --git a/erpnext/regional/doctype/gst_settings/test_gst_settings.py b/erpnext/regional/doctype/gst_settings/test_gst_settings.py index d118dee6177d..624bd349f696 100644 --- a/erpnext/regional/doctype/gst_settings/test_gst_settings.py +++ b/erpnext/regional/doctype/gst_settings/test_gst_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestGSTSettings(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 0ee5b097b548..d8ce31973952 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -3,15 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import os + import json +import os + import frappe -from six import iteritems from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, cstr +from frappe.utils import cstr, flt +from six import iteritems + from erpnext.regional.india import state_numbers + class GSTR3BReport(Document): def validate(self): self.get_data() diff --git a/erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py index 065f80d610a9..115f9b881656 100644 --- a/erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py @@ -3,13 +3,15 @@ # See license.txt from __future__ import unicode_literals -import frappe +import json import unittest + +import frappe from frappe.utils import getdate -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.stock.doctype.item.test_item import make_item -import json test_dependencies = ["Territory", "Customer Group", "Supplier Group", "Item"] diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py index 00300539e9a1..2a989cba6ca8 100644 --- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py +++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py @@ -3,21 +3,25 @@ from __future__ import unicode_literals -from decimal import Decimal import json import re import traceback import zipfile -import frappe, erpnext +from decimal import Decimal + +import dateutil +import frappe +from bs4 import BeautifulSoup as bs from frappe import _ -from frappe.model.document import Document from frappe.custom.doctype.custom_field.custom_field import create_custom_field +from frappe.model.document import Document +from frappe.utils import add_days, cint, flt, get_datetime_str, get_files_path, nowdate, today from frappe.utils.data import format_datetime -from bs4 import BeautifulSoup as bs -from frappe.utils import cint, flt, today, nowdate, add_days, get_files_path, get_datetime_str -import dateutil from frappe.utils.file_manager import save_file +import erpnext + + class ImportSupplierInvoice(Document): def validate(self): if not frappe.db.get_value("Stock Settings", fieldname="stock_uom"): diff --git a/erpnext/regional/doctype/import_supplier_invoice/test_import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/test_import_supplier_invoice.py index d1caf77fc2c6..4be4c3a22f95 100644 --- a/erpnext/regional/doctype/import_supplier_invoice/test_import_supplier_invoice.py +++ b/erpnext/regional/doctype/import_supplier_invoice/test_import_supplier_invoice.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestImportSupplierInvoice(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.py b/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.py index 656c3296e582..d8553f1d9130 100644 --- a/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.py +++ b/erpnext/regional/doctype/lower_deduction_certificate/lower_deduction_certificate.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import getdate, get_link_to_form from frappe.model.document import Document +from frappe.utils import get_link_to_form, getdate + from erpnext.accounts.utils import get_fiscal_year + class LowerDeductionCertificate(Document): def validate(self): self.validate_dates() diff --git a/erpnext/regional/doctype/lower_deduction_certificate/test_lower_deduction_certificate.py b/erpnext/regional/doctype/lower_deduction_certificate/test_lower_deduction_certificate.py index 7e950206fcc2..54443c0206a4 100644 --- a/erpnext/regional/doctype/lower_deduction_certificate/test_lower_deduction_certificate.py +++ b/erpnext/regional/doctype/lower_deduction_certificate/test_lower_deduction_certificate.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestLowerDeductionCertificate(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.py b/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.py index d74154bfe786..4c3e8a78e9de 100644 --- a/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.py +++ b/erpnext/regional/doctype/south_africa_vat_settings/south_africa_vat_settings.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class SouthAfricaVATSettings(Document): pass diff --git a/erpnext/regional/doctype/south_africa_vat_settings/test_south_africa_vat_settings.py b/erpnext/regional/doctype/south_africa_vat_settings/test_south_africa_vat_settings.py index 1c36652ad6e6..0f19f25f88d8 100644 --- a/erpnext/regional/doctype/south_africa_vat_settings/test_south_africa_vat_settings.py +++ b/erpnext/regional/doctype/south_africa_vat_settings/test_south_africa_vat_settings.py @@ -4,5 +4,6 @@ # import frappe import unittest + class TestSouthAfricaVATSettings(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py b/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py index 41a0f1193bc2..64b2ec5646c5 100644 --- a/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py +++ b/erpnext/regional/doctype/tax_exemption_80g_certificate/tax_exemption_80g_certificate.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.contacts.doctype.address.address import get_company_address from frappe.model.document import Document -from frappe.utils import getdate, flt, get_link_to_form +from frappe.utils import flt, get_link_to_form, getdate + from erpnext.accounts.utils import get_fiscal_year -from frappe.contacts.doctype.address.address import get_company_address + class TaxExemption80GCertificate(Document): def validate(self): diff --git a/erpnext/regional/doctype/tax_exemption_80g_certificate/test_tax_exemption_80g_certificate.py b/erpnext/regional/doctype/tax_exemption_80g_certificate/test_tax_exemption_80g_certificate.py index 41b42036687f..74e9ced39412 100644 --- a/erpnext/regional/doctype/tax_exemption_80g_certificate/test_tax_exemption_80g_certificate.py +++ b/erpnext/regional/doctype/tax_exemption_80g_certificate/test_tax_exemption_80g_certificate.py @@ -3,14 +3,21 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe from frappe.utils import getdate + from erpnext.accounts.utils import get_fiscal_year -from erpnext.non_profit.doctype.donation.test_donation import create_donor, create_mode_of_payment, create_donor_type from erpnext.non_profit.doctype.donation.donation import create_donation -from erpnext.non_profit.doctype.membership.test_membership import setup_membership, make_membership +from erpnext.non_profit.doctype.donation.test_donation import ( + create_donor, + create_donor_type, + create_mode_of_payment, +) from erpnext.non_profit.doctype.member.member import create_member +from erpnext.non_profit.doctype.membership.test_membership import make_membership, setup_membership + class TestTaxExemption80GCertificate(unittest.TestCase): def setUp(self): diff --git a/erpnext/regional/doctype/tax_exemption_80g_certificate_detail/tax_exemption_80g_certificate_detail.py b/erpnext/regional/doctype/tax_exemption_80g_certificate_detail/tax_exemption_80g_certificate_detail.py index bdad798d980f..76d8912b004f 100644 --- a/erpnext/regional/doctype/tax_exemption_80g_certificate_detail/tax_exemption_80g_certificate_detail.py +++ b/erpnext/regional/doctype/tax_exemption_80g_certificate_detail/tax_exemption_80g_certificate_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TaxExemption80GCertificateDetail(Document): pass diff --git a/erpnext/regional/doctype/uae_vat_account/uae_vat_account.py b/erpnext/regional/doctype/uae_vat_account/uae_vat_account.py index 80d6b3a5f1f4..a1b27d7e3d34 100644 --- a/erpnext/regional/doctype/uae_vat_account/uae_vat_account.py +++ b/erpnext/regional/doctype/uae_vat_account/uae_vat_account.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class UAEVATAccount(Document): pass diff --git a/erpnext/regional/doctype/uae_vat_settings/test_uae_vat_settings.py b/erpnext/regional/doctype/uae_vat_settings/test_uae_vat_settings.py index b88439f9b853..cec30e61cefb 100644 --- a/erpnext/regional/doctype/uae_vat_settings/test_uae_vat_settings.py +++ b/erpnext/regional/doctype/uae_vat_settings/test_uae_vat_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestUAEVATSettings(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.py b/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.py index 20dc604510b8..1bf37dd499d7 100644 --- a/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.py +++ b/erpnext/regional/doctype/uae_vat_settings/uae_vat_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class UAEVATSettings(Document): pass diff --git a/erpnext/regional/france/setup.py b/erpnext/regional/france/setup.py index db6419e94624..3e3a9f6e56a2 100644 --- a/erpnext/regional/france/setup.py +++ b/erpnext/regional/france/setup.py @@ -6,6 +6,7 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def setup(company=None, patch=True): make_custom_fields() add_custom_roles_for_reports() diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py index 424615dbbc08..b2f85690fc29 100644 --- a/erpnext/regional/france/utils.py +++ b/erpnext/regional/france/utils.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe + # don't remove this function it is used in tests def test_method(): '''test function''' diff --git a/erpnext/regional/germany/setup.py b/erpnext/regional/germany/setup.py index c1fa6e492d1c..25221a302ecc 100644 --- a/erpnext/regional/germany/setup.py +++ b/erpnext/regional/germany/setup.py @@ -1,4 +1,5 @@ import os + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields diff --git a/erpnext/regional/germany/utils/datev/datev_csv.py b/erpnext/regional/germany/utils/datev/datev_csv.py index c5c2bc41f4da..18517dd70912 100644 --- a/erpnext/regional/germany/utils/datev/datev_csv.py +++ b/erpnext/regional/germany/utils/datev/datev_csv.py @@ -4,12 +4,13 @@ import datetime import zipfile from csv import QUOTE_NONNUMERIC -from six import BytesIO -import six import frappe import pandas as pd +import six from frappe import _ +from six import BytesIO + from .datev_constants import DataCategory diff --git a/erpnext/regional/india/__init__.py b/erpnext/regional/india/__init__.py index faeb36fc6931..5c4d30881d15 100644 --- a/erpnext/regional/india/__init__.py +++ b/erpnext/regional/india/__init__.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from six import iteritems states = [ diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index fe4c172e237e..a4c98eb651ab 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -3,24 +3,39 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import base64 +import io +import json import os import re -import jwt import sys -import json -import base64 +import traceback + import frappe +import jwt import six -import traceback -import io from frappe import _, bold -from pyqrcode import create as qrcreate +from frappe.core.page.background_jobs.background_jobs import get_info +from frappe.integrations.utils import make_get_request, make_post_request from frappe.utils.background_jobs import enqueue +from frappe.utils.data import ( + add_to_date, + cint, + cstr, + flt, + format_date, + get_link_to_form, + getdate, + now_datetime, + time_diff_in_hours, + time_diff_in_seconds, +) from frappe.utils.scheduler import is_scheduler_inactive -from frappe.core.page.background_jobs.background_jobs import get_info -from frappe.integrations.utils import make_post_request, make_get_request +from pyqrcode import create as qrcreate + from erpnext.regional.india.utils import get_gst_accounts, get_place_of_supply -from frappe.utils.data import cstr, cint, format_date, flt, time_diff_in_seconds, now_datetime, add_to_date, get_link_to_form, getdate, time_diff_in_hours + @frappe.whitelist() def validate_eligibility(doc): diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index 2d6b9133900a..bfeb9590797e 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -3,14 +3,19 @@ from __future__ import unicode_literals -import frappe, os, json +import json +import os + +import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.custom.doctype.property_setter.property_setter import make_property_setter from frappe.permissions import add_permission, update_permission_property -from erpnext.regional.india import states -from erpnext.accounts.utils import get_fiscal_year, FiscalYearError from frappe.utils import today +from erpnext.accounts.utils import FiscalYearError, get_fiscal_year +from erpnext.regional.india import states + + def setup(company=None, patch=True): # Company independent fixtures should be called only once at the first company setup if frappe.db.count('Company', {'country': 'India'}) <=1: diff --git a/erpnext/regional/india/test_utils.py b/erpnext/regional/india/test_utils.py index a16f56c704ae..2c77c8d8aa8f 100644 --- a/erpnext/regional/india/test_utils.py +++ b/erpnext/regional/india/test_utils.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals import unittest -import frappe from unittest.mock import patch + +import frappe + from erpnext.regional.india.utils import validate_document_name diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index ce5aa10902ee..90ece88805a5 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -1,19 +1,31 @@ from __future__ import unicode_literals -import frappe, re, json + +import json +import re + +import frappe from frappe import _ +from frappe.model.utils import get_fetch_values +from frappe.utils import ( + cint, + cstr, + date_diff, + flt, + getdate, + money_in_words, + nowdate, + round_based_on_smallest_currency_fraction, +) +from six import string_types + import erpnext -from frappe.utils import cstr, flt, cint, date_diff, nowdate, round_based_on_smallest_currency_fraction, money_in_words, getdate -from erpnext.regional.india import states, state_numbers -from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount +from erpnext.accounts.general_ledger import make_gl_entries +from erpnext.accounts.utils import get_account_currency from erpnext.controllers.accounts_controller import get_taxes_and_charges +from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount from erpnext.hr.utils import get_salary_assignment from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip -from erpnext.regional.india import number_state_mapping -from six import string_types -from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.accounts.utils import get_account_currency -from frappe.model.utils import get_fetch_values - +from erpnext.regional.india import number_state_mapping, state_numbers, states GST_INVOICE_NUMBER_FORMAT = re.compile(r"^[a-zA-Z0-9\-/]+$") #alphanumeric and - / GSTIN_FORMAT = re.compile("^[0-9]{2}[A-Z]{4}[0-9A-Z]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[1-9A-Z]{1}[0-9A-Z]{1}$") diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py index 7db2f6b0f8d1..291906af9cdd 100644 --- a/erpnext/regional/italy/setup.py +++ b/erpnext/regional/italy/setup.py @@ -8,7 +8,14 @@ from frappe import _ from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.permissions import add_permission, update_permission_property -from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons, mode_of_payment_codes, vat_collectability_options + +from erpnext.regional.italy import ( + fiscal_regimes, + mode_of_payment_codes, + tax_exemption_reasons, + vat_collectability_options, +) + def setup(company=None, patch=True): make_custom_fields() diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index 024f82056868..94562ffc1f5c 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -2,13 +2,15 @@ import io import json + import frappe -from frappe.utils import flt, cstr -from erpnext.controllers.taxes_and_totals import get_itemised_tax from frappe import _ +from frappe.desk.form.load import get_attachments +from frappe.utils import cstr, flt from frappe.utils.file_manager import remove_file from six import string_types -from frappe.desk.form.load import get_attachments + +from erpnext.controllers.taxes_and_totals import get_itemised_tax from erpnext.regional.italy import state_codes diff --git a/erpnext/regional/report/datev/datev.py b/erpnext/regional/report/datev/datev.py index 02398d19ea2b..dcabe368aa58 100644 --- a/erpnext/regional/report/datev/datev.py +++ b/erpnext/regional/report/datev/datev.py @@ -10,13 +10,18 @@ from __future__ import unicode_literals import json + import frappe +from frappe import _ from six import string_types -from frappe import _ from erpnext.accounts.utils import get_fiscal_year -from erpnext.regional.germany.utils.datev.datev_csv import zip_and_download, get_datev_csv -from erpnext.regional.germany.utils.datev.datev_constants import Transactions, DebtorsCreditors, AccountNames +from erpnext.regional.germany.utils.datev.datev_constants import ( + AccountNames, + DebtorsCreditors, + Transactions, +) +from erpnext.regional.germany.utils.datev.datev_csv import get_datev_csv, zip_and_download COLUMNS = [ { diff --git a/erpnext/regional/report/datev/test_datev.py b/erpnext/regional/report/datev/test_datev.py index 59b878e94a5b..bd3654585aa1 100644 --- a/erpnext/regional/report/datev/test_datev.py +++ b/erpnext/regional/report/datev/test_datev.py @@ -2,21 +2,28 @@ from __future__ import unicode_literals import zipfile -import frappe -from six import BytesIO from unittest import TestCase -from frappe.utils import today, now_datetime, cstr -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from erpnext.regional.report.datev.datev import validate -from erpnext.regional.report.datev.datev import get_transactions -from erpnext.regional.report.datev.datev import get_customers -from erpnext.regional.report.datev.datev import get_suppliers -from erpnext.regional.report.datev.datev import get_account_names -from erpnext.regional.report.datev.datev import download_datev_csv +import frappe +from frappe.utils import cstr, now_datetime, today +from six import BytesIO +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice +from erpnext.regional.germany.utils.datev.datev_constants import ( + AccountNames, + DebtorsCreditors, + Transactions, +) from erpnext.regional.germany.utils.datev.datev_csv import get_datev_csv, get_header -from erpnext.regional.germany.utils.datev.datev_constants import Transactions, DebtorsCreditors, AccountNames +from erpnext.regional.report.datev.datev import ( + download_datev_csv, + get_account_names, + get_customers, + get_suppliers, + get_transactions, + validate, +) + def make_company(company_name, abbr): if not frappe.db.exists("Company", company_name): diff --git a/erpnext/regional/report/e_invoice_summary/e_invoice_summary.py b/erpnext/regional/report/e_invoice_summary/e_invoice_summary.py index 66ffceae5391..a068a3807763 100644 --- a/erpnext/regional/report/e_invoice_summary/e_invoice_summary.py +++ b/erpnext/regional/report/e_invoice_summary/e_invoice_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): validate_filters(filters) diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py index 376ba3ee471c..f4ce7a77ad9e 100644 --- a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py +++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py @@ -2,7 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from erpnext.accounts.report.sales_register.sales_register import _execute + def execute(filters=None): return _execute(filters) diff --git a/erpnext/regional/report/eway_bill/eway_bill.py b/erpnext/regional/report/eway_bill/eway_bill.py index 09d5f7916793..c78084f7dff1 100644 --- a/erpnext/regional/report/eway_bill/eway_bill.py +++ b/erpnext/regional/report/eway_bill/eway_bill.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json import re + +import frappe from frappe import _ from frappe.utils import nowdate + def execute(filters=None): if not filters: filters.setdefault('posting_date', [nowdate(), nowdate()]) columns, data = [], [] diff --git a/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py b/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py index 697058def524..9567916cd2a7 100644 --- a/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py +++ b/erpnext/regional/report/fichier_des_ecritures_comptables_[fec]/fichier_des_ecritures_comptables_[fec].py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import re + import frappe -from frappe.utils import format_datetime from frappe import _ -import re +from frappe.utils import format_datetime + def execute(filters=None): account_details = {} diff --git a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py index b5948f9952df..092f72adf155 100644 --- a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py +++ b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py @@ -3,7 +3,10 @@ from __future__ import unicode_literals -from erpnext.accounts.report.item_wise_purchase_register.item_wise_purchase_register import _execute +from erpnext.accounts.report.item_wise_purchase_register.item_wise_purchase_register import ( + _execute, +) + def execute(filters=None): return _execute(filters, additional_table_columns=[ diff --git a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py index e13f509f4758..44f623bfae9c 100644 --- a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py +++ b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py @@ -5,6 +5,7 @@ from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import _execute + def execute(filters=None): return _execute(filters, additional_table_columns=[ dict(fieldtype='Data', label='Customer GSTIN', fieldname="customer_gstin", width=120), diff --git a/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py b/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py index 12e9676b4ba6..e9724441b177 100644 --- a/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py +++ b/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py @@ -5,6 +5,7 @@ from erpnext.accounts.report.purchase_register.purchase_register import _execute + def execute(filters=None): return _execute(filters, additional_table_columns=[ dict(fieldtype='Data', label='Supplier GSTIN', fieldname="supplier_gstin", width=120), diff --git a/erpnext/regional/report/gst_sales_register/gst_sales_register.py b/erpnext/regional/report/gst_sales_register/gst_sales_register.py index 075bd483cf0d..6975af35854b 100644 --- a/erpnext/regional/report/gst_sales_register/gst_sales_register.py +++ b/erpnext/regional/report/gst_sales_register/gst_sales_register.py @@ -5,6 +5,7 @@ from erpnext.accounts.report.sales_register.sales_register import _execute + def execute(filters=None): return _execute(filters, additional_table_columns=[ dict(fieldtype='Data', label='Customer GSTIN', fieldname="customer_gstin", width=120), diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 9d4f9206f501..95954ec999ba 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -2,14 +2,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json -from frappe import _ -from frappe.utils import flt, formatdate, now_datetime, getdate + +import json from datetime import date + +import frappe +from frappe import _ +from frappe.utils import flt, formatdate, getdate, now_datetime from six import iteritems + from erpnext.regional.doctype.gstr_3b_report.gstr_3b_report import get_period from erpnext.regional.india.utils import get_gst_accounts + def execute(filters=None): return Gstr1Report(filters).run() diff --git a/erpnext/regional/report/gstr_2/gstr_2.py b/erpnext/regional/report/gstr_2/gstr_2.py index 616c2b853dfe..5e44955ce305 100644 --- a/erpnext/regional/report/gstr_2/gstr_2.py +++ b/erpnext/regional/report/gstr_2/gstr_2.py @@ -2,10 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + from datetime import date + +import frappe + from erpnext.regional.report.gstr_1.gstr_1 import Gstr1Report + def execute(filters=None): return Gstr2Report(filters).run() diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py index 1adddbdae579..340a36921d01 100644 --- a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py +++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py @@ -2,16 +2,21 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import json + +import frappe from frappe import _ -from frappe.utils import flt, getdate, cstr from frappe.model.meta import get_field_precision +from frappe.utils import cstr, flt, getdate from frappe.utils.xlsxutils import handle_html from six import iteritems -import json + +import erpnext from erpnext.regional.india.utils import get_gst_accounts from erpnext.regional.report.gstr_1.gstr_1 import get_company_gstin_number + def execute(filters=None): return _execute(filters) diff --git a/erpnext/regional/report/irs_1099/irs_1099.py b/erpnext/regional/report/irs_1099/irs_1099.py index f67d622fdf83..b1a5d109621f 100644 --- a/erpnext/regional/report/irs_1099/irs_1099.py +++ b/erpnext/regional/report/irs_1099/irs_1099.py @@ -3,16 +3,16 @@ import json -from PyPDF2 import PdfFileWriter - import frappe -from erpnext.accounts.utils import get_fiscal_year from frappe import _ from frappe.utils import cstr, nowdate from frappe.utils.data import fmt_money from frappe.utils.jinja import render_template from frappe.utils.pdf import get_pdf from frappe.utils.print_format import read_multi_pdf +from PyPDF2 import PdfFileWriter + +from erpnext.accounts.utils import get_fiscal_year IRS_1099_FORMS_FILE_EXTENSION = ".pdf" diff --git a/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py index 54808e59e1a6..5300b9289251 100644 --- a/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py +++ b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py @@ -2,9 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import get_conditions + +from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import ( + get_conditions, +) + def execute(filters=None): data = get_data(filters) diff --git a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py index 82423f005cce..ae5d6b90b4e3 100644 --- a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py +++ b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import getdate from frappe import _ +from frappe.utils import getdate + def execute(filters=None): data = get_data(filters) diff --git a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py index daa69768c571..e19aeaa0eff8 100644 --- a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py +++ b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py @@ -1,21 +1,23 @@ # coding=utf-8 from __future__ import unicode_literals -import erpnext -import frappe from unittest import TestCase -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice + +import frappe + +import erpnext from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice -from erpnext.stock.doctype.warehouse.test_warehouse import get_warehouse_account +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.regional.report.uae_vat_201.uae_vat_201 import ( + get_exempt_total, + get_standard_rated_expenses_tax, + get_standard_rated_expenses_total, get_total_emiratewise, - get_tourist_tax_return_total, get_tourist_tax_return_tax, + get_tourist_tax_return_total, get_zero_rated_total, - get_exempt_total, - get_standard_rated_expenses_total, - get_standard_rated_expenses_tax, ) +from erpnext.stock.doctype.warehouse.test_warehouse import get_warehouse_account test_dependencies = ["Territory", "Customer Group", "Supplier Group", "Item"] diff --git a/erpnext/regional/report/uae_vat_201/uae_vat_201.py b/erpnext/regional/report/uae_vat_201/uae_vat_201.py index b0614238ba0e..f4c049d16232 100644 --- a/erpnext/regional/report/uae_vat_201/uae_vat_201.py +++ b/erpnext/regional/report/uae_vat_201/uae_vat_201.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns() data, emirates, amounts_by_emirate = get_data(filters) diff --git a/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py b/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py index dea17a66fda0..77beff36ecde 100644 --- a/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py +++ b/erpnext/regional/report/vat_audit_report/test_vat_audit_report.py @@ -2,16 +2,18 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + from unittest import TestCase + +import frappe from frappe.utils import today from erpnext.accounts.doctype.account.test_account import create_account -from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice - +from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.regional.report.vat_audit_report.vat_audit_report import execute + class TestVATAuditReport(TestCase): def setUp(self): frappe.set_user("Administrator") diff --git a/erpnext/regional/report/vat_audit_report/vat_audit_report.py b/erpnext/regional/report/vat_audit_report/vat_audit_report.py index 88f6b923e663..3637bcaf4394 100644 --- a/erpnext/regional/report/vat_audit_report/vat_audit_report.py +++ b/erpnext/regional/report/vat_audit_report/vat_audit_report.py @@ -2,11 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe from frappe import _ from frappe.utils import formatdate, get_link_to_form + def execute(filters=None): return VATAuditReport(filters).run() diff --git a/erpnext/regional/saudi_arabia/setup.py b/erpnext/regional/saudi_arabia/setup.py index 9b3677d2c64c..3ccaae9e6a53 100644 --- a/erpnext/regional/saudi_arabia/setup.py +++ b/erpnext/regional/saudi_arabia/setup.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals -from erpnext.regional.united_arab_emirates.setup import make_custom_fields, add_print_formats +from erpnext.regional.united_arab_emirates.setup import add_print_formats, make_custom_fields def setup(company=None, patch=True): diff --git a/erpnext/regional/south_africa/setup.py b/erpnext/regional/south_africa/setup.py index d8033b1d6ed8..b13599ed0cb5 100644 --- a/erpnext/regional/south_africa/setup.py +++ b/erpnext/regional/south_africa/setup.py @@ -7,6 +7,7 @@ from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.permissions import add_permission, update_permission_property + def setup(company=None, patch=True): make_custom_fields() add_permissions() diff --git a/erpnext/regional/turkey/setup.py b/erpnext/regional/turkey/setup.py index 2396aab91f52..85d29b5da7f4 100644 --- a/erpnext/regional/turkey/setup.py +++ b/erpnext/regional/turkey/setup.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + def setup(company=None, patch=True): pass diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py index bd12d661f00a..38f6142fc1ee 100644 --- a/erpnext/regional/united_arab_emirates/setup.py +++ b/erpnext/regional/united_arab_emirates/setup.py @@ -3,11 +3,16 @@ from __future__ import unicode_literals -import frappe, os, json +import json +import os + +import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.permissions import add_permission, update_permission_property + from erpnext.payroll.doctype.gratuity_rule.gratuity_rule import get_gratuity_rule + def setup(company=None, patch=True): make_custom_fields() add_print_formats() diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py index 7d5fd6ecf863..66a96514fc16 100644 --- a/erpnext/regional/united_arab_emirates/utils.py +++ b/erpnext/regional/united_arab_emirates/utils.py @@ -1,10 +1,13 @@ from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.utils import flt, money_in_words, round_based_on_smallest_currency_fraction +from six import iteritems + import erpnext -from frappe.utils import flt, round_based_on_smallest_currency_fraction, money_in_words from erpnext.controllers.taxes_and_totals import get_itemised_tax -from six import iteritems + def update_itemised_tax_data(doc): if not doc.taxes: return diff --git a/erpnext/regional/united_states/setup.py b/erpnext/regional/united_states/setup.py index 24ab1cf049f5..338070be817b 100644 --- a/erpnext/regional/united_states/setup.py +++ b/erpnext/regional/united_states/setup.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def setup(company=None, patch=True): make_custom_fields() add_print_formats() diff --git a/erpnext/regional/united_states/test_united_states.py b/erpnext/regional/united_states/test_united_states.py index 513570ed6df5..19e9a3546f8f 100644 --- a/erpnext/regional/united_states/test_united_states.py +++ b/erpnext/regional/united_states/test_united_states.py @@ -1,8 +1,11 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import unittest + +import frappe + from erpnext.regional.report.irs_1099.irs_1099 import execute as execute_1099_report diff --git a/erpnext/restaurant/doctype/restaurant/restaurant.py b/erpnext/restaurant/doctype/restaurant/restaurant.py index 0bb7b692c753..10d79b579678 100644 --- a/erpnext/restaurant/doctype/restaurant/restaurant.py +++ b/erpnext/restaurant/doctype/restaurant/restaurant.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Restaurant(Document): pass diff --git a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py index adce5c733523..5b78bb2f45a0 100644 --- a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py +++ b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'restaurant', diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.py b/erpnext/restaurant/doctype/restaurant/test_restaurant.py index 3ba7f5785eba..9fa075d6874b 100644 --- a/erpnext/restaurant/doctype/restaurant/test_restaurant.py +++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = [ dict(doctype='Restaurant', name='Test Restaurant 1', company='_Test Company 1', invoice_series_prefix='Test-Rest-1-Inv-', default_customer='_Test Customer 1'), diff --git a/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py index 952c46769b78..632f4850d8af 100644 --- a/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py +++ b/erpnext/restaurant/doctype/restaurant_menu/restaurant_menu.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class RestaurantMenu(Document): def validate(self): for d in self.items: diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py index 29f95fd8b1fe..00cbf358d6f4 100644 --- a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py +++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = [ dict(doctype='Item', item_code='Food Item 1', item_group='Products', is_stock_item=0), diff --git a/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py index cc86bb3165e5..276e4822f178 100644 --- a/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py +++ b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class RestaurantMenuItem(Document): pass diff --git a/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py index 357deaac0077..1ed5921f350d 100644 --- a/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py +++ b/erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.py @@ -3,11 +3,16 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json -from frappe.model.document import Document + +import json + +import frappe from frappe import _ +from frappe.model.document import Document + from erpnext.controllers.queries import item_query + class RestaurantOrderEntry(Document): pass diff --git a/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py index e0c051b1ad71..f45ea0fe01c5 100644 --- a/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py +++ b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class RestaurantOrderEntryItem(Document): pass diff --git a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py index f96de44c3d6c..d369afbd7ec2 100644 --- a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py +++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + +from datetime import timedelta + import frappe from frappe.model.document import Document -from datetime import timedelta from frappe.utils import get_datetime + class RestaurantReservation(Document): def validate(self): if not self.reservation_end_time: diff --git a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py index 71681b2f183a..b74fc13af3b0 100644 --- a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py +++ b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestRestaurantReservation(unittest.TestCase): pass diff --git a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py index d5ea9d539818..c1efc69fe74a 100644 --- a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py +++ b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py @@ -3,10 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, re + +import re + +import frappe from frappe.model.document import Document from frappe.model.naming import make_autoname + class RestaurantTable(Document): def autoname(self): prefix = re.sub('-+', '-', self.restaurant.replace(' ', '-')) diff --git a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py index ffdb6f742a36..9651a9104a72 100644 --- a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py +++ b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = [ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1), dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1), diff --git a/erpnext/selling/doctype/campaign/campaign.py b/erpnext/selling/doctype/campaign/campaign.py index 10945428aee4..09fea9a987c2 100644 --- a/erpnext/selling/doctype/campaign/campaign.py +++ b/erpnext/selling/doctype/campaign/campaign.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document from frappe.model.naming import set_name_by_naming_series + class Campaign(Document): def autoname(self): if frappe.defaults.get_global_default('campaign_naming_by') != 'Naming Series': diff --git a/erpnext/selling/doctype/campaign/campaign_dashboard.py b/erpnext/selling/doctype/campaign/campaign_dashboard.py index 3cef560c32f8..990ebaae79c6 100644 --- a/erpnext/selling/doctype/campaign/campaign_dashboard.py +++ b/erpnext/selling/doctype/campaign/campaign_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'campaign_name', diff --git a/erpnext/selling/doctype/campaign/test_campaign.py b/erpnext/selling/doctype/campaign/test_campaign.py index 8c6617fe79a7..bcb985b50f73 100644 --- a/erpnext/selling/doctype/campaign/test_campaign.py +++ b/erpnext/selling/doctype/campaign/test_campaign.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Campaign') diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 27e9f08e8d62..2ae1ce1724e0 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -2,20 +2,30 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json -from frappe.model.naming import set_name_by_naming_series -from frappe import _, msgprint + +import frappe import frappe.defaults -from frappe.utils import flt, cint, cstr, today, get_formatted_email +from frappe import _, msgprint +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.desk.reportview import build_match_conditions, get_filters_cond -from erpnext.utilities.transaction_base import TransactionBase -from erpnext.accounts.party import validate_party_accounts, get_dashboard_info, get_timeline_data # keep this -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address -from frappe.model.rename_doc import update_linked_doctypes from frappe.model.mapper import get_mapped_doc +from frappe.model.naming import set_name_by_naming_series +from frappe.model.rename_doc import update_linked_doctypes +from frappe.utils import cint, cstr, flt, get_formatted_email, today from frappe.utils.user import get_users_with_role +from erpnext.accounts.party import ( # keep this + get_dashboard_info, + get_timeline_data, + validate_party_accounts, +) +from erpnext.utilities.transaction_base import TransactionBase + class Customer(TransactionBase): def get_feed(self): diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 5b337313d3d0..73daa85986bc 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -3,13 +3,14 @@ from __future__ import unicode_literals -import frappe import unittest -from erpnext.accounts.party import get_due_date +import frappe from frappe.test_runner import make_test_records -from erpnext.exceptions import PartyFrozen, PartyDisabled from frappe.utils import flt + +from erpnext.accounts.party import get_due_date +from erpnext.exceptions import PartyDisabled, PartyFrozen from erpnext.selling.doctype.customer.customer import get_credit_limit, get_customer_outstanding from erpnext.tests.utils import create_test_contact_and_address @@ -19,6 +20,7 @@ from six import iteritems + class TestCustomer(unittest.TestCase): def setUp(self): if not frappe.get_value('Item', '_Test Item'): @@ -253,10 +255,10 @@ def get_customer_outstanding_amount(self): return get_customer_outstanding('_Test Customer', '_Test Company') def test_customer_credit_limit(self): - from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice - from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice + from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order + from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note outstanding_amt = self.get_customer_outstanding_amount() credit_limit = get_credit_limit('_Test Customer', '_Test Company') diff --git a/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.py b/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.py index 60a4a9a5d25c..53bcc1b102eb 100644 --- a/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.py +++ b/erpnext/selling/doctype/customer_credit_limit/customer_credit_limit.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class CustomerCreditLimit(Document): pass diff --git a/erpnext/selling/doctype/industry_type/industry_type.py b/erpnext/selling/doctype/industry_type/industry_type.py index 7a30d6524a0c..a314cc4e5b48 100644 --- a/erpnext/selling/doctype/industry_type/industry_type.py +++ b/erpnext/selling/doctype/industry_type/industry_type.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class IndustryType(Document): pass diff --git a/erpnext/selling/doctype/industry_type/test_industry_type.py b/erpnext/selling/doctype/industry_type/test_industry_type.py index ebc6366155e2..d6cf79ba89b9 100644 --- a/erpnext/selling/doctype/industry_type/test_industry_type.py +++ b/erpnext/selling/doctype/industry_type/test_industry_type.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Industry Type') diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index ffcbb2daf09b..128a9415c874 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -2,15 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe +from frappe import _ from frappe.utils import cstr, getdate -from frappe import _ from erpnext.stock.utils import get_valid_serial_nos - from erpnext.utilities.transaction_base import TransactionBase + class InstallationNote(TransactionBase): def __init__(self, *args, **kwargs): super(InstallationNote, self).__init__(*args, **kwargs) diff --git a/erpnext/selling/doctype/installation_note/test_installation_note.py b/erpnext/selling/doctype/installation_note/test_installation_note.py index 553d070da0fd..7135817f834e 100644 --- a/erpnext/selling/doctype/installation_note/test_installation_note.py +++ b/erpnext/selling/doctype/installation_note/test_installation_note.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Installation Note') class TestInstallationNote(unittest.TestCase): diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.py b/erpnext/selling/doctype/installation_note_item/installation_note_item.py index 7e1205231bbb..8295fd0bdbd2 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.py +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class InstallationNoteItem(Document): pass diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.py b/erpnext/selling/doctype/product_bundle/product_bundle.py index ae3482f402ba..4c73916f8526 100644 --- a/erpnext/selling/doctype/product_bundle/product_bundle.py +++ b/erpnext/selling/doctype/product_bundle/product_bundle.py @@ -2,13 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe - -from frappe.utils import get_link_to_form +import frappe from frappe import _ - from frappe.model.document import Document +from frappe.utils import get_link_to_form + class ProductBundle(Document): def autoname(self): diff --git a/erpnext/selling/doctype/product_bundle/test_product_bundle.py b/erpnext/selling/doctype/product_bundle/test_product_bundle.py index 7d1d372b111d..13bd2a30923a 100644 --- a/erpnext/selling/doctype/product_bundle/test_product_bundle.py +++ b/erpnext/selling/doctype/product_bundle/test_product_bundle.py @@ -3,8 +3,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Product Bundle') def make_product_bundle(parent, items, qty=None): diff --git a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py index 8721bfad8668..600bb7c87440 100644 --- a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py +++ b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ProductBundleItem(Document): pass diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index e4f8a4758162..82f9b56a480a 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.model.mapper import get_mapped_doc -from frappe.utils import flt, nowdate, getdate from frappe import _ +from frappe.model.mapper import get_mapped_doc +from frappe.utils import flt, getdate, nowdate from erpnext.controllers.selling_controller import SellingController diff --git a/erpnext/selling/doctype/quotation/quotation_dashboard.py b/erpnext/selling/doctype/quotation/quotation_dashboard.py index d1bb788937be..9586cb10b592 100644 --- a/erpnext/selling/doctype/quotation/quotation_dashboard.py +++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'prevdoc_docname', diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 527a999aefaf..a8513de18744 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import flt, add_days, nowdate, add_months, getdate import unittest +import frappe +from frappe.utils import add_days, add_months, flt, getdate, nowdate + test_dependencies = ["Product Bundle"] @@ -133,8 +134,10 @@ def test_valid_till(self): def test_create_quotation_with_margin(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order - from erpnext.selling.doctype.sales_order.sales_order \ - import make_delivery_note, make_sales_invoice + from erpnext.selling.doctype.sales_order.sales_order import ( + make_delivery_note, + make_sales_invoice, + ) rate_with_margin = flt((1500*18.75)/100 + 1500) diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.py b/erpnext/selling/doctype/quotation_item/quotation_item.py index 7384871ed449..12fee1869d00 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.py +++ b/erpnext/selling/doctype/quotation_item/quotation_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class QuotationItem(Document): pass diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 5d44582aab40..1f505c83c4f5 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -2,24 +2,32 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json + +import frappe import frappe.utils -from frappe.utils import cstr, flt, getdate, cint, nowdate, add_days, get_link_to_form, strip_html from frappe import _ -from six import string_types -from frappe.model.utils import get_fetch_values -from frappe.model.mapper import get_mapped_doc -from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty -from frappe.desk.notifications import clear_doctype_notifications from frappe.contacts.doctype.address.address import get_company_address +from frappe.desk.notifications import clear_doctype_notifications +from frappe.model.mapper import get_mapped_doc +from frappe.model.utils import get_fetch_values +from frappe.utils import add_days, cint, cstr, flt, get_link_to_form, getdate, nowdate, strip_html +from six import string_types + +from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + unlink_inter_company_doc, + update_linked_doc, + validate_inter_company_party, +) from erpnext.controllers.selling_controller import SellingController +from erpnext.manufacturing.doctype.production_plan.production_plan import ( + get_items_for_material_requests, +) from erpnext.selling.doctype.customer.customer import check_credit_limit -from erpnext.stock.doctype.item.item import get_item_defaults from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults -from erpnext.manufacturing.doctype.production_plan.production_plan import get_items_for_material_requests -from erpnext.accounts.doctype.sales_invoice.sales_invoice import validate_inter_company_party, update_linked_doc,\ - unlink_inter_company_doc +from erpnext.stock.doctype.item.item import get_item_defaults +from erpnext.stock.stock_balance import get_reserved_qty, update_bin_qty form_grid_templates = { "items": "templates/form_grid/item_grid.html" diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py index 2a71c27009f8..ee3c707b5b83 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'sales_order', diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index d685fbff82b0..62ea44df4359 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -1,21 +1,29 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import json import unittest + import frappe import frappe.permissions -from frappe.utils import flt, add_days, nowdate, getdate from frappe.core.doctype.user_permission.test_user_permission import create_user -from erpnext.selling.doctype.sales_order.sales_order \ - import make_material_request, make_delivery_note, make_sales_invoice, WarehouseRequired -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.selling.doctype.sales_order.sales_order import make_work_orders +from frappe.utils import add_days, flt, getdate, nowdate + from erpnext.controllers.accounts_controller import update_child_qty_rate -from erpnext.selling.doctype.sales_order.sales_order import make_raw_material_request from erpnext.manufacturing.doctype.blanket_order.test_blanket_order import make_blanket_order from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle +from erpnext.selling.doctype.sales_order.sales_order import ( + WarehouseRequired, + make_delivery_note, + make_material_request, + make_raw_material_request, + make_sales_invoice, + make_work_orders, +) from erpnext.stock.doctype.item.test_item import make_item +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry + class TestSalesOrder(unittest.TestCase): @@ -162,8 +170,8 @@ def test_return_against_sales_order(self): self.assertEqual(so.get("items")[0].delivered_qty, 9) # Make return deliver note, sales invoice and check quantity - from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice + from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note dn1 = create_delivery_note(is_return=1, return_against=dn.name, qty=-3, do_not_submit=True) dn1.items[0].against_sales_order = so.name @@ -444,8 +452,8 @@ def test_update_child(self): self.assertRaises(frappe.ValidationError, update_child_qty_rate,'Sales Order', trans_item, so.name) def test_update_child_with_precision(self): - from frappe.model.meta import get_field_precision from frappe.custom.doctype.property_setter.property_setter import make_property_setter + from frappe.model.meta import get_field_precision precision = get_field_precision(frappe.get_meta("Sales Order Item").get_field("rate")) @@ -731,9 +739,11 @@ def test_auto_insert_price(self): frappe.db.set_value("Stock Settings", None, "auto_insert_price_list_rate_if_missing", 1) def test_drop_shipping(self): - from erpnext.selling.doctype.sales_order.sales_order import make_purchase_order_for_default_supplier, \ - update_status as so_update_status from erpnext.buying.doctype.purchase_order.purchase_order import update_status + from erpnext.selling.doctype.sales_order.sales_order import ( + make_purchase_order_for_default_supplier, + ) + from erpnext.selling.doctype.sales_order.sales_order import update_status as so_update_status # make items po_item = make_item("_Test Item for Drop Shipping", {"is_stock_item": 1, "delivered_by_supplier": 1}) @@ -815,8 +825,10 @@ def test_drop_shipping(self): so.cancel() def test_drop_shipping_partial_order(self): - from erpnext.selling.doctype.sales_order.sales_order import make_purchase_order_for_default_supplier, \ - update_status as so_update_status + from erpnext.selling.doctype.sales_order.sales_order import ( + make_purchase_order_for_default_supplier, + ) + from erpnext.selling.doctype.sales_order.sales_order import update_status as so_update_status # make items po_item1 = make_item("_Test Item for Drop Shipping 1", {"is_stock_item": 1, "delivered_by_supplier": 1}) @@ -869,7 +881,9 @@ def test_drop_shipping_partial_order(self): def test_drop_shipping_full_for_default_suppliers(self): """Test if multiple POs are generated in one go against different default suppliers.""" - from erpnext.selling.doctype.sales_order.sales_order import make_purchase_order_for_default_supplier + from erpnext.selling.doctype.sales_order.sales_order import ( + make_purchase_order_for_default_supplier, + ) if not frappe.db.exists("Item", "_Test Item for Drop Shipping 1"): make_item("_Test Item for Drop Shipping 1", {"is_stock_item": 1, "delivered_by_supplier": 1}) @@ -1043,8 +1057,7 @@ def test_serial_no_based_delivery(self): }] }) so.submit() - from erpnext.manufacturing.doctype.work_order.test_work_order import \ - make_wo_order_test_record + from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record work_order = make_wo_order_test_record(item=item.item_code, qty=1, do_not_save=True) work_order.fg_warehouse = "_Test Warehouse - _TC" @@ -1052,8 +1065,9 @@ def test_serial_no_based_delivery(self): work_order.submit() make_stock_entry(item_code=item.item_code, target="_Test Warehouse - _TC", qty=1) item_serial_no = frappe.get_doc("Serial No", {"item_code": item.item_code}) - from erpnext.manufacturing.doctype.work_order.work_order import \ - make_stock_entry as make_production_stock_entry + from erpnext.manufacturing.doctype.work_order.work_order import ( + make_stock_entry as make_production_stock_entry, + ) se = frappe.get_doc(make_production_stock_entry(work_order.name, "Manufacture", 1)) se.submit() reserved_serial_no = se.get("items")[2].serial_no @@ -1085,8 +1099,9 @@ def test_serial_no_based_delivery(self): si = make_sales_invoice(so.name) si.update_stock = 0 si.submit() - from erpnext.accounts.doctype.sales_invoice.sales_invoice import \ - make_delivery_note as make_delivery_note_from_invoice + from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + make_delivery_note as make_delivery_note_from_invoice, + ) dn = make_delivery_note_from_invoice(si.name) dn.save() dn.submit() @@ -1123,6 +1138,7 @@ def test_advance_payment_entry_unlink_against_sales_order(self): def test_cancel_sales_order_after_cancel_payment_entry(self): from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry + # make a sales order so = make_sales_order() @@ -1232,7 +1248,9 @@ def test_so_cancellation_when_si_drafted(self): self.assertRaises(frappe.ValidationError, so.cancel) def test_payment_terms_are_fetched_when_creating_sales_invoice(self): - from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template + from erpnext.accounts.doctype.payment_entry.test_payment_entry import ( + create_payment_terms_template, + ) from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice automatically_fetch_payment_terms() diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.py b/erpnext/selling/doctype/sales_order_item/sales_order_item.py index 62afef3e1704..772aa6c8ae55 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.py +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.py @@ -2,10 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SalesOrderItem(Document): pass diff --git a/erpnext/selling/doctype/sales_partner_type/sales_partner_type.py b/erpnext/selling/doctype/sales_partner_type/sales_partner_type.py index 68d289f01890..bdabef2fdbeb 100644 --- a/erpnext/selling/doctype/sales_partner_type/sales_partner_type.py +++ b/erpnext/selling/doctype/sales_partner_type/sales_partner_type.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SalesPartnerType(Document): pass diff --git a/erpnext/selling/doctype/sales_partner_type/test_sales_partner_type.py b/erpnext/selling/doctype/sales_partner_type/test_sales_partner_type.py index fb8f8b0417ad..895b0ecf00ae 100644 --- a/erpnext/selling/doctype/sales_partner_type/test_sales_partner_type.py +++ b/erpnext/selling/doctype/sales_partner_type/test_sales_partner_type.py @@ -5,5 +5,6 @@ import unittest + class TestSalesPartnerType(unittest.TestCase): pass diff --git a/erpnext/selling/doctype/sales_team/sales_team.py b/erpnext/selling/doctype/sales_team/sales_team.py index 28bea254d68b..d85fde81fd39 100644 --- a/erpnext/selling/doctype/sales_team/sales_team.py +++ b/erpnext/selling/doctype/sales_team/sales_team.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SalesTeam(Document): pass diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py index b219e7ecce0a..cf1a6a18d3f1 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -4,13 +4,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe import frappe.defaults -from frappe.utils import cint from frappe.custom.doctype.property_setter.property_setter import make_property_setter +from frappe.model.document import Document +from frappe.utils import cint from frappe.utils.nestedset import get_root_of -from frappe.model.document import Document class SellingSettings(Document): def on_update(self): diff --git a/erpnext/selling/doctype/selling_settings/test_selling_settings.py b/erpnext/selling/doctype/selling_settings/test_selling_settings.py index 961a54de0a86..572a110cc3e0 100644 --- a/erpnext/selling/doctype/selling_settings/test_selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/test_selling_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestSellingSettings(unittest.TestCase): pass diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 87846a84d301..45aee4ea6f0b 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -2,14 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe - -from frappe.utils import cstr -from frappe import msgprint, _ +import frappe +from frappe import _, msgprint +from frappe.core.doctype.sms_settings.sms_settings import send_sms from frappe.model.document import Document +from frappe.utils import cstr -from frappe.core.doctype.sms_settings.sms_settings import send_sms class SMSCenter(Document): @frappe.whitelist() diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py index 76eb05e0184d..e564baebcf49 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -2,12 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import json + import frappe -from frappe.utils.nestedset import get_root_of from frappe.utils import cint -from erpnext.accounts.doctype.pos_profile.pos_profile import get_item_groups +from frappe.utils.nestedset import get_root_of + from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_stock_availability +from erpnext.accounts.doctype.pos_profile.pos_profile import get_item_groups + def search_by_term(search_term, warehouse, price_list): result = search_for_serial_or_batch_or_barcode_number(search_term) or {} diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.py b/erpnext/selling/page/sales_funnel/sales_funnel.py index 78aaa49a6681..043a3e7f0fa7 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.py +++ b/erpnext/selling/page/sales_funnel/sales_funnel.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe +import pandas as pd from frappe import _ + from erpnext.accounts.report.utils import convert -import pandas as pd + def validate_filters(from_date, to_date, company): if from_date and to_date and (from_date >= to_date): diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.py b/erpnext/selling/report/address_and_contacts/address_and_contacts.py index f295333322c0..fea19f9f16da 100644 --- a/erpnext/selling/report/address_and_contacts/address_and_contacts.py +++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.py @@ -2,10 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -from six.moves import range -from six import iteritems -import frappe +import frappe +from six import iteritems +from six.moves import range field_map = { "Contact": [ "first_name", "last_name", "phone", "mobile_no", "email_id", "is_primary_contact" ], diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py index 5523bad5715b..c7040bef708b 100644 --- a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py +++ b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe.utils import flt + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py index f15f63d7bb7b..a29b5c8a6274 100644 --- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py +++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import calendar + import frappe from frappe import _ from frappe.utils import cint, cstr, getdate + def execute(filters=None): common_columns = [ { diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py index 6fb7666c2ce0..ed2fbfd595c9 100644 --- a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py +++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt -from erpnext.selling.doctype.customer.customer import get_customer_outstanding, get_credit_limit + +from erpnext.selling.doctype.customer.customer import get_credit_limit, get_customer_outstanding + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.py b/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.py index eb9273a5626c..535d551cfab4 100644 --- a/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.py +++ b/erpnext/selling/report/customer_wise_item_price/customer_wise_item_price.py @@ -4,10 +4,11 @@ from __future__ import unicode_literals import frappe +from frappe import _ + from erpnext import get_default_company from erpnext.accounts.party import get_party_details from erpnext.stock.get_item_details import get_price_list_rate_for -from frappe import _ def execute(filters=None): diff --git a/erpnext/selling/report/inactive_customers/inactive_customers.py b/erpnext/selling/report/inactive_customers/inactive_customers.py index e7aff36e828a..c79efe24b789 100644 --- a/erpnext/selling/report/inactive_customers/inactive_customers.py +++ b/erpnext/selling/report/inactive_customers/inactive_customers.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cint from frappe import _ +from frappe.utils import cint + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py index 1700fc7bdd53..539631240e1d 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.py @@ -2,11 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt from frappe.utils.nestedset import get_descendants_of + def execute(filters=None): filters = frappe._dict(filters or {}) if filters.from_date > filters.to_date: diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.py b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.py index e89c45182fdc..f241a3e13d9a 100644 --- a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.py +++ b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): columns = get_columns() data = get_data() diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py b/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py index f2518f09f8e9..95e332ac537d 100644 --- a/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py +++ b/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py @@ -2,12 +2,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import unittest -from frappe.utils import nowdate, add_months -from erpnext.selling.report.pending_so_items_for_purchase_request.pending_so_items_for_purchase_request\ - import execute + +from frappe.utils import add_months, nowdate + from erpnext.selling.doctype.sales_order.sales_order import make_material_request from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order +from erpnext.selling.report.pending_so_items_for_purchase_request.pending_so_items_for_purchase_request import ( + execute, +) class TestPendingSOItemsForPurchaseRequest(unittest.TestCase): diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.py b/erpnext/selling/report/quotation_trends/quotation_trends.py index 968e2ff26f7b..fdd8c1913d31 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.py +++ b/erpnext/selling/report/quotation_trends/quotation_trends.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.controllers.trends import get_columns, get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py index d036a1cb0956..56bcb3180a32 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.py +++ b/erpnext/selling/report/sales_analytics/sales_analytics.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, scrub -from frappe.utils import getdate, flt, add_to_date, add_days +from frappe.utils import add_days, add_to_date, flt, getdate from six import iteritems + from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): return Analytics(filters).run() @@ -293,7 +296,7 @@ def get_period(self, posting_date): return period def get_period_date_ranges(self): - from dateutil.relativedelta import relativedelta, MO + from dateutil.relativedelta import MO, relativedelta from_date, to_date = getdate(self.filters.from_date), getdate(self.filters.to_date) increment = { diff --git a/erpnext/selling/report/sales_analytics/test_analytics.py b/erpnext/selling/report/sales_analytics/test_analytics.py index 4d81a1e4dda5..6594f8c5ec86 100644 --- a/erpnext/selling/report/sales_analytics/test_analytics.py +++ b/erpnext/selling/report/sales_analytics/test_analytics.py @@ -2,11 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + +import unittest + import frappe import frappe.defaults -import unittest -from erpnext.selling.report.sales_analytics.sales_analytics import execute + from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order +from erpnext.selling.report.sales_analytics.sales_analytics import execute + class TestAnalytics(unittest.TestCase): def test_sales_analytics(self): diff --git a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py index 00dcd69c6e6c..805c3d804fa9 100644 --- a/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py +++ b/erpnext/selling/report/sales_order_analysis/sales_order_analysis.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import copy + +import frappe from frappe import _ -from frappe.utils import flt, date_diff, getdate +from frappe.utils import date_diff, flt, getdate + def execute(filters=None): if not filters: diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py index de7d3f2f7788..7fbac6526574 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.py +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py index 2c49d51a9208..14df1552fde3 100644 --- a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py +++ b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py @@ -2,8 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.utils import flt diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py index 89cfa16abe0c..186207f0c4f5 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py @@ -2,12 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt -from erpnext.accounts.utils import get_fiscal_year + +from erpnext.accounts.doctype.monthly_distribution.monthly_distribution import ( + get_periodwise_distribution_data, +) from erpnext.accounts.report.financial_statements import get_period_list -from erpnext.accounts.doctype.monthly_distribution.monthly_distribution import get_periodwise_distribution_data +from erpnext.accounts.utils import get_fiscal_year + def get_data_column(filters, partner_doctype): data = [] diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py index 87ed5a8ea21d..ab7055a6fc6d 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py @@ -2,8 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import get_data_column + +from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( + get_data_column, +) + def execute(filters=None): data = [] diff --git a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py index f07293d8ec2b..24d8dfa5a96a 100644 --- a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py +++ b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py @@ -2,8 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.utils import flt diff --git a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py index 9917d72af86d..c83805fa9d9d 100644 --- a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py +++ b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py @@ -2,8 +2,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.utils import flt diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py index ea9bbab0c729..b679787fcafe 100644 --- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py @@ -2,8 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import get_data_column + +from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( + get_data_column, +) + def execute(filters=None): data = [] diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index 41c7f7651757..39e7d030d54e 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.utils import flt + from erpnext import get_company_currency + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py index b1d89cc3fb8a..071105d1c1aa 100644 --- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py @@ -2,8 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import get_data_column + +from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( + get_data_column, +) + def execute(filters=None): data = [] diff --git a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py index e8835001707d..c334381b430f 100644 --- a/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py +++ b/erpnext/selling/report/territory_wise_sales/territory_wise_sales.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from erpnext import get_default_currency from frappe import _ +from erpnext import get_default_currency + + def execute(filters=None): filters = frappe._dict(filters) columns = get_columns() diff --git a/erpnext/setup/default_energy_point_rules.py b/erpnext/setup/default_energy_point_rules.py index 8dbccc497b7b..c41d000215b2 100644 --- a/erpnext/setup/default_energy_point_rules.py +++ b/erpnext/setup/default_energy_point_rules.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from frappe import _ doctype_rule_map = { diff --git a/erpnext/setup/default_success_action.py b/erpnext/setup/default_success_action.py index 827839f8b756..be072fc47f38 100644 --- a/erpnext/setup/default_success_action.py +++ b/erpnext/setup/default_success_action.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from frappe import _ doctype_list = [ diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py index fec5c7ca95d0..332d7f438a77 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cstr, flt, has_common, comma_or -from frappe import session, _ +from frappe import _, session +from frappe.utils import comma_or, cstr, flt, has_common + from erpnext.utilities.transaction_base import TransactionBase + class AuthorizationControl(TransactionBase): def get_appr_user_role(self, det, doctype_name, total, based_on, condition, item, company): amt_list, appr_users, appr_roles = [], [], [] diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py index eb8e6ebe78c5..efa696b9b0f8 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.py @@ -2,12 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.utils import cstr, flt +import frappe from frappe import _, msgprint - from frappe.model.document import Document +from frappe.utils import cstr, flt + class AuthorizationRule(Document): def check_duplicate_entry(self): diff --git a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py index 332f10399217..944752d7c259 100644 --- a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Authorization Rule') class TestAuthorizationRule(unittest.TestCase): diff --git a/erpnext/setup/doctype/brand/brand.py b/erpnext/setup/doctype/brand/brand.py index a8d1cf8ff2da..4cfb018c8657 100644 --- a/erpnext/setup/doctype/brand/brand.py +++ b/erpnext/setup/doctype/brand/brand.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import copy +import frappe from frappe.model.document import Document + class Brand(Document): pass diff --git a/erpnext/setup/doctype/brand/test_brand.py b/erpnext/setup/doctype/brand/test_brand.py index 25ed86ef1dd9..16873c9fc923 100644 --- a/erpnext/setup/doctype/brand/test_brand.py +++ b/erpnext/setup/doctype/brand/test_brand.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Brand') diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 45d5ce0c1c7b..394084a96bdd 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -2,23 +2,25 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, os, json -from frappe import _ -from frappe.utils import get_timestamp -from frappe.utils import cint, today, formatdate +import functools +import json +import os + +import frappe import frappe.defaults +from frappe import _ from frappe.cache_manager import clear_defaults_cache - -from frappe.model.document import Document from frappe.contacts.address_and_contact import load_address_and_contact +from frappe.model.document import Document +from frappe.utils import cint, formatdate, get_timestamp, today from frappe.utils.nestedset import NestedSet - from past.builtins import cmp -import functools + from erpnext.accounts.doctype.account.account import get_account_currency from erpnext.setup.setup_wizard.operations.taxes_setup import setup_taxes_and_charges + class Company(NestedSet): nsm_parent_field = 'parent_company' @@ -479,8 +481,9 @@ def update_company_current_month_sales(company): def update_company_monthly_sales(company): '''Cache past year monthly sales of every company based on sales invoices''' - from frappe.utils.goal import get_monthly_results import json + + from frappe.utils.goal import get_monthly_results filter_str = "company = {0} and status != 'Draft' and docstatus=1".format(frappe.db.escape(company)) month_to_value_dict = get_monthly_results("Sales Invoice", "base_grand_total", "posting_date", filter_str, "sum") diff --git a/erpnext/setup/doctype/company/company_dashboard.py b/erpnext/setup/doctype/company/company_dashboard.py index 2d760284e5a6..3afea098a0f7 100644 --- a/erpnext/setup/doctype/company/company_dashboard.py +++ b/erpnext/setup/doctype/company/company_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'graph': True, diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index 1b7fd4fd5c82..abc4689a20e8 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -2,12 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -import unittest import json +import unittest + +import frappe from frappe import _ from frappe.utils import random_string -from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import get_charts_for_country + +from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import ( + get_charts_for_country, +) test_ignore = ["Account", "Cost Center", "Payment Terms Template", "Salary Component", "Warehouse"] test_dependencies = ["Fiscal Year"] diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py index 6480f60f59ca..1dfb401bd798 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py @@ -4,10 +4,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, throw from frappe.model.document import Document -from frappe.utils import get_datetime_str, formatdate, nowdate, cint +from frappe.utils import cint, formatdate, get_datetime_str, nowdate + class CurrencyExchange(Document): def autoname(self): diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py index 4ff2dd7e0e97..1e159c96c59a 100644 --- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py @@ -1,10 +1,13 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, unittest -from frappe.utils import flt + +import unittest + +import frappe +from frappe.utils import cint, flt + from erpnext.setup.utils import get_exchange_rate -from frappe.utils import cint test_records = frappe.get_test_records('Currency Exchange') diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py index c06669b16b40..6e72810c561a 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.py +++ b/erpnext/setup/doctype/customer_group/customer_group.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.utils.nestedset import NestedSet, get_root_of -from frappe.utils.nestedset import NestedSet, get_root_of class CustomerGroup(NestedSet): nsm_parent_field = 'parent_customer_group' def validate(self): diff --git a/erpnext/setup/doctype/customer_group/test_customer_group.py b/erpnext/setup/doctype/customer_group/test_customer_group.py index ec90b376cdce..e04b79b8f394 100644 --- a/erpnext/setup/doctype/customer_group/test_customer_group.py +++ b/erpnext/setup/doctype/customer_group/test_customer_group.py @@ -7,4 +7,5 @@ import frappe + test_records = frappe.get_test_records('Customer Group') diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 217829f12694..4e9a8ccad878 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -2,19 +2,34 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe import _ -from frappe.utils import (fmt_money, formatdate, format_time, now_datetime, - get_url_to_form, get_url_to_list, flt, get_link_to_report, add_to_date, today) + from datetime import timedelta + +import frappe +import frappe.desk.notifications from dateutil.relativedelta import relativedelta +from frappe import _ from frappe.core.doctype.user.user import STANDARD_USERS -import frappe.desk.notifications +from frappe.utils import ( + add_to_date, + flt, + fmt_money, + format_time, + formatdate, + get_link_to_report, + get_url_to_form, + get_url_to_list, + now_datetime, + today, +) + from erpnext.accounts.utils import get_balance_on, get_count_on, get_fiscal_year user_specific_content = ["calendar_events", "todo_list"] from frappe.model.document import Document + + class EmailDigest(Document): def __init__(self, *args, **kwargs): super(EmailDigest, self).__init__(*args, **kwargs) diff --git a/erpnext/setup/doctype/email_digest/quotes.py b/erpnext/setup/doctype/email_digest/quotes.py index 5451ee1daffe..c77fe824ac9d 100644 --- a/erpnext/setup/doctype/email_digest/quotes.py +++ b/erpnext/setup/doctype/email_digest/quotes.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + import random + def get_random_quote(): quotes = [ ("Start by doing what's necessary; then do what's possible; and suddenly you are doing the impossible.", "Francis of Assisi"), diff --git a/erpnext/setup/doctype/email_digest/test_email_digest.py b/erpnext/setup/doctype/email_digest/test_email_digest.py index afe693afd2fc..86335fb017d4 100644 --- a/erpnext/setup/doctype/email_digest/test_email_digest.py +++ b/erpnext/setup/doctype/email_digest/test_email_digest.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Email Digest') class TestEmailDigest(unittest.TestCase): diff --git a/erpnext/setup/doctype/email_digest_recipient/email_digest_recipient.py b/erpnext/setup/doctype/email_digest_recipient/email_digest_recipient.py index 968c51c345b0..5c8d695b6e5a 100644 --- a/erpnext/setup/doctype/email_digest_recipient/email_digest_recipient.py +++ b/erpnext/setup/doctype/email_digest_recipient/email_digest_recipient.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class EmailDigestRecipient(Document): pass diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index a0ba1efb5b4c..66d3b9ee480c 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + """Global Defaults""" import frappe import frappe.defaults -from frappe.utils import cint from frappe.custom.doctype.property_setter.property_setter import make_property_setter +from frappe.utils import cint keydict = { # "key in defaults": "key in Global Defaults" @@ -22,6 +23,7 @@ from frappe.model.document import Document + class GlobalDefaults(Document): def on_update(self): diff --git a/erpnext/setup/doctype/global_defaults/test_global_defaults.py b/erpnext/setup/doctype/global_defaults/test_global_defaults.py index 0495af7b4149..e629e7619244 100644 --- a/erpnext/setup/doctype/global_defaults/test_global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/test_global_defaults.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestGlobalDefaults(unittest.TestCase): pass diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 5fcad00af160..7cc8e988ca1d 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -2,19 +2,23 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import copy + +import frappe from frappe import _ -from frappe.utils import nowdate, cint, cstr +from frappe.utils import cint, cstr, nowdate from frappe.utils.nestedset import NestedSet -from frappe.website.website_generator import WebsiteGenerator -from frappe.website.render import clear_cache from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow -from erpnext.shopping_cart.product_info import set_product_info_for_website -from erpnext.utilities.product import get_qty_in_stock +from frappe.website.render import clear_cache +from frappe.website.website_generator import WebsiteGenerator from six.moves.urllib.parse import quote -from erpnext.shopping_cart.product_query import ProductQuery + from erpnext.shopping_cart.filters import ProductFiltersBuilder +from erpnext.shopping_cart.product_info import set_product_info_for_website +from erpnext.shopping_cart.product_query import ProductQuery +from erpnext.utilities.product import get_qty_in_stock + class ItemGroup(NestedSet, WebsiteGenerator): nsm_parent_field = 'parent_item_group' diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 745b13a5bedb..a816f391c622 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -2,10 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import print_function, unicode_literals + import unittest + import frappe -from frappe.utils.nestedset import NestedSetRecursionError, NestedSetMultipleRootsError, \ - NestedSetChildExistsError, NestedSetInvalidMergeError, rebuild_tree, get_ancestors_of +from frappe.utils.nestedset import ( + NestedSetChildExistsError, + NestedSetInvalidMergeError, + NestedSetMultipleRootsError, + NestedSetRecursionError, + get_ancestors_of, + rebuild_tree, +) test_records = frappe.get_test_records('Item Group') diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index c5d57479612c..005cfec769a1 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -2,15 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe - -from frappe.utils import cstr, cint -from frappe import msgprint, throw, _ +import frappe +from frappe import _, msgprint, throw +from frappe.core.doctype.doctype.doctype import validate_series from frappe.model.document import Document from frappe.model.naming import parse_naming_series from frappe.permissions import get_doctypes_with_read -from frappe.core.doctype.doctype.doctype import validate_series +from frappe.utils import cint, cstr + class NamingSeriesNotSetError(frappe.ValidationError): pass diff --git a/erpnext/setup/doctype/party_type/party_type.py b/erpnext/setup/doctype/party_type/party_type.py index 96e60936a4bd..8424c7fe938b 100644 --- a/erpnext/setup/doctype/party_type/party_type.py +++ b/erpnext/setup/doctype/party_type/party_type.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PartyType(Document): pass diff --git a/erpnext/setup/doctype/party_type/test_party_type.py b/erpnext/setup/doctype/party_type/test_party_type.py index 079fe2fe3b75..7d5fd86ee630 100644 --- a/erpnext/setup/doctype/party_type/test_party_type.py +++ b/erpnext/setup/doctype/party_type/test_party_type.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Party Type') class TestPartyType(unittest.TestCase): diff --git a/erpnext/setup/doctype/print_heading/print_heading.py b/erpnext/setup/doctype/print_heading/print_heading.py index 3d5cd2d6f9e7..4b5d63167b72 100644 --- a/erpnext/setup/doctype/print_heading/print_heading.py +++ b/erpnext/setup/doctype/print_heading/print_heading.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PrintHeading(Document): pass diff --git a/erpnext/setup/doctype/print_heading/test_print_heading.py b/erpnext/setup/doctype/print_heading/test_print_heading.py index b2be2e375e44..06f801a654e0 100644 --- a/erpnext/setup/doctype/print_heading/test_print_heading.py +++ b/erpnext/setup/doctype/print_heading/test_print_heading.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Print Heading') diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py index 42c5a5a54fb2..08a67db889e0 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py +++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class QuotationLostReason(Document): pass diff --git a/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py index f6b30b649b50..ab8d61f1ebee 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py +++ b/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Quotation Lost Reason') diff --git a/erpnext/setup/doctype/quotation_lost_reason_detail/quotation_lost_reason_detail.py b/erpnext/setup/doctype/quotation_lost_reason_detail/quotation_lost_reason_detail.py index 7bb8d02670ea..434f24ea9259 100644 --- a/erpnext/setup/doctype/quotation_lost_reason_detail/quotation_lost_reason_detail.py +++ b/erpnext/setup/doctype/quotation_lost_reason_detail/quotation_lost_reason_detail.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QuotationLostReasonDetail(Document): pass diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py index 675f9ca560ba..6c741a8fb442 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/sales_partner.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe.contacts.address_and_contact import load_address_and_contact from frappe.utils import cstr, filter_strip_join from frappe.website.website_generator import WebsiteGenerator -from frappe.contacts.address_and_contact import load_address_and_contact + class SalesPartner(WebsiteGenerator): website = frappe._dict( diff --git a/erpnext/setup/doctype/sales_partner/test_sales_partner.py b/erpnext/setup/doctype/sales_partner/test_sales_partner.py index 4548a4e19b5a..6ece23904050 100644 --- a/erpnext/setup/doctype/sales_partner/test_sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/test_sales_partner.py @@ -2,8 +2,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Sales Partner') test_ignore = ["Item Group"] diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index 19c2e5b95435..c7cad6bb9989 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt from frappe.utils.nestedset import NestedSet, get_root_of + from erpnext import get_default_currency + class SalesPerson(NestedSet): nsm_parent_field = 'parent_sales_person' diff --git a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py index 662008ec8db7..61c1ba46d350 100644 --- a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py +++ b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/setup/doctype/sales_person/test_sales_person.py b/erpnext/setup/doctype/sales_person/test_sales_person.py index 8313cb450846..497aaad74f80 100644 --- a/erpnext/setup/doctype/sales_person/test_sales_person.py +++ b/erpnext/setup/doctype/sales_person/test_sales_person.py @@ -5,6 +5,7 @@ test_dependencies = ["Employee"] import frappe + test_records = frappe.get_test_records('Sales Person') test_ignore = ["Item Group"] diff --git a/erpnext/setup/doctype/supplier_group/supplier_group.py b/erpnext/setup/doctype/supplier_group/supplier_group.py index 9d84f9097b50..0ca352579261 100644 --- a/erpnext/setup/doctype/supplier_group/supplier_group.py +++ b/erpnext/setup/doctype/supplier_group/supplier_group.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.utils.nestedset import NestedSet, get_root_of + class SupplierGroup(NestedSet): nsm_parent_field = 'parent_supplier_group' diff --git a/erpnext/setup/doctype/supplier_group/test_supplier_group.py b/erpnext/setup/doctype/supplier_group/test_supplier_group.py index 0e3d23d6bd3f..b3a636635ec0 100644 --- a/erpnext/setup/doctype/supplier_group/test_supplier_group.py +++ b/erpnext/setup/doctype/supplier_group/test_supplier_group.py @@ -4,4 +4,5 @@ from __future__ import unicode_literals import frappe + test_records = frappe.get_test_records('Supplier Group') diff --git a/erpnext/setup/doctype/target_detail/target_detail.py b/erpnext/setup/doctype/target_detail/target_detail.py index 633be45d20b5..431f8e3257ef 100644 --- a/erpnext/setup/doctype/target_detail/target_detail.py +++ b/erpnext/setup/doctype/target_detail/target_detail.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class TargetDetail(Document): pass diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py index 5b00ccbdbb3b..8c9059f61efe 100644 --- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py +++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py @@ -2,15 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import json + import frappe from frappe import _, throw -import json from frappe.model.document import Document -from frappe.utils.jinja import validate_template from frappe.utils import cint - +from frappe.utils.jinja import validate_template from six import string_types + class TermsandConditions(Document): def validate(self): if self.terms: diff --git a/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py index 6fea78f46aee..abfa9214d64a 100644 --- a/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py +++ b/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Terms and Conditions') diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index 7eefe77495c8..f61796b9bdfa 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -2,12 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt from frappe import _ - +from frappe.utils import flt from frappe.utils.nestedset import NestedSet, get_root_of + class Territory(NestedSet): nsm_parent_field = 'parent_territory' diff --git a/erpnext/setup/doctype/territory/test_territory.py b/erpnext/setup/doctype/territory/test_territory.py index efe00c5a30b1..a3aa866fff3c 100644 --- a/erpnext/setup/doctype/territory/test_territory.py +++ b/erpnext/setup/doctype/territory/test_territory.py @@ -2,8 +2,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('Territory') test_ignore = ["Item Group"] diff --git a/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py index 933a8c3bed85..aa0f79b4c86e 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestTransactionDeletionRecord(unittest.TestCase): def setUp(self): create_company('Dunder Mifflin Paper Co') diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py index 8a491554801e..efb038faccc3 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py @@ -3,11 +3,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -from frappe.utils import cint + import frappe -from frappe.model.document import Document from frappe import _ from frappe.desk.notifications import clear_notifications +from frappe.model.document import Document +from frappe.utils import cint + class TransactionDeletionRecord(Document): def validate(self): diff --git a/erpnext/setup/doctype/transaction_deletion_record_item/transaction_deletion_record_item.py b/erpnext/setup/doctype/transaction_deletion_record_item/transaction_deletion_record_item.py index 2176cb10deb0..a113d5045382 100644 --- a/erpnext/setup/doctype/transaction_deletion_record_item/transaction_deletion_record_item.py +++ b/erpnext/setup/doctype/transaction_deletion_record_item/transaction_deletion_record_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class TransactionDeletionRecordItem(Document): pass diff --git a/erpnext/setup/doctype/uom/test_uom.py b/erpnext/setup/doctype/uom/test_uom.py index 330d30358d92..e222c1349425 100644 --- a/erpnext/setup/doctype/uom/test_uom.py +++ b/erpnext/setup/doctype/uom/test_uom.py @@ -2,6 +2,6 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + test_records = frappe.get_test_records('UOM') diff --git a/erpnext/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py index 404b84b11342..339e3b924bcb 100644 --- a/erpnext/setup/doctype/uom/uom.py +++ b/erpnext/setup/doctype/uom/uom.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class UOM(Document): pass diff --git a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py index 04596efbca6c..33795d6b5b22 100644 --- a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py +++ b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py @@ -5,5 +5,6 @@ import unittest + class TestUOMConversionFactor(unittest.TestCase): pass diff --git a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py index 3566c537c6cd..45342e9fee90 100644 --- a/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py +++ b/erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class UOMConversionFactor(Document): pass diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.py b/erpnext/setup/doctype/website_item_group/website_item_group.py index e416b509b98f..bcd700d9e974 100644 --- a/erpnext/setup/doctype/website_item_group/website_item_group.py +++ b/erpnext/setup/doctype/website_item_group/website_item_group.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class WebsiteItemGroup(Document): pass diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index bbee74cafb46..cdc83c146204 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -4,16 +4,18 @@ from __future__ import print_function, unicode_literals import frappe -from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS -from .default_success_action import get_default_success_action from frappe import _ -from frappe.utils import cint -from frappe.installer import update_site_config -from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to from frappe.custom.doctype.custom_field.custom_field import create_custom_field -from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules +from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to +from frappe.installer import update_site_config +from frappe.utils import cint from six import iteritems +from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS +from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules + +from .default_success_action import get_default_success_action + default_mail_footer = """
Sent via ERPNext
""" diff --git a/erpnext/setup/setup_wizard/data/dashboard_charts.py b/erpnext/setup/setup_wizard/data/dashboard_charts.py index 9ce64eb9d921..7cf21b3bf0e5 100644 --- a/erpnext/setup/setup_wizard/data/dashboard_charts.py +++ b/erpnext/setup/setup_wizard/data/dashboard_charts.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals -from frappe import _ -import frappe + import json +import frappe +from frappe import _ + + def get_company_for_dashboards(): company = frappe.defaults.get_defaults().company if company: diff --git a/erpnext/setup/setup_wizard/data/industry_type.py b/erpnext/setup/setup_wizard/data/industry_type.py index 4fa9f8abb168..2c83a5c721cc 100644 --- a/erpnext/setup/setup_wizard/data/industry_type.py +++ b/erpnext/setup/setup_wizard/data/industry_type.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_industry_types(): return [ _('Accounting'), diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py index 4833d93c4a78..17e42623bb2b 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -2,12 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cstr, getdate -from .default_website import website_maker + from erpnext.accounts.doctype.account.account import RootNotEditable +from .default_website import website_maker + + def create_fiscal_year_and_company(args): if (args.get('fy_start_date')): curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date')) diff --git a/erpnext/setup/setup_wizard/operations/default_website.py b/erpnext/setup/setup_wizard/operations/default_website.py index 38b5c1470e70..2288ae06746e 100644 --- a/erpnext/setup/setup_wizard/operations/default_website.py +++ b/erpnext/setup/setup_wizard/operations/default_website.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe import _ from frappe.utils import nowdate + class website_maker(object): def __init__(self, args): self.args = args diff --git a/erpnext/setup/setup_wizard/operations/defaults_setup.py b/erpnext/setup/setup_wizard/operations/defaults_setup.py index 6dd0fb1403ff..3f90f72b608b 100644 --- a/erpnext/setup/setup_wizard/operations/defaults_setup.py +++ b/erpnext/setup/setup_wizard/operations/defaults_setup.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import cstr, getdate + def set_default_settings(args): # enable default currency frappe.db.set_value("Currency", args.get("currency"), "enabled", 1) diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 3dcb63867c1a..a0d2fcc7ff4f 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -3,16 +3,20 @@ from __future__ import unicode_literals -import frappe, os, json +import json +import os +import frappe from frappe import _ +from frappe.desk.doctype.global_search_settings.global_search_settings import ( + update_global_search_doctypes, +) from frappe.desk.page.setup_wizard.setup_wizard import make_records from frappe.utils import cstr, getdate -from frappe.desk.doctype.global_search_settings.global_search_settings import update_global_search_doctypes +from frappe.utils.nestedset import rebuild_tree from erpnext.accounts.doctype.account.account import RootNotEditable from erpnext.regional.address_template.setup import set_up_address_templates -from frappe.utils.nestedset import rebuild_tree default_lead_sources = ["Existing Customer", "Reference", "Advertisement", "Cold Calling", "Exhibition", "Supplier Reference", "Mass Mailing", diff --git a/erpnext/setup/setup_wizard/operations/sample_data.py b/erpnext/setup/setup_wizard/operations/sample_data.py index c6d9f0851b12..3aef40d3ebb0 100644 --- a/erpnext/setup/setup_wizard/operations/sample_data.py +++ b/erpnext/setup/setup_wizard/operations/sample_data.py @@ -3,11 +3,15 @@ from __future__ import unicode_literals +import json +import os +import random + import frappe -from frappe.utils.make_random import add_random_children import frappe.utils -import random, os, json from frappe import _ +from frappe.utils.make_random import add_random_children + def make_sample_data(domains, make_dependent = False): """Create a few opportunities, quotes, material requests, issues, todos, projects diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py index 09b917096429..90384a7da0b6 100644 --- a/erpnext/setup/setup_wizard/operations/taxes_setup.py +++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals -import os import json +import os import frappe from frappe import _ diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 9275d1b383da..ecb07d53b7c1 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -6,7 +6,10 @@ import frappe from frappe import _ -from .operations import install_fixtures as fixtures, company_setup, sample_data +from .operations import company_setup +from .operations import install_fixtures as fixtures +from .operations import sample_data + def get_setup_stages(args=None): if frappe.db.sql("select name from tabCompany"): diff --git a/erpnext/setup/setup_wizard/utils.py b/erpnext/setup/setup_wizard/utils.py index 4223f000a6b6..1c5de7559b97 100644 --- a/erpnext/setup/setup_wizard/utils.py +++ b/erpnext/setup/setup_wizard/utils.py @@ -1,9 +1,13 @@ from __future__ import unicode_literals -import json, os + +import json +import os from frappe.desk.page.setup_wizard.setup_wizard import setup_complete + from erpnext.setup.setup_wizard import setup_wizard + def complete(): with open(os.path.join(os.path.dirname(__file__), 'data', 'test_mfg.json'), 'r') as f: diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 8d835228424c..c7746a64eb44 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -2,12 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, add_days -from frappe.utils import get_datetime_str, nowdate +from frappe.utils import add_days, flt, get_datetime_str, nowdate + from erpnext import get_default_company + def get_root_of(doctype): """Get root element of a DocType with a tree structure""" result = frappe.db.sql_list("""select name from `tab%s` diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index e9f4bd57a6ae..3f1dfde01606 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -2,16 +2,20 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import throw, _ import frappe.defaults -from frappe.utils import cint, flt, get_fullname, cstr +from frappe import _, throw from frappe.contacts.doctype.address.address import get_address_display -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings +from frappe.contacts.doctype.contact.contact import get_contact_name +from frappe.utils import cint, cstr, flt, get_fullname from frappe.utils.nestedset import get_root_of + from erpnext.accounts.utils import get_account_name +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + get_shopping_cart_settings, +) from erpnext.utilities.product import get_qty_in_stock -from frappe.contacts.doctype.contact.contact import get_contact_name class WebsitePriceListMissingError(frappe.ValidationError): diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py index efed1968a147..2967a39fc609 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -4,11 +4,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _, msgprint -from frappe.utils import flt from frappe.model.document import Document -from frappe.utils import get_datetime, get_datetime_str, now_datetime +from frappe.utils import flt, get_datetime, get_datetime_str, now_datetime + class ShoppingCartSetupError(frappe.ValidationError): pass diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py index 9965e1af672f..f8a22b0e020a 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py @@ -4,9 +4,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import unittest -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError + +import frappe + +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + ShoppingCartSetupError, +) + class TestShoppingCartSettings(unittest.TestCase): def setUp(self): diff --git a/erpnext/shopping_cart/filters.py b/erpnext/shopping_cart/filters.py index 7dfa09e2d620..aaeff0fe0732 100644 --- a/erpnext/shopping_cart/filters.py +++ b/erpnext/shopping_cart/filters.py @@ -2,9 +2,11 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _dict + class ProductFiltersBuilder: def __init__(self, item_group=None): if not item_group or item_group == "Products Settings": diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py index 6c9e531a4d1a..fa6863696a8f 100644 --- a/erpnext/shopping_cart/product_info.py +++ b/erpnext/shopping_cart/product_info.py @@ -4,10 +4,14 @@ from __future__ import unicode_literals import frappe + from erpnext.shopping_cart.cart import _get_cart_quotation, _set_price_list -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings \ - import get_shopping_cart_settings, show_quantity_in_website -from erpnext.utilities.product import get_price, get_qty_in_stock, get_non_stock_item_status +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + get_shopping_cart_settings, + show_quantity_in_website, +) +from erpnext.utilities.product import get_non_stock_item_status, get_price, get_qty_in_stock + @frappe.whitelist(allow_guest=True) def get_product_info_for_website(item_code, skip_quotation_creation=False): diff --git a/erpnext/shopping_cart/product_query.py b/erpnext/shopping_cart/product_query.py index 6c92d967d0c3..5cc0505aed22 100644 --- a/erpnext/shopping_cart/product_query.py +++ b/erpnext/shopping_cart/product_query.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt import frappe + from erpnext.shopping_cart.product_info import get_product_info_for_website + class ProductQuery: """Query engine for product listing diff --git a/erpnext/shopping_cart/search.py b/erpnext/shopping_cart/search.py index 9f674dcebf87..5d2de78f7caa 100644 --- a/erpnext/shopping_cart/search.py +++ b/erpnext/shopping_cart/search.py @@ -1,9 +1,9 @@ import frappe from frappe.search.full_text_search import FullTextSearch -from whoosh.fields import TEXT, ID, KEYWORD, Schema from frappe.utils import strip_html_tags -from whoosh.qparser import MultifieldParser, FieldsPlugin, WildcardPlugin from whoosh.analysis import StemmingAnalyzer +from whoosh.fields import ID, KEYWORD, TEXT, Schema +from whoosh.qparser import FieldsPlugin, MultifieldParser, WildcardPlugin from whoosh.query import Prefix INDEX_NAME = "products" diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py index ac61aebc5640..d1284cdf008d 100644 --- a/erpnext/shopping_cart/test_shopping_cart.py +++ b/erpnext/shopping_cart/test_shopping_cart.py @@ -2,12 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import nowdate, add_months -from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_party +from frappe.utils import add_months, nowdate + +from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule +from erpnext.shopping_cart.cart import _get_cart_quotation, get_party, update_cart from erpnext.tests.utils import create_test_contact_and_address -from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule # test_dependencies = ['Payment Terms Template'] diff --git a/erpnext/shopping_cart/utils.py b/erpnext/shopping_cart/utils.py index 0e1466fd1faa..6a9f2dad9030 100644 --- a/erpnext/shopping_cart/utils.py +++ b/erpnext/shopping_cart/utils.py @@ -5,7 +5,11 @@ import frappe import frappe.defaults -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_cart_enabled + +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + is_cart_enabled, +) + def show_cart_count(): if (is_cart_enabled() and diff --git a/erpnext/startup/__init__.py b/erpnext/startup/__init__.py index deef4ba4d68f..3aa52979134a 100644 --- a/erpnext/startup/__init__.py +++ b/erpnext/startup/__init__.py @@ -19,7 +19,6 @@ # default settings that can be made for a user. from __future__ import unicode_literals - product_name = "ERPNext" user_defaults = { "Company": "company", diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 2b80fb8dfa12..bb76f5a6f976 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -3,9 +3,11 @@ from __future__ import unicode_literals + import frappe from frappe.utils import cint + def boot_session(bootinfo): """boot session - send website info if guest""" diff --git a/erpnext/startup/filters.py b/erpnext/startup/filters.py index 98210165dfa4..73c60c35ae90 100644 --- a/erpnext/startup/filters.py +++ b/erpnext/startup/filters.py @@ -1,6 +1,7 @@ import frappe + def get_filters_config(): filters_config = { "fiscal year": { diff --git a/erpnext/startup/leaderboard.py b/erpnext/startup/leaderboard.py index a89435d48663..60e67f8f580d 100644 --- a/erpnext/startup/leaderboard.py +++ b/erpnext/startup/leaderboard.py @@ -1,8 +1,10 @@ -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + import frappe from frappe.utils import cint + def get_leaderboards(): leaderboards = { "Customer": { diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py index 8e880dc42e08..01bb344d15bc 100644 --- a/erpnext/startup/notifications.py +++ b/erpnext/startup/notifications.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe + def get_notification_config(): notifications = { "for_doctype": { diff --git a/erpnext/stock/__init__.py b/erpnext/stock/__init__.py index 283f7d5fdafe..575aa0fa5d0c 100644 --- a/erpnext/stock/__init__.py +++ b/erpnext/stock/__init__.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe from frappe import _ diff --git a/erpnext/stock/dashboard/item_dashboard.py b/erpnext/stock/dashboard/item_dashboard.py index 45e662807a02..df6b632d2511 100644 --- a/erpnext/stock/dashboard/item_dashboard.py +++ b/erpnext/stock/dashboard/item_dashboard.py @@ -2,7 +2,8 @@ import frappe from frappe.model.db_query import DatabaseQuery -from frappe.utils import flt, cint +from frappe.utils import cint, flt + @frappe.whitelist() def get_data(item_code=None, warehouse=None, item_group=None, diff --git a/erpnext/stock/dashboard/warehouse_capacity_dashboard.py b/erpnext/stock/dashboard/warehouse_capacity_dashboard.py index 70b030e48f21..5d8b703aa5e3 100644 --- a/erpnext/stock/dashboard/warehouse_capacity_dashboard.py +++ b/erpnext/stock/dashboard/warehouse_capacity_dashboard.py @@ -2,10 +2,11 @@ import frappe from frappe.model.db_query import DatabaseQuery -from frappe.utils import nowdate -from frappe.utils import flt +from frappe.utils import flt, nowdate + from erpnext.stock.utils import get_stock_balance + @frappe.whitelist() def get_data(item_code=None, warehouse=None, parent_warehouse=None, company=None, start=0, sort_by="stock_capacity", sort_order="desc"): diff --git a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py index 2258532c6feb..36eff965682c 100644 --- a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py +++ b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py @@ -2,11 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe from frappe import _ from frappe.utils.dashboard import cache_source + from erpnext.stock.utils import get_stock_value_from_bin + @frappe.whitelist() @cache_source def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None, diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index b37ae3f4f617..23022096c415 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -2,15 +2,16 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -from six import text_type + import frappe from frappe import _ from frappe.model.document import Document from frappe.model.naming import make_autoname, revert_series_if_last -from frappe.utils import flt, cint, get_link_to_form -from frappe.utils.jinja import render_template +from frappe.utils import cint, flt, get_link_to_form from frappe.utils.data import add_days -from six import string_types +from frappe.utils.jinja import render_template +from six import string_types, text_type + class UnableToSelectBatchError(frappe.ValidationError): pass diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py index a85a0222b55a..79989307efce 100644 --- a/erpnext/stock/doctype/batch/test_batch.py +++ b/erpnext/stock/doctype/batch/test_batch.py @@ -2,15 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -from frappe.exceptions import ValidationError import unittest -from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelectBatchError, get_batch_no +import frappe +from frappe.exceptions import ValidationError from frappe.utils import cint, flt + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice +from erpnext.stock.doctype.batch.batch import UnableToSelectBatchError, get_batch_no, get_batch_qty from erpnext.stock.get_item_details import get_item_details + class TestBatch(unittest.TestCase): def test_item_has_batch_enabled(self): self.assertRaises(ValidationError, frappe.get_doc({ diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 43642013ce65..8dbec18d9eb0 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import flt, nowdate import frappe.defaults from frappe.model.document import Document +from frappe.utils import flt, nowdate + class Bin(Document): def before_save(self): diff --git a/erpnext/stock/doctype/bin/test_bin.py b/erpnext/stock/doctype/bin/test_bin.py index fb32ce214072..3bc34115df36 100644 --- a/erpnext/stock/doctype/bin/test_bin.py +++ b/erpnext/stock/doctype/bin/test_bin.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Bin') class TestBin(unittest.TestCase): diff --git a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py index b0b3e6afbf94..d883ba6a438b 100644 --- a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class CustomsTariffNumber(Document): pass diff --git a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py index d7e03067e8e6..2b11afed79c9 100644 --- a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestCustomsTariffNumber(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 9113b59ce071..7b0b73456fd4 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -5,16 +5,17 @@ import frappe import frappe.defaults -from erpnext.controllers.selling_controller import SellingController -from erpnext.stock.doctype.batch.batch import set_batch_nos -from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no from frappe import _ from frappe.contacts.doctype.address.address import get_company_address from frappe.desk.notifications import clear_doctype_notifications from frappe.model.mapper import get_mapped_doc from frappe.model.utils import get_fetch_values from frappe.utils import cint, flt + from erpnext.controllers.accounts_controller import get_taxes_and_charges +from erpnext.controllers.selling_controller import SellingController +from erpnext.stock.doctype.batch.batch import set_batch_nos +from erpnext.stock.doctype.serial_no.serial_no import get_delivery_note_serial_no form_grid_templates = { "items": "templates/form_grid/item_grid.html" @@ -668,8 +669,13 @@ def make_inter_company_purchase_receipt(source_name, target_doc=None): return make_inter_company_transaction("Delivery Note", source_name, target_doc) def make_inter_company_transaction(doctype, source_name, target_doc=None): - from erpnext.accounts.doctype.sales_invoice.sales_invoice import (validate_inter_company_transaction, - get_inter_company_details, update_address, update_taxes, set_purchase_references) + from erpnext.accounts.doctype.sales_invoice.sales_invoice import ( + get_inter_company_details, + set_purchase_references, + update_address, + update_taxes, + validate_inter_company_transaction, + ) if doctype == 'Delivery Note': source_doc = frappe.get_doc(doctype, source_name) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py index 9db5db865f59..31fc708eabd5 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'delivery_note', diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index b333a6b57ea8..b2d93f2fda4b 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -3,26 +3,41 @@ from __future__ import unicode_literals + +import json import unittest + import frappe -import json import frappe.defaults -from frappe.utils import nowdate, nowtime, cstr, flt -from erpnext.stock.stock_ledger import get_previous_sle +from frappe.utils import cstr, flt, nowdate, nowtime + +from erpnext.accounts.doctype.account.test_account import get_inventory_account from erpnext.accounts.utils import get_balance_on +from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle +from erpnext.selling.doctype.sales_order.test_sales_order import ( + automatically_fetch_payment_terms, + compare_payment_schedules, + create_dn_against_so, + make_sales_order, +) +from erpnext.stock.doctype.delivery_note.delivery_note import ( + make_delivery_trip, + make_sales_invoice, +) +from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries -from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice, make_delivery_trip -from erpnext.stock.doctype.stock_entry.test_stock_entry \ - import make_stock_entry, make_serialized_item, get_qty_after_transaction -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos, SerialNoWarehouseError -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation \ - import create_stock_reconciliation, set_valuation_method -from erpnext.selling.doctype.sales_order.test_sales_order \ - import make_sales_order, create_dn_against_so, automatically_fetch_payment_terms, compare_payment_schedules -from erpnext.accounts.doctype.account.test_account import get_inventory_account +from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError, get_serial_nos +from erpnext.stock.doctype.stock_entry.test_stock_entry import ( + get_qty_after_transaction, + make_serialized_item, + make_stock_entry, +) +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, + set_valuation_method, +) from erpnext.stock.doctype.warehouse.test_warehouse import get_warehouse -from erpnext.stock.doctype.item.test_item import make_item -from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle +from erpnext.stock.stock_ledger import get_previous_sle class TestDeliveryNote(unittest.TestCase): @@ -540,7 +555,10 @@ def test_dn_billing_status_case1(self): def test_dn_billing_status_case2(self): # SO -> SI and SO -> DN1, DN2 - from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice + from erpnext.selling.doctype.sales_order.sales_order import ( + make_delivery_note, + make_sales_invoice, + ) so = make_sales_order() @@ -579,8 +597,10 @@ def test_dn_billing_status_case2(self): def test_dn_billing_status_case3(self): # SO -> DN1 -> SI and SO -> SI and SO -> DN2 - from erpnext.selling.doctype.sales_order.sales_order \ - import make_delivery_note, make_sales_invoice as make_sales_invoice_from_so + from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note + from erpnext.selling.doctype.sales_order.sales_order import ( + make_sales_invoice as make_sales_invoice_from_so, + ) frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) so = make_sales_order() @@ -626,8 +646,8 @@ def test_dn_billing_status_case3(self): def test_dn_billing_status_case4(self): # SO -> SI -> DN - from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note + from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice so = make_sales_order() @@ -777,7 +797,9 @@ def test_delivery_note_bundle_with_batched_item(self): self.assertTrue("TESTBATCH" in dn.packed_items[0].batch_no, "Batch number not added in packed item") def test_payment_terms_are_fetched_when_creating_sales_invoice(self): - from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template + from erpnext.accounts.doctype.payment_entry.test_payment_entry import ( + create_payment_terms_template, + ) from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice automatically_fetch_payment_terms() diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py index 8bd381a2ed30..623b8fc1a149 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class DeliveryNoteItem(Document): pass diff --git a/erpnext/stock/doctype/delivery_settings/delivery_settings.py b/erpnext/stock/doctype/delivery_settings/delivery_settings.py index 909efda856f4..27f578de3c0a 100644 --- a/erpnext/stock/doctype/delivery_settings/delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/delivery_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class DeliverySettings(Document): pass diff --git a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py index 4395d2662873..022bf5c2d319 100644 --- a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestDeliverySettings(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/delivery_stop/delivery_stop.py b/erpnext/stock/doctype/delivery_stop/delivery_stop.py index 768d1619f65a..f94ccb802152 100644 --- a/erpnext/stock/doctype/delivery_stop/delivery_stop.py +++ b/erpnext/stock/doctype/delivery_stop/delivery_stop.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class DeliveryStop(Document): pass diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip.py b/erpnext/stock/doctype/delivery_trip/delivery_trip.py index f76bb87efede..fe9818242fe6 100644 --- a/erpnext/stock/doctype/delivery_trip/delivery_trip.py +++ b/erpnext/stock/doctype/delivery_trip/delivery_trip.py @@ -10,8 +10,8 @@ from frappe import _ from frappe.contacts.doctype.address.address import get_address_display from frappe.model.document import Document -from frappe.utils import cint, get_datetime, get_link_to_form from frappe.model.mapper import get_mapped_doc +from frappe.utils import cint, get_datetime, get_link_to_form class DeliveryTrip(Document): diff --git a/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py b/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py index 1e716031751c..c9081c908f77 100644 --- a/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py +++ b/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py @@ -5,12 +5,17 @@ import unittest -import erpnext import frappe -from erpnext.stock.doctype.delivery_trip.delivery_trip import get_contact_and_address, notify_customers, make_expense_claim -from erpnext.tests.utils import create_test_contact_and_address from frappe.utils import add_days, flt, now_datetime, nowdate +import erpnext +from erpnext.stock.doctype.delivery_trip.delivery_trip import ( + get_contact_and_address, + make_expense_claim, + notify_customers, +) +from erpnext.tests.utils import create_test_contact_and_address + class TestDeliveryTrip(unittest.TestCase): def setUp(self): diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ca587bfe82cb..987f5597e274 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -1,24 +1,42 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt +import copy import itertools import json -import erpnext + import frappe -import copy -from erpnext.controllers.item_variant import (ItemVariantExistsError, - copy_attributes_to_variant, get_variant, make_variant_item_code, validate_item_variant_attributes) -from erpnext.setup.doctype.item_group.item_group import (get_parent_item_groups, invalidate_cache_for) from frappe import _, msgprint -from frappe.utils import (cint, cstr, flt, formatdate, getdate, - now_datetime, random_string, strip, get_link_to_form, nowtime) +from frappe.utils import ( + cint, + cstr, + flt, + formatdate, + get_link_to_form, + getdate, + now_datetime, + nowtime, + random_string, + strip, +) from frappe.utils.html_utils import clean_html -from frappe.website.doctype.website_slideshow.website_slideshow import \ - get_slideshow - +from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow from frappe.website.render import clear_cache from frappe.website.website_generator import WebsiteGenerator +import erpnext +from erpnext.controllers.item_variant import ( + ItemVariantExistsError, + copy_attributes_to_variant, + get_variant, + make_variant_item_code, + validate_item_variant_attributes, +) +from erpnext.setup.doctype.item_group.item_group import ( + get_parent_item_groups, + invalidate_cache_for, +) + class DuplicateReorderRows(frappe.ValidationError): pass diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py index b3e4796354b9..e80ed6fcda9d 100644 --- a/erpnext/stock/doctype/item/item_dashboard.py +++ b/erpnext/stock/doctype/item/item_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'heatmap': True, diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 7a9985d7f071..0ed27610200e 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -2,21 +2,31 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import unittest -import frappe + import json +import unittest +import frappe from frappe.test_runner import make_test_objects -from erpnext.controllers.item_variant import (create_variant, ItemVariantExistsError, - InvalidItemAttributeValueError, get_variant) -from erpnext.stock.doctype.item.item import StockExistsForTemplate, InvalidBarcode -from erpnext.stock.doctype.item.item import (get_uom_conv_factor, get_item_attribute, - validate_is_stock_item, get_timeline_data) + +from erpnext.controllers.item_variant import ( + InvalidItemAttributeValueError, + ItemVariantExistsError, + create_variant, + get_variant, +) +from erpnext.stock.doctype.item.item import ( + InvalidBarcode, + StockExistsForTemplate, + get_item_attribute, + get_timeline_data, + get_uom_conv_factor, + validate_is_stock_item, +) from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.get_item_details import get_item_details from erpnext.tests.utils import change_settings - test_ignore = ["BOM"] test_dependencies = ["Warehouse", "Item Group", "Item Tax Template", "Brand", "Item Attribute"] diff --git a/erpnext/stock/doctype/item_alternative/item_alternative.py b/erpnext/stock/doctype/item_alternative/item_alternative.py index 190cb62e997a..6080fb4a5fa6 100644 --- a/erpnext/stock/doctype/item_alternative/item_alternative.py +++ b/erpnext/stock/doctype/item_alternative/item_alternative.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class ItemAlternative(Document): def validate(self): self.has_alternative_item() diff --git a/erpnext/stock/doctype/item_alternative/test_item_alternative.py b/erpnext/stock/doctype/item_alternative/test_item_alternative.py index 8f76844bde05..2be8ef740a47 100644 --- a/erpnext/stock/doctype/item_alternative/test_item_alternative.py +++ b/erpnext/stock/doctype/item_alternative/test_item_alternative.py @@ -2,16 +2,26 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe, json + +import json +import unittest + +import frappe from frappe.utils import flt -from erpnext.stock.doctype.item.test_item import create_item -from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom + +from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_purchase_receipt, + make_rm_stock_entry, +) from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order -from erpnext.manufacturing.doctype.work_order.work_order import make_stock_entry -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation +from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record -from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt, make_rm_stock_entry -import unittest +from erpnext.manufacturing.doctype.work_order.work_order import make_stock_entry +from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, +) + class TestItemAlternative(unittest.TestCase): def setUp(self): diff --git a/erpnext/stock/doctype/item_attribute/item_attribute.py b/erpnext/stock/doctype/item_attribute/item_attribute.py index 3764738e8382..9894788b8c2e 100644 --- a/erpnext/stock/doctype/item_attribute/item_attribute.py +++ b/erpnext/stock/doctype/item_attribute/item_attribute.py @@ -2,13 +2,17 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import flt -from erpnext.controllers.item_variant import (validate_is_incremental, - validate_item_attribute_value, InvalidItemAttributeValueError) +from erpnext.controllers.item_variant import ( + InvalidItemAttributeValueError, + validate_is_incremental, + validate_item_attribute_value, +) class ItemAttributeIncrementError(frappe.ValidationError): pass diff --git a/erpnext/stock/doctype/item_attribute/test_item_attribute.py b/erpnext/stock/doctype/item_attribute/test_item_attribute.py index 07af176a9443..fc809f443e69 100644 --- a/erpnext/stock/doctype/item_attribute/test_item_attribute.py +++ b/erpnext/stock/doctype/item_attribute/test_item_attribute.py @@ -2,13 +2,16 @@ # See license.txt from __future__ import unicode_literals -import frappe + import unittest +import frappe + test_records = frappe.get_test_records('Item Attribute') from erpnext.stock.doctype.item_attribute.item_attribute import ItemAttributeIncrementError + class TestItemAttribute(unittest.TestCase): def setUp(self): if frappe.db.exists("Item Attribute", "_Test_Length"): diff --git a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py index edbab002da07..30a2dd101245 100644 --- a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py +++ b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ItemAttributeValue(Document): pass diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py index 3e4e85004671..cb64e0bcac84 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemCustomerDetail(Document): pass diff --git a/erpnext/stock/doctype/item_default/item_default.py b/erpnext/stock/doctype/item_default/item_default.py index 935f0ffb0ffe..6239c540434b 100644 --- a/erpnext/stock/doctype/item_default/item_default.py +++ b/erpnext/stock/doctype/item_default/item_default.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class ItemDefault(Document): pass diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py index 939abf8d3242..044ac7c2350c 100644 --- a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py +++ b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py @@ -8,6 +8,7 @@ from frappe import _ from frappe.model.document import Document + class ItemManufacturer(Document): def validate(self): self.validate_duplicate_entry() diff --git a/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py index 1cef20c4171a..5a4ca6a44ad7 100644 --- a/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py +++ b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestItemManufacturer(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index e82a19b0dc0b..3f0fc4136b0f 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py index f3d406eeca64..5ed80921660a 100644 --- a/erpnext/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe from frappe.test_runner import make_test_records_for_doctype -from erpnext.stock.get_item_details import get_price_list_rate_for, process_args + from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem +from erpnext.stock.get_item_details import get_price_list_rate_for, process_args class TestItemPrice(unittest.TestCase): diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py index 785737b267f6..ab15e4e709e1 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemQualityInspectionParameter(Document): pass diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.py b/erpnext/stock/doctype/item_reorder/item_reorder.py index 5cdaa229565b..2da6b37a8ade 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.py +++ b/erpnext/stock/doctype/item_reorder/item_reorder.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemReorder(Document): pass diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.py b/erpnext/stock/doctype/item_supplier/item_supplier.py index 5dda535f8105..71505db6adf6 100644 --- a/erpnext/stock/doctype/item_supplier/item_supplier.py +++ b/erpnext/stock/doctype/item_supplier/item_supplier.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemSupplier(Document): pass diff --git a/erpnext/stock/doctype/item_tax/item_tax.py b/erpnext/stock/doctype/item_tax/item_tax.py index 7c9e81157587..8708cede77c7 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.py +++ b/erpnext/stock/doctype/item_tax/item_tax.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemTax(Document): pass diff --git a/erpnext/stock/doctype/item_variant/item_variant.py b/erpnext/stock/doctype/item_variant/item_variant.py index 5d5a022648ab..3cc84c3f1696 100644 --- a/erpnext/stock/doctype/item_variant/item_variant.py +++ b/erpnext/stock/doctype/item_variant/item_variant.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ItemVariant(Document): pass diff --git a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py index d1a1eb54a5da..c4df73cf1989 100644 --- a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py +++ b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class ItemVariantAttribute(Document): pass diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py index 78f1131b7699..cb6626fd17bc 100644 --- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py +++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document + class ItemVariantSettings(Document): invalid_fields_for_copy_fields_in_variants = ['barcodes'] diff --git a/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py b/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py index 9a800c07fcb1..040382a66f71 100644 --- a/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py +++ b/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py @@ -5,5 +5,6 @@ import unittest + class TestItemVariantSettings(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.py b/erpnext/stock/doctype/item_website_specification/item_website_specification.py index e3041cf3eef6..4af43d90fa61 100644 --- a/erpnext/stock/doctype/item_website_specification/item_website_specification.py +++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class ItemWebsiteSpecification(Document): pass diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py index 493e8b239a46..2683ec776c53 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class LandedCostItem(Document): pass diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py index 38f4eafc3aa8..0b808e0161f5 100644 --- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py +++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class LandedCostPurchaseReceipt(Document): pass diff --git a/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py b/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py index 0dc396aefac3..2b3525f93ff7 100644 --- a/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py +++ b/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class LandedCostTaxesandCharges(Document): pass diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py index bf969f99f8e2..7a863da41ac3 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py @@ -2,14 +2,18 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt -from frappe.model.meta import get_field_precision from frappe.model.document import Document -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from frappe.model.meta import get_field_precision +from frappe.utils import flt + +import erpnext from erpnext.accounts.doctype.account.account import get_account_currency from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals +from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + class LandedCostVoucher(Document): @frappe.whitelist() diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py index cb09d9338016..15945cbb8f3d 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py @@ -3,15 +3,23 @@ from __future__ import unicode_literals + import unittest + import frappe from frappe.utils import flt -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \ - import get_gl_entries, test_records as pr_test_records, make_purchase_receipt + +from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice -from erpnext.accounts.doctype.account.test_account import get_inventory_account -from erpnext.accounts.doctype.account.test_account import create_account from erpnext.assets.doctype.asset.test_asset import create_asset_category, create_fixed_asset_item +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( + get_gl_entries, + make_purchase_receipt, +) +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( + test_records as pr_test_records, +) + class TestLandedCostVoucher(unittest.TestCase): def test_landed_cost_voucher(self): @@ -208,7 +216,10 @@ def test_multiple_landed_cost_voucher_against_pr(self): self.assertEqual(pr.items[1].landed_cost_voucher_amount, 100) def test_multi_currency_lcv(self): - from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records, save_new_records + from erpnext.setup.doctype.currency_exchange.test_currency_exchange import ( + save_new_records, + test_records, + ) save_new_records(test_records) diff --git a/erpnext/stock/doctype/manufacturer/manufacturer.py b/erpnext/stock/doctype/manufacturer/manufacturer.py index b624f73b773f..9efd6ae1aeeb 100644 --- a/erpnext/stock/doctype/manufacturer/manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/manufacturer.py @@ -3,10 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address +from frappe.contacts.address_and_contact import ( + delete_contact_and_address, + load_address_and_contact, +) from frappe.model.document import Document + class Manufacturer(Document): def onload(self): """Load address and contacts in `__onload`""" diff --git a/erpnext/stock/doctype/manufacturer/test_manufacturer.py b/erpnext/stock/doctype/manufacturer/test_manufacturer.py index 996f6b27ca0c..5513aa34bf4e 100644 --- a/erpnext/stock/doctype/manufacturer/test_manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/test_manufacturer.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Manufacturer') class TestManufacturer(unittest.TestCase): diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 026b85e26d25..b92d8aeab350 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -5,19 +5,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json -from frappe.utils import cstr, flt, getdate, new_line_sep, nowdate, add_days, get_link_to_form -from frappe import msgprint, _ +import frappe +from frappe import _, msgprint from frappe.model.mapper import get_mapped_doc -from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty +from frappe.utils import add_days, cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate +from six import string_types + +from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items from erpnext.controllers.buying_controller import BuyingController from erpnext.manufacturing.doctype.work_order.work_order import get_item_details -from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items from erpnext.stock.doctype.item.item import get_item_defaults - -from six import string_types +from erpnext.stock.stock_balance import get_indented_qty, update_bin_qty form_grid_templates = { "items": "templates/form_grid/material_request_grid.html" diff --git a/erpnext/stock/doctype/material_request/material_request_dashboard.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py index e1e4faf6825d..291cfb53c906 100644 --- a/erpnext/stock/doctype/material_request/material_request_dashboard.py +++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + from frappe import _ diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index b4776ba24920..e1ff207bec98 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -5,11 +5,21 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, unittest, erpnext + +import unittest + +import frappe from frappe.utils import flt, today -from erpnext.stock.doctype.material_request.material_request \ - import raise_work_orders, make_stock_entry, make_purchase_order, make_supplier_quotation + +import erpnext from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.material_request.material_request import ( + make_purchase_order, + make_stock_entry, + make_supplier_quotation, + raise_work_orders, +) + class TestMaterialRequest(unittest.TestCase): def test_make_purchase_order(self): diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.py b/erpnext/stock/doctype/material_request_item/material_request_item.py index e0066e65d2ce..0c98b97e57e6 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.py +++ b/erpnext/stock/doctype/material_request_item/material_request_item.py @@ -4,10 +4,11 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class MaterialRequestItem(Document): pass diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 4ab71bdf6292..146a1065af40 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -4,10 +4,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json + +import json + +import frappe +from frappe.model.document import Document from frappe.utils import cstr, flt + from erpnext.stock.get_item_details import get_item_details -from frappe.model.document import Document + class PackedItem(Document): pass diff --git a/erpnext/stock/doctype/packing_slip/test_packing_slip.py b/erpnext/stock/doctype/packing_slip/test_packing_slip.py index 1f2af02e209a..e13ef8709512 100644 --- a/erpnext/stock/doctype/packing_slip/test_packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/test_packing_slip.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('Packing Slip') class TestPackingSlip(unittest.TestCase): diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py index b0a855961f9f..5dc37e42af31 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py @@ -4,9 +4,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PackingSlipItem(Document): pass diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 516ae43089b6..56139d9cc266 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -3,16 +3,21 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json -from six import iteritems -from frappe.model.document import Document -from frappe import _ from collections import OrderedDict -from frappe.utils import floor, flt, today, cint + +import frappe +from frappe import _ +from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc, map_child_doc +from frappe.utils import cint, floor, flt, today +from six import iteritems + +from erpnext.selling.doctype.sales_order.sales_order import ( + make_delivery_note as create_delivery_note_from_sales_order, +) from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note as create_delivery_note_from_sales_order # TODO: Prioritize SO or WO group warehouse diff --git a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py index 7c321c450a60..26e3fa6b3caf 100644 --- a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py +++ b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'pick_list', diff --git a/erpnext/stock/doctype/pick_list/test_pick_list.py b/erpnext/stock/doctype/pick_list/test_pick_list.py index 84566b8d8c78..aa710ad0e976 100644 --- a/erpnext/stock/doctype/pick_list/test_pick_list.py +++ b/erpnext/stock/doctype/pick_list/test_pick_list.py @@ -3,15 +3,19 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + test_dependencies = ['Item', 'Sales Invoice', 'Stock Entry', 'Batch'] -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.item.test_item import create_item from erpnext.stock.doctype.pick_list.pick_list import create_delivery_note -from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation \ - import EmptyStockReconciliationItemsError +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + EmptyStockReconciliationItemsError, +) + class TestPickList(unittest.TestCase): diff --git a/erpnext/stock/doctype/pick_list_item/pick_list_item.py b/erpnext/stock/doctype/pick_list_item/pick_list_item.py index 8797b8dc2199..4cd81f7f85be 100644 --- a/erpnext/stock/doctype/pick_list_item/pick_list_item.py +++ b/erpnext/stock/doctype/pick_list_item/pick_list_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PickListItem(Document): pass diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index 002d3d898eb5..ba2e247b0d9a 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +import frappe.defaults from frappe import _, throw -from frappe.utils import cint from frappe.model.document import Document -import frappe.defaults +from frappe.utils import cint + class PriceList(Document): def validate(self): @@ -37,7 +39,9 @@ def update_item_price(self): def check_impact_on_shopping_cart(self): "Check if Price List currency change impacts Shopping Cart." - from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import validate_cart_settings + from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + validate_cart_settings, + ) doc_before_save = self.get_doc_before_save() currency_changed = self.currency != doc_before_save.currency diff --git a/erpnext/stock/doctype/price_list/test_price_list.py b/erpnext/stock/doctype/price_list/test_price_list.py index 2c287c9033c4..baf6170e8503 100644 --- a/erpnext/stock/doctype/price_list/test_price_list.py +++ b/erpnext/stock/doctype/price_list/test_price_list.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe # test_ignore = ["Item"] diff --git a/erpnext/stock/doctype/price_list_country/price_list_country.py b/erpnext/stock/doctype/price_list_country/price_list_country.py index db1a0607e62d..bea48b3d1272 100644 --- a/erpnext/stock/doctype/price_list_country/price_list_country.py +++ b/erpnext/stock/doctype/price_list_country/price_list_country.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class PriceListCountry(Document): pass diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 4a4514f2497c..11f407f8faa5 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -2,21 +2,20 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe - -from frappe.utils import flt, cint, nowdate -from frappe import throw, _ +import frappe import frappe.defaults -from frappe.utils import getdate -from erpnext.controllers.buying_controller import BuyingController -from erpnext.accounts.utils import get_account_currency +from frappe import _, throw from frappe.desk.notifications import clear_doctype_notifications from frappe.model.mapper import get_mapped_doc -from erpnext.buying.utils import check_on_hold_or_closed_status +from frappe.utils import cint, flt, getdate, nowdate +from six import iteritems + +from erpnext.accounts.utils import get_account_currency from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_enabled from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account -from six import iteritems +from erpnext.buying.utils import check_on_hold_or_closed_status +from erpnext.controllers.buying_controller import BuyingController from erpnext.stock.doctype.delivery_note.delivery_note import make_inter_company_transaction form_grid_templates = { diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py index 3832c827e276..b60850f28556 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + from frappe import _ + def get_data(): return { 'fieldname': 'purchase_receipt_no', diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 0210702250e5..0c55e54dbe5f 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -2,20 +2,23 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import unittest + import json -import frappe, erpnext +import unittest + +import frappe import frappe.defaults -from frappe.utils import cint, flt, cstr, today, random_string, add_days -from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice -from erpnext.stock.doctype.item.test_item import create_item -from erpnext.stock.doctype.serial_no.serial_no import SerialNoDuplicateError -from erpnext.accounts.doctype.account.test_account import get_inventory_account -from erpnext.stock.doctype.item.test_item import make_item +from frappe.utils import add_days, cint, cstr, flt, random_string, today from six import iteritems -from erpnext.stock.stock_ledger import SerialNoExistsInFutureTransaction + +import erpnext +from erpnext.accounts.doctype.account.test_account import get_inventory_account +from erpnext.stock.doctype.item.test_item import create_item, make_item +from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice +from erpnext.stock.doctype.serial_no.serial_no import SerialNoDuplicateError, get_serial_nos from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.stock_ledger import SerialNoExistsInFutureTransaction + class TestPurchaseReceipt(unittest.TestCase): def setUp(self): @@ -275,11 +278,16 @@ def test_subcontracting_over_receipt(self): receive more than the required qty in the PO. Expected Result: Error Raised for Over Receipt against PO. """ + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt + from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_rm_stock_entry as make_subcontract_transfer_entry, + ) + from erpnext.buying.doctype.purchase_order.test_purchase_order import ( + create_purchase_order, + make_subcontracted_item, + update_backflush_based_on, + ) from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry - from erpnext.buying.doctype.purchase_order.test_purchase_order import (update_backflush_based_on, - make_subcontracted_item, create_purchase_order) - from erpnext.buying.doctype.purchase_order.purchase_order import (make_purchase_receipt, - make_rm_stock_entry as make_subcontract_transfer_entry) update_backflush_based_on("Material Transferred for Subcontract") item_code = "_Test Subcontracted FG Item 1" @@ -526,7 +534,9 @@ def test_purchase_return_for_multi_uom(self): pr.cancel() def test_closed_purchase_receipt(self): - from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_purchase_receipt_status + from erpnext.stock.doctype.purchase_receipt.purchase_receipt import ( + update_purchase_receipt_status, + ) pr = make_purchase_receipt(do_not_submit=True) pr.submit() @@ -539,9 +549,11 @@ def test_closed_purchase_receipt(self): def test_pr_billing_status(self): # PO -> PR1 -> PI and PO -> PI and PO -> PR2 + from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_purchase_invoice as make_purchase_invoice_from_po, + ) + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order - from erpnext.buying.doctype.purchase_order.purchase_order \ - import make_purchase_receipt, make_purchase_invoice as make_purchase_invoice_from_po po = create_purchase_order() @@ -748,7 +760,10 @@ def test_purchase_receipt_cost_center_with_balance_sheet_account(self): pr.cancel() def test_make_purchase_invoice_from_pr_for_returned_qty(self): - from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order, create_pr_against_po + from erpnext.buying.doctype.purchase_order.test_purchase_order import ( + create_pr_against_po, + create_purchase_order, + ) po = create_purchase_order() pr = create_pr_against_po(po.name) @@ -879,10 +894,15 @@ def test_stock_transfer_from_purchase_receipt_with_valuation(self): def test_subcontracted_pr_for_multi_transfer_batches(self): + from erpnext.buying.doctype.purchase_order.purchase_order import ( + make_purchase_receipt, + make_rm_stock_entry, + ) + from erpnext.buying.doctype.purchase_order.test_purchase_order import ( + create_purchase_order, + update_backflush_based_on, + ) from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry - from erpnext.buying.doctype.purchase_order.purchase_order import make_rm_stock_entry, make_purchase_receipt - from erpnext.buying.doctype.purchase_order.test_purchase_order import (update_backflush_based_on, - create_purchase_order) update_backflush_based_on("Material Transferred for Subcontract") item_code = "_Test Subcontracted FG Item 3" @@ -952,8 +972,7 @@ def test_po_to_pi_and_po_to_pr_worflow_full(self): - Create PI from PO and submit - Create PR from PO and submit """ - from erpnext.buying.doctype.purchase_order import test_purchase_order - from erpnext.buying.doctype.purchase_order import purchase_order + from erpnext.buying.doctype.purchase_order import purchase_order, test_purchase_order po = test_purchase_order.create_purchase_order() @@ -974,8 +993,7 @@ def test_po_to_pi_and_po_to_pr_worflow_partial(self): - Create partial PI from PO and submit - Create PR from PO and submit """ - from erpnext.buying.doctype.purchase_order import test_purchase_order - from erpnext.buying.doctype.purchase_order import purchase_order + from erpnext.buying.doctype.purchase_order import purchase_order, test_purchase_order po = test_purchase_order.create_purchase_order() @@ -1038,10 +1056,18 @@ def test_service_item_purchase_with_perpetual_inventory(self): frappe.db.set_value('Company', company, 'enable_perpetual_inventory_for_non_stock_items', before_test_value) def test_payment_terms_are_fetched_when_creating_purchase_invoice(self): - from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template + from erpnext.accounts.doctype.payment_entry.test_payment_entry import ( + create_payment_terms_template, + ) from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice - from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order, make_pr_against_po - from erpnext.selling.doctype.sales_order.test_sales_order import automatically_fetch_payment_terms, compare_payment_schedules + from erpnext.buying.doctype.purchase_order.test_purchase_order import ( + create_purchase_order, + make_pr_against_po, + ) + from erpnext.selling.doctype.sales_order.test_sales_order import ( + automatically_fetch_payment_terms, + compare_payment_schedules, + ) automatically_fetch_payment_terms() diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py index b79bb5d0430e..375ff9a9a3fb 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class PurchaseReceiptItem(Document): pass diff --git a/erpnext/stock/doctype/putaway_rule/putaway_rule.py b/erpnext/stock/doctype/putaway_rule/putaway_rule.py index 315e723fabc4..aa9d8968063e 100644 --- a/erpnext/stock/doctype/putaway_rule/putaway_rule.py +++ b/erpnext/stock/doctype/putaway_rule/putaway_rule.py @@ -3,16 +3,20 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import copy import json from collections import defaultdict -from six import string_types + +import frappe from frappe import _ -from frappe.utils import flt, floor, nowdate, cint from frappe.model.document import Document -from erpnext.stock.utils import get_stock_balance +from frappe.utils import cint, floor, flt, nowdate +from six import string_types + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.utils import get_stock_balance + class PutawayRule(Document): def validate(self): diff --git a/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py b/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py index 0590ae1abeb9..0aa7610575e6 100644 --- a/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py +++ b/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py @@ -2,14 +2,18 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals -import frappe + import unittest -from erpnext.stock.doctype.item.test_item import make_item -from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + +import frappe + from erpnext.stock.doctype.batch.test_batch import make_new_batch +from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry +from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse +from erpnext.stock.get_item_details import get_conversion_factor + class TestPutawayRule(unittest.TestCase): def setUp(self): diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.py b/erpnext/stock/doctype/quality_inspection/quality_inspection.py index 469511af60bf..8b2f8da9dfdf 100644 --- a/erpnext/stock/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.py @@ -2,13 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe +from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe import _ -from frappe.utils import flt, cint -from erpnext.stock.doctype.quality_inspection_template.quality_inspection_template \ - import get_template_details +from frappe.utils import cint, flt + +from erpnext.stock.doctype.quality_inspection_template.quality_inspection_template import ( + get_template_details, +) + class QualityInspection(Document): def validate(self): diff --git a/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.py b/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.py index 86784221a0c7..fa682012e591 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.py +++ b/erpnext/stock/doctype/quality_inspection_parameter/quality_inspection_parameter.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityInspectionParameter(Document): pass diff --git a/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py b/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py index cefdc0867b1f..f3041aa863d2 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py +++ b/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestQualityInspectionParameter(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.py b/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.py index 1a3b1a04639e..b5e28f3ec9da 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.py +++ b/erpnext/stock/doctype/quality_inspection_parameter_group/quality_inspection_parameter_group.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class QualityInspectionParameterGroup(Document): pass diff --git a/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py b/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py index 212d4b8c21b4..ded47e8ca804 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py +++ b/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestQualityInspectionParameterGroup(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py index b10fa310d662..d3935294de96 100644 --- a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py +++ b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class QualityInspectionReading(Document): pass diff --git a/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.py b/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.py index 971b3c298251..50e28a6361f6 100644 --- a/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.py +++ b/erpnext/stock/doctype/quality_inspection_template/quality_inspection_template.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class QualityInspectionTemplate(Document): pass diff --git a/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py b/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py index b16efa839dbf..6286523c8614 100644 --- a/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py +++ b/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py @@ -5,5 +5,6 @@ import unittest + class TestQualityInspectionTemplate(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.py b/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.py index efa951940ea1..8ca5521de02b 100644 --- a/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.py +++ b/erpnext/stock/doctype/quick_stock_balance/quick_stock_balance.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + from erpnext.stock.utils import get_stock_balance, get_stock_value_on + class QuickStockBalance(Document): pass diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 2e454a515965..64677d167c1b 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -3,14 +3,22 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext -from rq.timeouts import JobTimeoutException + +import frappe +from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, get_link_to_form, add_to_date, now, today, time_diff_in_hours -from erpnext.stock.stock_ledger import repost_future_sle -from erpnext.accounts.utils import update_gl_entries_after, check_if_stock_and_account_balance_synced +from frappe.utils import add_to_date, cint, get_link_to_form, now, time_diff_in_hours, today from frappe.utils.user import get_users_with_role -from frappe import _ +from rq.timeouts import JobTimeoutException + +import erpnext +from erpnext.accounts.utils import ( + check_if_stock_and_account_balance_synced, + update_gl_entries_after, +) +from erpnext.stock.stock_ledger import repost_future_sle + + class RepostItemValuation(Document): def validate(self): self.set_status() diff --git a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py index 13ceb68669c4..c70a9ec7a8ba 100644 --- a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestRepostItemValuation(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 319597f83993..82d8aaed5b3b 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -2,19 +2,20 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json +import frappe +from frappe import ValidationError, _ from frappe.model.naming import make_autoname -from frappe.utils import cint, cstr, flt, add_days, nowdate, getdate, get_link_to_form -from erpnext.stock.get_item_details import get_reserved_qty_for_so - -from frappe import _, ValidationError - -from erpnext.controllers.stock_controller import StockController +from frappe.utils import add_days, cint, cstr, flt, get_link_to_form, getdate, nowdate from six import string_types from six.moves import map +from erpnext.controllers.stock_controller import StockController +from erpnext.stock.get_item_details import get_reserved_qty_for_so + + class SerialNoCannotCreateDirectError(ValidationError): pass class SerialNoCannotCannotChangeError(ValidationError): pass class SerialNoNotRequiredError(ValidationError): pass diff --git a/erpnext/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py index 0eccce3a58e7..818c163c681c 100644 --- a/erpnext/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -5,12 +5,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, unittest -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +import unittest + +import frappe + from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse test_dependencies = ["Item"] @@ -18,6 +21,7 @@ from erpnext.stock.doctype.serial_no.serial_no import * + class TestSerialNo(unittest.TestCase): def test_cannot_create_direct(self): frappe.delete_doc_if_exists("Serial No", "_TCSER0001") diff --git a/erpnext/stock/doctype/shipment/shipment.py b/erpnext/stock/doctype/shipment/shipment.py index 01fcee4cac22..2cacd0dfab4f 100644 --- a/erpnext/stock/doctype/shipment/shipment.py +++ b/erpnext/stock/doctype/shipment/shipment.py @@ -3,12 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, get_time +from frappe.contacts.doctype.contact.contact import get_default_contact from frappe.model.document import Document +from frappe.utils import flt, get_time + from erpnext.accounts.party import get_party_shipping_address -from frappe.contacts.doctype.contact.contact import get_default_contact + class Shipment(Document): def validate(self): diff --git a/erpnext/stock/doctype/shipment/test_shipment.py b/erpnext/stock/doctype/shipment/test_shipment.py index db2f11617435..9914cf80158b 100644 --- a/erpnext/stock/doctype/shipment/test_shipment.py +++ b/erpnext/stock/doctype/shipment/test_shipment.py @@ -2,12 +2,15 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals + +import unittest from datetime import date, timedelta import frappe -import unittest + from erpnext.stock.doctype.delivery_note.delivery_note import make_shipment + class TestShipment(unittest.TestCase): def test_shipment_from_delivery_note(self): delivery_note = create_test_delivery_note() diff --git a/erpnext/stock/doctype/shipment_delivery_note/shipment_delivery_note.py b/erpnext/stock/doctype/shipment_delivery_note/shipment_delivery_note.py index 434215160572..795c952bcdd6 100644 --- a/erpnext/stock/doctype/shipment_delivery_note/shipment_delivery_note.py +++ b/erpnext/stock/doctype/shipment_delivery_note/shipment_delivery_note.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ShipmentDeliveryNote(Document): pass diff --git a/erpnext/stock/doctype/shipment_parcel/shipment_parcel.py b/erpnext/stock/doctype/shipment_parcel/shipment_parcel.py index 53e6ed55dd32..69fecb6e5ce2 100644 --- a/erpnext/stock/doctype/shipment_parcel/shipment_parcel.py +++ b/erpnext/stock/doctype/shipment_parcel/shipment_parcel.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ShipmentParcel(Document): pass diff --git a/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.py b/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.py index 2a8d58d8305d..0eaa2d3d5b8a 100644 --- a/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.py +++ b/erpnext/stock/doctype/shipment_parcel_template/shipment_parcel_template.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ShipmentParcelTemplate(Document): pass diff --git a/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py b/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py index 6e2caa768bf8..5f2a3993353f 100644 --- a/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py +++ b/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestShipmentParcelTemplate(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 6f34dab43007..2a254a23ec67 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -2,27 +2,40 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import json + +import frappe import frappe.defaults from frappe import _ -from frappe.utils import cstr, cint, flt, comma_or, getdate, nowdate, formatdate, format_time -from erpnext.stock.utils import get_incoming_rate -from erpnext.stock.stock_ledger import get_previous_sle, NegativeStockError, get_valuation_rate -from erpnext.stock.get_item_details import get_bin_details, get_default_cost_center, get_conversion_factor, get_reserved_qty_for_so -from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults -from erpnext.setup.doctype.brand.brand import get_brand_defaults -from erpnext.stock.doctype.batch.batch import get_batch_no, set_batch_nos, get_batch_qty -from erpnext.stock.doctype.item.item import get_item_defaults -from erpnext.manufacturing.doctype.bom.bom import validate_bom_no, add_additional_cost -from erpnext.stock.utils import get_bin from frappe.model.mapper import get_mapped_doc -from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit, get_serial_nos -from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import OpeningEntryAccountError +from frappe.utils import cint, comma_or, cstr, flt, format_time, formatdate, getdate, nowdate +from six import iteritems, itervalues, string_types + +import erpnext from erpnext.accounts.general_ledger import process_gl_map from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals -import json +from erpnext.manufacturing.doctype.bom.bom import add_additional_cost, validate_bom_no +from erpnext.setup.doctype.brand.brand import get_brand_defaults +from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults +from erpnext.stock.doctype.batch.batch import get_batch_no, get_batch_qty, set_batch_nos +from erpnext.stock.doctype.item.item import get_item_defaults +from erpnext.stock.doctype.serial_no.serial_no import ( + get_serial_nos, + update_serial_nos_after_submit, +) +from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + OpeningEntryAccountError, +) +from erpnext.stock.get_item_details import ( + get_bin_details, + get_conversion_factor, + get_default_cost_center, + get_reserved_qty_for_so, +) +from erpnext.stock.stock_ledger import NegativeStockError, get_previous_sle, get_valuation_rate +from erpnext.stock.utils import get_bin, get_incoming_rate -from six import string_types, itervalues, iteritems class IncorrectValuationRateError(frappe.ValidationError): pass class DuplicateEntryForWorkOrderError(frappe.ValidationError): pass diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py index 563fcb039734..f54dc4604ed0 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py @@ -2,11 +2,14 @@ # See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import cint, flt +import frappe +from frappe.utils import cint, flt from six import string_types +import erpnext + + @frappe.whitelist() def make_stock_entry(**args): '''Helper function to make a Stock Entry diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index a0e70516d4ba..34f6eaf40aea 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -2,20 +2,36 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, unittest + +import unittest + +import frappe import frappe.defaults +from frappe.permissions import add_user_permission, remove_user_permission from frappe.utils import flt, nowdate, nowtime +from six import iteritems + +from erpnext.accounts.doctype.account.test_account import get_inventory_account +from erpnext.stock.doctype.item.test_item import ( + create_item, + make_item_variant, + set_item_variant_settings, +) from erpnext.stock.doctype.serial_no.serial_no import * +from erpnext.stock.doctype.stock_entry.stock_entry import ( + make_stock_in_entry, + move_sample_to_retention_warehouse, +) +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import StockFreezeError +from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + OpeningEntryAccountError, +) +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, +) from erpnext.stock.stock_ledger import get_previous_sle -from frappe.permissions import add_user_permission, remove_user_permission -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation -from erpnext.stock.doctype.item.test_item import set_item_variant_settings, make_item_variant, create_item -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.accounts.doctype.account.test_account import get_inventory_account -from erpnext.stock.doctype.stock_entry.stock_entry import move_sample_to_retention_warehouse, make_stock_in_entry -from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import OpeningEntryAccountError -from six import iteritems + def get_sle(**args): condition, values = "", [] @@ -539,8 +555,9 @@ def test_freeze_stocks(self): frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 0) def test_work_order(self): - from erpnext.manufacturing.doctype.work_order.work_order \ - import make_stock_entry as _make_stock_entry + from erpnext.manufacturing.doctype.work_order.work_order import ( + make_stock_entry as _make_stock_entry, + ) bom_no, bom_operation_cost = frappe.db.get_value("BOM", {"item": "_Test FG Item 2", "is_default": 1, "docstatus": 1}, ["name", "operating_cost"]) @@ -618,8 +635,8 @@ def test_same_serial_nos_in_repack_or_manufacture_entries(self): s2.cancel() def test_retain_sample(self): - from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse from erpnext.stock.doctype.batch.batch import get_batch_qty + from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse create_warehouse("Test Warehouse for Sample Retention") frappe.db.set_value("Stock Settings", None, "sample_retention_warehouse", "Test Warehouse for Sample Retention - _TC") diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py index a5623fded23d..c0507ac928a2 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class StockEntryDetail(Document): pass diff --git a/erpnext/stock/doctype/stock_entry_type/stock_entry_type.py b/erpnext/stock/doctype/stock_entry_type/stock_entry_type.py index 1069ec8713e6..3d6e26409e12 100644 --- a/erpnext/stock/doctype/stock_entry_type/stock_entry_type.py +++ b/erpnext/stock/doctype/stock_entry_type/stock_entry_type.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class StockEntryType(Document): def validate(self): if self.add_to_transit and self.purpose != 'Material Transfer': diff --git a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py index 4fa73fd2dca5..1ed2a62930c2 100644 --- a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py +++ b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestStockEntryType(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index be1f00e37fa7..caa1d42b6620 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -3,14 +3,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +from datetime import date + import frappe from frappe import _ -from frappe.utils import flt, getdate, add_days, formatdate, get_datetime, cint +from frappe.core.doctype.role.role import get_users from frappe.model.document import Document -from datetime import date -from erpnext.controllers.item_variant import ItemTemplateCannotHaveStock +from frappe.utils import add_days, cint, flt, formatdate, get_datetime, getdate + from erpnext.accounts.utils import get_fiscal_year -from frappe.core.doctype.role.role import get_users +from erpnext.controllers.item_variant import ItemTemplateCannotHaveStock + class StockFreezeError(frappe.ValidationError): pass class BackDatedStockTransaction(frappe.ValidationError): pass @@ -27,7 +31,7 @@ def autoname(self): def validate(self): self.flags.ignore_submit_comment = True - from erpnext.stock.utils import validate_warehouse_company, validate_disabled_warehouse + from erpnext.stock.utils import validate_disabled_warehouse, validate_warehouse_company self.validate_mandatory() self.validate_item() self.validate_batch() diff --git a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py index af2ada8c9a4b..61bae49b0bda 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py @@ -3,19 +3,25 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from frappe.utils import today, add_days -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation \ - import create_stock_reconciliation + +import frappe +from frappe.core.page.permission_manager.permission_manager import reset +from frappe.utils import add_days, today + +from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note from erpnext.stock.doctype.item.test_item import make_item -from erpnext.stock.stock_ledger import get_previous_sle +from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import ( + create_landed_cost_voucher, +) from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt -from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import create_landed_cost_voucher -from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import BackDatedStockTransaction -from frappe.core.page.permission_manager.permission_manager import reset +from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import ( + create_stock_reconciliation, +) +from erpnext.stock.stock_ledger import get_previous_sle + class TestStockLedgerEntry(unittest.TestCase): def setUp(self): diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 4531652a13c9..d3d023500ad5 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -2,15 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe import frappe.defaults -from frappe import msgprint, _ -from frappe.utils import cstr, flt, cint -from erpnext.controllers.stock_controller import StockController +from frappe import _, msgprint +from frappe.utils import cint, cstr, flt + +import erpnext from erpnext.accounts.utils import get_company_default -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos -from erpnext.stock.utils import get_stock_balance, get_incoming_rate, get_available_serial_nos +from erpnext.controllers.stock_controller import StockController from erpnext.stock.doctype.batch.batch import get_batch_qty +from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.utils import get_available_serial_nos, get_incoming_rate, get_stock_balance + class OpeningEntryAccountError(frappe.ValidationError): pass class EmptyStockReconciliationItemsError(frappe.ValidationError): pass @@ -159,8 +163,11 @@ def _get_msg(row_num, msg): raise frappe.ValidationError(self.validation_messages) def validate_item(self, item_code, row): - from erpnext.stock.doctype.item.item import validate_end_of_life, \ - validate_is_stock_item, validate_cancelled_item + from erpnext.stock.doctype.item.item import ( + validate_cancelled_item, + validate_end_of_life, + validate_is_stock_item, + ) # using try except to catch all validation msgs and display together diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index e4381271ed2a..8647bee40ec1 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -5,16 +5,23 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, unittest -from frappe.utils import flt, nowdate, nowtime, random_string, add_days + +import unittest + +import frappe +from frappe.utils import add_days, flt, nowdate, nowtime, random_string + from erpnext.accounts.utils import get_stock_and_account_balance -from erpnext.stock.stock_ledger import get_previous_sle, update_entries_after -from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import EmptyStockReconciliationItemsError, get_items -from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse from erpnext.stock.doctype.item.test_item import create_item -from erpnext.stock.utils import get_incoming_rate, get_stock_value_on, get_valuation_method -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt +from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( + EmptyStockReconciliationItemsError, + get_items, +) +from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse +from erpnext.stock.stock_ledger import get_previous_sle, update_entries_after +from erpnext.stock.utils import get_incoming_rate, get_stock_value_on, get_valuation_method from erpnext.tests.utils import change_settings @@ -322,8 +329,8 @@ def test_backdated_stock_reco_future_negative_stock(self): SR3 | Reco | 0 | 1 (posting date: today-1) [backdated & blocked] DN2 | DN | -2 | 8(-1) (posting date: today) """ - from erpnext.stock.stock_ledger import NegativeStockError from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note + from erpnext.stock.stock_ledger import NegativeStockError item_code = "Backdated-Reco-Item" warehouse = "_Test Warehouse - _TC" @@ -363,8 +370,8 @@ def test_backdated_stock_reco_cancellation_future_negative_stock(self): SR | Reco | 100 | 100 (posting date: today-1) (shouldn't be cancelled after DN) DN | DN | 100 | 0 (posting date: today) """ - from erpnext.stock.stock_ledger import NegativeStockError from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note + from erpnext.stock.stock_ledger import NegativeStockError frappe.db.commit() item_code = "Backdated-Reco-Cancellation-Item" diff --git a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py index cc1e19dcafbb..b2a72869c8c7 100644 --- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py +++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class StockReconciliationItem(Document): pass diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py index 2dd7c6f35b84..2a634b3d16b7 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/stock_settings.py @@ -4,12 +4,14 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ +from frappe.custom.doctype.property_setter.property_setter import make_property_setter from frappe.model.document import Document -from frappe.utils.html_utils import clean_html from frappe.utils import cint -from frappe.custom.doctype.property_setter.property_setter import make_property_setter +from frappe.utils.html_utils import clean_html + class StockSettings(Document): def validate(self): diff --git a/erpnext/stock/doctype/stock_settings/test_stock_settings.py b/erpnext/stock/doctype/stock_settings/test_stock_settings.py index 42a78f723d38..7e8090499fb8 100644 --- a/erpnext/stock/doctype/stock_settings/test_stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/test_stock_settings.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestStockSettings(unittest.TestCase): def setUp(self): frappe.db.set_value("Stock Settings", None, "clean_description_html", 0) diff --git a/erpnext/stock/doctype/uom_category/test_uom_category.py b/erpnext/stock/doctype/uom_category/test_uom_category.py index 33bd408a5729..dd5510a3dd38 100644 --- a/erpnext/stock/doctype/uom_category/test_uom_category.py +++ b/erpnext/stock/doctype/uom_category/test_uom_category.py @@ -5,5 +5,6 @@ import unittest + class TestUOMCategory(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/uom_category/uom_category.py b/erpnext/stock/doctype/uom_category/uom_category.py index d5c339e1bf34..282ebb2f4e20 100644 --- a/erpnext/stock/doctype/uom_category/uom_category.py +++ b/erpnext/stock/doctype/uom_category/uom_category.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class UOMCategory(Document): pass diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py index fdead2056702..fc0636f23e06 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class UOMConversionDetail(Document): pass diff --git a/erpnext/stock/doctype/variant_field/test_variant_field.py b/erpnext/stock/doctype/variant_field/test_variant_field.py index 53024bdac156..408e33b2f70e 100644 --- a/erpnext/stock/doctype/variant_field/test_variant_field.py +++ b/erpnext/stock/doctype/variant_field/test_variant_field.py @@ -5,5 +5,6 @@ import unittest + class TestVariantField(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/variant_field/variant_field.py b/erpnext/stock/doctype/variant_field/variant_field.py index a77301e0e54e..abcfdc7030f3 100644 --- a/erpnext/stock/doctype/variant_field/variant_field.py +++ b/erpnext/stock/doctype/variant_field/variant_field.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class VariantField(Document): pass diff --git a/erpnext/stock/doctype/warehouse/test_warehouse.py b/erpnext/stock/doctype/warehouse/test_warehouse.py index 6e429a225524..1ca7181f2792 100644 --- a/erpnext/stock/doctype/warehouse/test_warehouse.py +++ b/erpnext/stock/doctype/warehouse/test_warehouse.py @@ -5,13 +5,13 @@ import unittest import frappe -from frappe.utils import cint from frappe.test_runner import make_test_records +from frappe.utils import cint import erpnext -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -from erpnext.accounts.doctype.account.test_account import get_inventory_account, create_account +from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account from erpnext.stock.doctype.item.test_item import create_item +from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry test_records = frappe.get_test_records('Warehouse') diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 3abc13907cf6..ecd8707fa694 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -2,13 +2,18 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe.utils import cint, flt -from frappe import throw, _ + from collections import defaultdict + +import frappe +from frappe import _, throw +from frappe.contacts.address_and_contact import load_address_and_contact +from frappe.utils import cint, flt from frappe.utils.nestedset import NestedSet + +import erpnext from erpnext.stock import get_warehouse_account -from frappe.contacts.address_and_contact import load_address_and_contact + class Warehouse(NestedSet): nsm_parent_field = 'parent_warehouse' diff --git a/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py b/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py index 39f4b2391bda..846e63be30a0 100644 --- a/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py +++ b/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestWarehouseType(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/warehouse_type/warehouse_type.py b/erpnext/stock/doctype/warehouse_type/warehouse_type.py index 4b7d8d829f9c..fd83d7877962 100644 --- a/erpnext/stock/doctype/warehouse_type/warehouse_type.py +++ b/erpnext/stock/doctype/warehouse_type/warehouse_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class WarehouseType(Document): pass diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index c72073c6143b..656ebc8d3a1f 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -2,22 +2,28 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import copy +import json + import frappe from frappe import _, throw -from frappe.utils import flt, cint, add_days, cstr, add_months, getdate -import json, copy -from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_for_item, set_transaction_type -from erpnext.setup.utils import get_exchange_rate from frappe.model.meta import get_field_precision -from erpnext.stock.doctype.batch.batch import get_batch_no +from frappe.utils import add_days, add_months, cint, cstr, flt, getdate +from six import iteritems, string_types + from erpnext import get_company_currency -from erpnext.stock.doctype.item.item import get_item_defaults, get_uom_conv_factor -from erpnext.stock.doctype.price_list.price_list import get_price_list_details -from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults +from erpnext.accounts.doctype.pricing_rule.pricing_rule import ( + get_pricing_rule_for_item, + set_transaction_type, +) from erpnext.setup.doctype.brand.brand import get_brand_defaults +from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults +from erpnext.setup.utils import get_exchange_rate +from erpnext.stock.doctype.batch.batch import get_batch_no +from erpnext.stock.doctype.item.item import get_item_defaults, get_uom_conv_factor from erpnext.stock.doctype.item_manufacturer.item_manufacturer import get_item_manufacturer_part_no - -from six import string_types, iteritems +from erpnext.stock.doctype.price_list.price_list import get_price_list_details sales_doctypes = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice', 'POS Invoice'] purchase_doctypes = ['Material Request', 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index 4d8dcc68d258..3cd4cd27617b 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -2,11 +2,15 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -import erpnext + import json -from frappe.utils import flt, nowdate, add_days, cint + +import frappe from frappe import _ +from frappe.utils import add_days, cint, flt, nowdate + +import erpnext + def reorder_item(): """ Reorder item if stock reaches reorder level""" diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py index 29689b1a912d..2dad1d24113f 100644 --- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py +++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, cint, getdate +from frappe.utils import cint, flt, getdate + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/stock/report/bom_search/bom_search.py b/erpnext/stock/report/bom_search/bom_search.py index e3955c9a37f3..3228d59e5f4c 100644 --- a/erpnext/stock/report/bom_search/bom_search.py +++ b/erpnext/stock/report/bom_search/bom_search.py @@ -2,10 +2,13 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, json +import json + +import frappe from six import iteritems + def execute(filters=None): data = [] parents = { diff --git a/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.py b/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.py index 7532d022258c..5f6184d6f35f 100644 --- a/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.py +++ b/erpnext/stock/report/cogs_by_item_group/cogs_by_item_group.py @@ -1,8 +1,8 @@ # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -from collections import OrderedDict import datetime +from collections import OrderedDict from typing import Dict, List, Tuple, Union import frappe @@ -11,7 +11,6 @@ from erpnext.accounts.report.general_ledger.general_ledger import get_gl_entries - Filters = frappe._dict Row = frappe._dict Data = List[Row] diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.py b/erpnext/stock/report/delayed_item_report/delayed_item_report.py index 61306662c0d7..1dd0478b40c1 100644 --- a/erpnext/stock/report/delayed_item_report/delayed_item_report.py +++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import date_diff + def execute(filters=None, consolidated = False): data, columns = DelayedItemReport(filters).run() diff --git a/erpnext/stock/report/delayed_order_report/delayed_order_report.py b/erpnext/stock/report/delayed_order_report/delayed_order_report.py index d9151606884d..677e30c5a411 100644 --- a/erpnext/stock/report/delayed_order_report/delayed_order_report.py +++ b/erpnext/stock/report/delayed_order_report/delayed_order_report.py @@ -2,9 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe import _ + from erpnext.stock.report.delayed_item_report.delayed_item_report import DelayedItemReport + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py index 77fd2ff24472..e6c192c78781 100644 --- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py index 00125e71a9a9..cf2732655997 100644 --- a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py +++ b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py @@ -3,8 +3,9 @@ import frappe from frappe import _ -from six import iteritems from frappe.utils import flt +from six import iteritems + def execute(filters=None): columns, data = [], [] diff --git a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py index b3b7594ffd72..5f03c7cbe0a2 100644 --- a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py +++ b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py @@ -1,12 +1,15 @@ # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import frappe import copy + +import frappe from frappe import _ from six import iteritems + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + def execute(filters=None): columns, data = [], [] columns = get_columns() diff --git a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py index c8f60a15d649..bc520ae27d92 100644 --- a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py +++ b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py @@ -2,13 +2,16 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe -import erpnext from frappe import _ +from frappe.utils import add_days, getdate, today from six import iteritems -from frappe.utils import add_days, today, getdate -from erpnext.stock.utils import get_stock_value_on + +import erpnext from erpnext.accounts.utils import get_stock_and_account_balance +from erpnext.stock.utils import get_stock_value_on + def execute(filters=None): if not erpnext.is_perpetual_inventory_enabled(filters.company): diff --git a/erpnext/stock/report/item_price_stock/item_price_stock.py b/erpnext/stock/report/item_price_stock/item_price_stock.py index db7498bb2157..6ffb5c8a9839 100644 --- a/erpnext/stock/report/item_price_stock/item_price_stock.py +++ b/erpnext/stock/report/item_price_stock/item_price_stock.py @@ -1,9 +1,11 @@ # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns, data = [], [] columns=get_columns() diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py index 12f32972039e..434a436658b7 100644 --- a/erpnext/stock/report/item_prices/item_prices.py +++ b/erpnext/stock/report/item_prices/item_prices.py @@ -2,10 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import msgprint, _ +from frappe import _, msgprint from frappe.utils import flt + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.py b/erpnext/stock/report/item_shortage_report/item_shortage_report.py index c67eed7e9263..1438e6cda022 100644 --- a/erpnext/stock/report/item_shortage_report/item_shortage_report.py +++ b/erpnext/stock/report/item_shortage_report/item_shortage_report.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns() conditions = get_conditions(filters) diff --git a/erpnext/stock/report/item_variant_details/item_variant_details.py b/erpnext/stock/report/item_variant_details/item_variant_details.py index d8563d79271b..eedda53bed2d 100644 --- a/erpnext/stock/report/item_variant_details/item_variant_details.py +++ b/erpnext/stock/report/item_variant_details/item_variant_details.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): columns = get_columns(filters.item) data = get_data(filters.item) diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py index 2e13aa0b0401..08869af44ae9 100644 --- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py @@ -4,7 +4,8 @@ import frappe from frappe import _ -from frappe.utils import getdate, flt +from frappe.utils import flt, getdate + def execute(filters=None): if not filters: filters = {} diff --git a/erpnext/stock/report/process_loss_report/process_loss_report.py b/erpnext/stock/report/process_loss_report/process_loss_report.py index edaad2ba5b42..5c6a3bb45668 100644 --- a/erpnext/stock/report/process_loss_report/process_loss_report.py +++ b/erpnext/stock/report/process_loss_report/process_loss_report.py @@ -1,9 +1,10 @@ # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt +from typing import Dict, List, Tuple + import frappe from frappe import _ -from typing import Dict, List, Tuple Filters = frappe._dict Row = frappe._dict diff --git a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py index 8fffbccab3c3..2e298e7da4da 100644 --- a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py +++ b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py @@ -2,12 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt -from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition from six import iteritems +from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition + def execute(filters=None): if not filters: diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py index 0d96ea6aa8ec..4703d2bb7746 100644 --- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.controllers.trends import get_columns,get_data + +from erpnext.controllers.trends import get_columns, get_data + def execute(filters=None): if not filters: filters ={} diff --git a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py index cc3aa3522d8f..c0ed09c54bc2 100644 --- a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py +++ b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py @@ -2,9 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe import _ -from erpnext.stock.stock_ledger import get_stock_ledger_entries + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.stock_ledger import get_stock_ledger_entries + def execute(filters=None): columns = get_columns(filters) diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py index 11d50cd12a50..b4eca0ba96a2 100644 --- a/erpnext/stock/report/stock_ageing/stock_ageing.py +++ b/erpnext/stock/report/stock_ageing/stock_ageing.py @@ -2,13 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +from operator import itemgetter + import frappe from frappe import _ -from operator import itemgetter -from frappe.utils import date_diff, flt, cint +from frappe.utils import cint, date_diff, flt from six import iteritems + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos + def execute(filters=None): columns = get_columns(filters) item_details = get_fifo_queue(filters) diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.py b/erpnext/stock/report/stock_analytics/stock_analytics.py index a1e1e7fce7c4..ddc831037bf9 100644 --- a/erpnext/stock/report/stock_analytics/stock_analytics.py +++ b/erpnext/stock/report/stock_analytics/stock_analytics.py @@ -4,13 +4,18 @@ import frappe from frappe import _, scrub -from frappe.utils import getdate, get_quarter_start, get_first_day_of_week from frappe.utils import get_first_day as get_first_day_of_month +from frappe.utils import get_first_day_of_week, get_quarter_start, getdate -from erpnext.stock.report.stock_balance.stock_balance import (get_items, get_stock_ledger_entries, get_item_details) from erpnext.accounts.utils import get_fiscal_year +from erpnext.stock.report.stock_balance.stock_balance import ( + get_item_details, + get_items, + get_stock_ledger_entries, +) from erpnext.stock.utils import is_reposting_item_valuation_in_progress + def execute(filters=None): is_reposting_item_valuation_in_progress() filters = frappe._dict(filters or {}) diff --git a/erpnext/stock/report/stock_analytics/test_stock_analytics.py b/erpnext/stock/report/stock_analytics/test_stock_analytics.py index 00e268b4e0e3..21e1205bfccc 100644 --- a/erpnext/stock/report/stock_analytics/test_stock_analytics.py +++ b/erpnext/stock/report/stock_analytics/test_stock_analytics.py @@ -2,8 +2,8 @@ import unittest from frappe import _dict -from erpnext.accounts.utils import get_fiscal_year +from erpnext.accounts.utils import get_fiscal_year from erpnext.stock.report.stock_analytics.stock_analytics import get_period_date_ranges diff --git a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.py b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.py index 7e0c0e8ab354..f64774a20a8a 100644 --- a/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.py +++ b/erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.py @@ -2,12 +2,15 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, erpnext + +import frappe from frappe import _ -from erpnext.accounts.utils import get_stock_accounts -from erpnext.accounts.utils import get_currency_precision + +import erpnext +from erpnext.accounts.utils import get_currency_precision, get_stock_accounts from erpnext.stock.doctype.warehouse.warehouse import get_warehouses_based_on_account + def execute(filters=None): if not erpnext.is_perpetual_inventory_enabled(filters.company): frappe.throw(_("Perpetual inventory required for the company {0} to view this report.") diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index f530ac240eea..7dd966eb0527 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -2,16 +2,19 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + from operator import itemgetter -import frappe, erpnext + +import frappe from frappe import _ -from frappe.utils import flt, cint, getdate, now, date_diff -from erpnext.stock.utils import add_additional_uom_columns +from frappe.utils import cint, date_diff, flt, getdate, now +from six import iteritems + +import erpnext +from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition -from erpnext.stock.utils import is_reposting_item_valuation_in_progress -from erpnext.stock.report.stock_ageing.stock_ageing import get_fifo_queue, get_average_age +from erpnext.stock.utils import add_additional_uom_columns, is_reposting_item_valuation_in_progress -from six import iteritems def execute(filters=None): is_reposting_item_valuation_in_progress() diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py index b6923e97c4f1..1ea58fed191c 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.py +++ b/erpnext/stock/report/stock_ledger/stock_ledger.py @@ -4,10 +4,15 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, flt -from erpnext.stock.utils import update_included_uom_in_report, is_reposting_item_valuation_in_progress from frappe import _ +from frappe.utils import cint, flt + from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.utils import ( + is_reposting_item_valuation_in_progress, + update_included_uom_in_report, +) + def execute(filters=None): is_reposting_item_valuation_in_progress() diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py index 7956f2e8648e..16f7c305a3cd 100644 --- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py +++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py @@ -2,11 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt, today -from erpnext.stock.utils import update_included_uom_in_report, is_reposting_item_valuation_in_progress + from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_pos_reserved_qty +from erpnext.stock.utils import ( + is_reposting_item_valuation_in_progress, + update_included_uom_in_report, +) + def execute(filters=None): is_reposting_item_valuation_in_progress() diff --git a/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.py b/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.py index fa19eeba58b0..5580636703ef 100644 --- a/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.py +++ b/erpnext/stock/report/stock_qty_vs_serial_no_count/stock_qty_vs_serial_no_count.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): validate_warehouse(filters) columns = get_columns() diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py index 4108a5755429..f15557b00bf5 100644 --- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py +++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py @@ -2,11 +2,13 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt from six import iteritems + def execute(filters=None): columns = get_columns(filters) consumed_details = get_consumed_details(filters) diff --git a/erpnext/stock/report/total_stock_summary/total_stock_summary.py b/erpnext/stock/report/total_stock_summary/total_stock_summary.py index 59c253c425bc..779b5aabdbc8 100644 --- a/erpnext/stock/report/total_stock_summary/total_stock_summary.py +++ b/erpnext/stock/report/total_stock_summary/total_stock_summary.py @@ -2,9 +2,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ + def execute(filters=None): if not filters: filters = {} validate_filters(filters) diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py index 04f7d347ba83..9ae316fd1960 100644 --- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py +++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py @@ -5,15 +5,23 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import flt, cint, getdate -from erpnext.stock.report.stock_balance.stock_balance import (get_item_details, - get_item_reorder_details, get_item_warehouse_map, get_items, get_stock_ledger_entries) -from erpnext.stock.report.stock_ageing.stock_ageing import get_fifo_queue, get_average_age -from erpnext.stock.utils import is_reposting_item_valuation_in_progress +from frappe.utils import cint, flt, getdate from six import iteritems +from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue +from erpnext.stock.report.stock_balance.stock_balance import ( + get_item_details, + get_item_reorder_details, + get_item_warehouse_map, + get_items, + get_stock_ledger_entries, +) +from erpnext.stock.utils import is_reposting_item_valuation_in_progress + + def execute(filters=None): is_reposting_item_valuation_in_progress() if not filters: filters = {} diff --git a/erpnext/stock/stock_balance.py b/erpnext/stock/stock_balance.py index e5819d6bef79..6a8c5b8bdb00 100644 --- a/erpnext/stock/stock_balance.py +++ b/erpnext/stock/stock_balance.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import print_function, unicode_literals + import frappe -from frappe.utils import flt, cstr, nowdate, nowtime -from erpnext.stock.utils import update_bin -from erpnext.stock.stock_ledger import update_entries_after +from frappe.utils import cstr, flt, nowdate, nowtime + from erpnext.controllers.stock_controller import create_repost_item_valuation_entry +from erpnext.stock.stock_ledger import update_entries_after +from erpnext.stock.utils import update_bin + def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False, only_bin=False): """ diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index e98df737cb7f..6f98e314e2ac 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -2,17 +2,22 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe -import erpnext import copy +import json + +import frappe from frappe import _ -from frappe.utils import cint, flt, cstr, now, get_link_to_form, getdate from frappe.model.meta import get_field_precision -from erpnext.stock.utils import get_valuation_method, get_incoming_outgoing_rate_for_cancel -from erpnext.stock.utils import get_bin -import json +from frappe.utils import cint, cstr, flt, get_link_to_form, getdate, now from six import iteritems +import erpnext +from erpnext.stock.utils import ( + get_bin, + get_incoming_outgoing_rate_for_cancel, + get_valuation_method, +) + # future reposting class NegativeStockError(frappe.ValidationError): pass @@ -470,7 +475,9 @@ def get_incoming_outgoing_rate_from_transaction(self, sle): # Sales and Purchase Return elif sle.voucher_type in ("Purchase Receipt", "Purchase Invoice", "Delivery Note", "Sales Invoice"): if frappe.get_cached_value(sle.voucher_type, sle.voucher_no, "is_return"): - from erpnext.controllers.sales_and_purchase_return import get_rate_for_return # don't move this import to top + from erpnext.controllers.sales_and_purchase_return import ( + get_rate_for_return, # don't move this import to top + ) rate = get_rate_for_return(sle.voucher_type, sle.voucher_no, sle.item_code, voucher_detail_no=sle.voucher_detail_no, sle = sle) else: diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 9f6d0a8addd8..aeb06e987f8a 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -2,13 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext -from frappe import _ + import json -from frappe.utils import flt, cstr, nowdate, nowtime, get_link_to_form +import frappe +from frappe import _ +from frappe.utils import cstr, flt, get_link_to_form, nowdate, nowtime from six import string_types +import erpnext + + class InvalidWarehouseCompany(frappe.ValidationError): pass def get_stock_value_from_bin(warehouse=None, item_code=None): diff --git a/erpnext/support/__init__.py b/erpnext/support/__init__.py index cc26c14433c3..bd1b3f88adce 100644 --- a/erpnext/support/__init__.py +++ b/erpnext/support/__init__.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + install_docs = [ {'doctype':'Role', 'role_name':'Support Team', 'name':'Support Team'}, {'doctype':'Role', 'role_name':'Maintenance User', 'name':'Maintenance User'}, diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index 410ed4c3b6ce..272e3be26484 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -2,17 +2,33 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json +from datetime import datetime, timedelta + +import frappe from frappe import _ -from frappe.model.document import Document -from frappe.utils import now_datetime, time_diff_in_seconds, get_datetime, date_diff, get_weekdays, add_to_date, cint, getdate, get_time from frappe.core.utils import get_parent_doc -from datetime import timedelta, datetime +from frappe.email.inbox import link_communication_to_document +from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc +from frappe.utils import ( + add_to_date, + cint, + date_diff, + get_datetime, + get_time, + get_weekdays, + getdate, + now_datetime, + time_diff_in_seconds, +) from frappe.utils.user import is_website_user -from erpnext.support.doctype.service_level_agreement.service_level_agreement import get_active_service_level_agreement_for -from frappe.email.inbox import link_communication_to_document + +from erpnext.support.doctype.service_level_agreement.service_level_agreement import ( + get_active_service_level_agreement_for, +) + class Issue(Document): def get_feed(self): diff --git a/erpnext/support/doctype/issue/test_issue.py b/erpnext/support/doctype/issue/test_issue.py index 3aee5fece9ce..7de5b9abb915 100644 --- a/erpnext/support/doctype/issue/test_issue.py +++ b/erpnext/support/doctype/issue/test_issue.py @@ -2,11 +2,16 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import create_service_level_agreements_for_issues + +import frappe from frappe.core.doctype.user_permission.test_user_permission import create_user -from frappe.utils import get_datetime, flt +from frappe.utils import flt, get_datetime + +from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import ( + create_service_level_agreements_for_issues, +) + class TestSetUp(unittest.TestCase): def setUp(self): diff --git a/erpnext/support/doctype/issue_priority/issue_priority.py b/erpnext/support/doctype/issue_priority/issue_priority.py index 514b6cc26ba8..f7b97e02a128 100644 --- a/erpnext/support/doctype/issue_priority/issue_priority.py +++ b/erpnext/support/doctype/issue_priority/issue_priority.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.model.document import Document + class IssuePriority(Document): pass diff --git a/erpnext/support/doctype/issue_priority/test_issue_priority.py b/erpnext/support/doctype/issue_priority/test_issue_priority.py index 618c93ea9d80..fc9ae687c939 100644 --- a/erpnext/support/doctype/issue_priority/test_issue_priority.py +++ b/erpnext/support/doctype/issue_priority/test_issue_priority.py @@ -3,9 +3,11 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestIssuePriority(unittest.TestCase): def test_priorities(self): diff --git a/erpnext/support/doctype/issue_type/issue_type.py b/erpnext/support/doctype/issue_type/issue_type.py index f95d09cbf3e5..e74ea53a8b6d 100644 --- a/erpnext/support/doctype/issue_type/issue_type.py +++ b/erpnext/support/doctype/issue_type/issue_type.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class IssueType(Document): pass diff --git a/erpnext/support/doctype/issue_type/test_issue_type.py b/erpnext/support/doctype/issue_type/test_issue_type.py index 4e3b66a8a4d5..225473915ea4 100644 --- a/erpnext/support/doctype/issue_type/test_issue_type.py +++ b/erpnext/support/doctype/issue_type/test_issue_type.py @@ -3,8 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + + class TestIssueType(unittest.TestCase): pass diff --git a/erpnext/support/doctype/pause_sla_on_status/pause_sla_on_status.py b/erpnext/support/doctype/pause_sla_on_status/pause_sla_on_status.py index a3b547e48013..37c1f2bff7de 100644 --- a/erpnext/support/doctype/pause_sla_on_status/pause_sla_on_status.py +++ b/erpnext/support/doctype/pause_sla_on_status/pause_sla_on_status.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class PauseSLAOnStatus(Document): pass diff --git a/erpnext/support/doctype/service_day/service_day.py b/erpnext/support/doctype/service_day/service_day.py index 3805b5aa390e..da96cad41720 100644 --- a/erpnext/support/doctype/service_day/service_day.py +++ b/erpnext/support/doctype/service_day/service_day.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ServiceDay(Document): pass diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py index 11812426d678..0c292d258303 100644 --- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py +++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py @@ -5,11 +5,12 @@ from __future__ import unicode_literals import frappe -from frappe.model.document import Document from frappe import _ -from frappe.utils import getdate, get_weekdays, get_link_to_form, nowdate +from frappe.model.document import Document +from frappe.utils import get_link_to_form, get_weekdays, getdate, nowdate from frappe.utils.safe_exec import get_safe_globals + class ServiceLevelAgreement(Document): def validate(self): diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement_dashboard.py b/erpnext/support/doctype/service_level_agreement/service_level_agreement_dashboard.py index 7e7a405d6e73..22e2c374e125 100644 --- a/erpnext/support/doctype/service_level_agreement/service_level_agreement_dashboard.py +++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement_dashboard.py @@ -1,5 +1,6 @@ from frappe import _ + def get_data(): return { 'fieldname': 'service_level_agreement', diff --git a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py index fe5a2416dab1..824ce0519064 100644 --- a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py +++ b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py @@ -3,11 +3,14 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest + +import frappe + from erpnext.hr.doctype.employee_group.test_employee_group import make_employee_group from erpnext.support.doctype.issue_priority.test_issue_priority import make_priorities + class TestServiceLevelAgreement(unittest.TestCase): def setUp(self): frappe.db.sql("delete from `tabService Level Agreement`") diff --git a/erpnext/support/doctype/service_level_priority/service_level_priority.py b/erpnext/support/doctype/service_level_priority/service_level_priority.py index 0c0fe4a0669d..3b2d124a692b 100644 --- a/erpnext/support/doctype/service_level_priority/service_level_priority.py +++ b/erpnext/support/doctype/service_level_priority/service_level_priority.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class ServiceLevelPriority(Document): pass diff --git a/erpnext/support/doctype/support_search_source/support_search_source.py b/erpnext/support/doctype/support_search_source/support_search_source.py index 93e503a43662..50f4714f7311 100644 --- a/erpnext/support/doctype/support_search_source/support_search_source.py +++ b/erpnext/support/doctype/support_search_source/support_search_source.py @@ -3,7 +3,9 @@ # For license information, please see license.txt from __future__ import unicode_literals + from frappe.model.document import Document + class SupportSearchSource(Document): pass diff --git a/erpnext/support/doctype/support_settings/support_settings.py b/erpnext/support/doctype/support_settings/support_settings.py index bb3c53ab6db3..1d06f88cbbde 100644 --- a/erpnext/support/doctype/support_settings/support_settings.py +++ b/erpnext/support/doctype/support_settings/support_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class SupportSettings(Document): pass diff --git a/erpnext/support/doctype/support_settings/test_support_settings.py b/erpnext/support/doctype/support_settings/test_support_settings.py index 9c47f968119e..e9ec070b3aaf 100644 --- a/erpnext/support/doctype/support_settings/test_support_settings.py +++ b/erpnext/support/doctype/support_settings/test_support_settings.py @@ -5,5 +5,6 @@ import unittest + class TestSupportSettings(unittest.TestCase): pass diff --git a/erpnext/support/doctype/warranty_claim/test_warranty_claim.py b/erpnext/support/doctype/warranty_claim/test_warranty_claim.py index 909675a0d51e..dac8f034c30b 100644 --- a/erpnext/support/doctype/warranty_claim/test_warranty_claim.py +++ b/erpnext/support/doctype/warranty_claim/test_warranty_claim.py @@ -2,9 +2,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + test_records = frappe.get_test_records('Warranty Claim') class TestWarrantyClaim(unittest.TestCase): diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.py b/erpnext/support/doctype/warranty_claim/warranty_claim.py index a20e7a801b07..224a5927f1e6 100644 --- a/erpnext/support/doctype/warranty_claim/warranty_claim.py +++ b/erpnext/support/doctype/warranty_claim/warranty_claim.py @@ -3,14 +3,14 @@ from __future__ import unicode_literals -import frappe -from frappe import session, _ -from frappe.utils import today, now_datetime - +import frappe +from frappe import _, session +from frappe.utils import now_datetime, today from erpnext.utilities.transaction_base import TransactionBase + class WarrantyClaim(TransactionBase): def get_feed(self): return _("{0}: From {1}").format(self.status, self.customer_name) diff --git a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py index 69bf2730d35f..cb7a8a629e50 100644 --- a/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py +++ b/erpnext/support/report/first_response_time_for_issues/first_response_time_for_issues.py @@ -2,8 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe + def execute(filters=None): columns = [ { diff --git a/erpnext/support/report/issue_analytics/issue_analytics.py b/erpnext/support/report/issue_analytics/issue_analytics.py index 54fce0b35928..ac8bce104fa0 100644 --- a/erpnext/support/report/issue_analytics/issue_analytics.py +++ b/erpnext/support/report/issue_analytics/issue_analytics.py @@ -2,13 +2,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json -from six import iteritems + +import frappe from frappe import _, scrub -from frappe.utils import getdate, flt, add_to_date, add_days +from frappe.utils import add_days, add_to_date, flt, getdate +from six import iteritems + from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): return IssueAnalytics(filters).run() @@ -103,7 +107,7 @@ def get_period(self, date): return period def get_period_date_ranges(self): - from dateutil.relativedelta import relativedelta, MO + from dateutil.relativedelta import MO, relativedelta from_date, to_date = getdate(self.filters.from_date), getdate(self.filters.to_date) increment = { diff --git a/erpnext/support/report/issue_analytics/test_issue_analytics.py b/erpnext/support/report/issue_analytics/test_issue_analytics.py index a9d961a4592b..1de03ab28dcf 100644 --- a/erpnext/support/report/issue_analytics/test_issue_analytics.py +++ b/erpnext/support/report/issue_analytics/test_issue_analytics.py @@ -1,11 +1,16 @@ from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import getdate, add_months -from erpnext.support.report.issue_analytics.issue_analytics import execute -from erpnext.support.doctype.issue.test_issue import make_issue, create_customer -from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import create_service_level_agreements_for_issues from frappe.desk.form.assign_to import add as add_assignment +from frappe.utils import add_months, getdate + +from erpnext.support.doctype.issue.test_issue import create_customer, make_issue +from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import ( + create_service_level_agreements_for_issues, +) +from erpnext.support.report.issue_analytics.issue_analytics import execute months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] diff --git a/erpnext/support/report/issue_summary/issue_summary.py b/erpnext/support/report/issue_summary/issue_summary.py index 7c4af39f1040..048199660955 100644 --- a/erpnext/support/report/issue_summary/issue_summary.py +++ b/erpnext/support/report/issue_summary/issue_summary.py @@ -2,11 +2,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import json -from six import iteritems + +import frappe from frappe import _, scrub from frappe.utils import flt +from six import iteritems + def execute(filters=None): return IssueSummary(filters).run() diff --git a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py index 08802b4f5ea5..c0bec3c95520 100644 --- a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py +++ b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py @@ -2,9 +2,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.utils import add_to_date, getdate, get_datetime +from frappe.utils import add_to_date, get_datetime, getdate from six import iteritems time_slots = { diff --git a/erpnext/support/web_form/issues/issues.py b/erpnext/support/web_form/issues/issues.py index 2334f8b26d84..d252f49b06b9 100644 --- a/erpnext/support/web_form/issues/issues.py +++ b/erpnext/support/web_form/issues/issues.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here pass diff --git a/erpnext/telephony/doctype/call_log/call_log.py b/erpnext/telephony/doctype/call_log/call_log.py index 6f8e41169567..0c1ea1657a70 100644 --- a/erpnext/telephony/doctype/call_log/call_log.py +++ b/erpnext/telephony/doctype/call_log/call_log.py @@ -3,14 +3,15 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from frappe.model.document import Document -from erpnext.crm.doctype.utils import get_scheduled_employees_for_popup, strip_number from frappe.contacts.doctype.contact.contact import get_contact_with_phone_number from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links +from frappe.model.document import Document from erpnext.crm.doctype.lead.lead import get_lead_with_phone_number +from erpnext.crm.doctype.utils import get_scheduled_employees_for_popup, strip_number END_CALL_STATUSES = ['No Answer', 'Completed', 'Busy', 'Failed'] ONGOING_CALL_STATUSES = ['Ringing', 'In Progress'] diff --git a/erpnext/telephony/doctype/call_log/test_call_log.py b/erpnext/telephony/doctype/call_log/test_call_log.py index faa63041ba34..f8d458d5415e 100644 --- a/erpnext/telephony/doctype/call_log/test_call_log.py +++ b/erpnext/telephony/doctype/call_log/test_call_log.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestCallLog(unittest.TestCase): pass diff --git a/erpnext/telephony/doctype/incoming_call_handling_schedule/incoming_call_handling_schedule.py b/erpnext/telephony/doctype/incoming_call_handling_schedule/incoming_call_handling_schedule.py index fcf29745e2b8..f48c808331d4 100644 --- a/erpnext/telephony/doctype/incoming_call_handling_schedule/incoming_call_handling_schedule.py +++ b/erpnext/telephony/doctype/incoming_call_handling_schedule/incoming_call_handling_schedule.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class IncomingCallHandlingSchedule(Document): pass diff --git a/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.py b/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.py index 2b2008a8ab7d..faeff9024da1 100644 --- a/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.py +++ b/erpnext/telephony/doctype/incoming_call_settings/incoming_call_settings.py @@ -3,11 +3,14 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe.model.document import Document + from datetime import datetime from typing import Tuple + +import frappe from frappe import _ +from frappe.model.document import Document + class IncomingCallSettings(Document): def validate(self): diff --git a/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py b/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py index c058c117b32c..243e3d9aeaba 100644 --- a/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py +++ b/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestIncomingCallSettings(unittest.TestCase): pass diff --git a/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py b/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py index 85d6adda093f..810b717ae613 100644 --- a/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py +++ b/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestVoiceCallSettings(unittest.TestCase): pass diff --git a/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.py b/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.py index ad3bbf1784d8..fc0e338c15ec 100644 --- a/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.py +++ b/erpnext/telephony/doctype/voice_call_settings/voice_call_settings.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class VoiceCallSettings(Document): pass diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py index 30b03575785e..5cf208711a2a 100644 --- a/erpnext/templates/pages/cart.py +++ b/erpnext/templates/pages/cart.py @@ -5,7 +5,9 @@ no_cache = 1 import frappe + from erpnext.shopping_cart.cart import get_cart_quotation + def get_context(context): context.update(get_cart_quotation()) diff --git a/erpnext/templates/pages/courses.py b/erpnext/templates/pages/courses.py index 92c38f6fcae9..7eb01351eae3 100644 --- a/erpnext/templates/pages/courses.py +++ b/erpnext/templates/pages/courses.py @@ -2,8 +2,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe def get_context(context): diff --git a/erpnext/templates/pages/help.py b/erpnext/templates/pages/help.py index 4ce2b31d306c..366b2835e2ef 100644 --- a/erpnext/templates/pages/help.py +++ b/erpnext/templates/pages/help.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals -import frappe, json +import json + +import frappe import requests + def get_context(context): context.no_cache = 1 settings = frappe.get_doc("Support Settings", "Support Settings") diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py index 1c14450b4738..97a66fc4bbea 100644 --- a/erpnext/templates/pages/home.py +++ b/erpnext/templates/pages/home.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe no_cache = 1 diff --git a/erpnext/templates/pages/integrations/gocardless_checkout.py b/erpnext/templates/pages/integrations/gocardless_checkout.py index bdef79cfbedf..2661a966c756 100644 --- a/erpnext/templates/pages/integrations/gocardless_checkout.py +++ b/erpnext/templates/pages/integrations/gocardless_checkout.py @@ -1,12 +1,17 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + +import json + import frappe from frappe import _ -from frappe.utils import flt -import json -from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import gocardless_initialization, get_gateway_controller -from frappe.utils import get_url +from frappe.utils import flt, get_url + +from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import ( + get_gateway_controller, + gocardless_initialization, +) no_cache = 1 diff --git a/erpnext/templates/pages/integrations/gocardless_confirmation.py b/erpnext/templates/pages/integrations/gocardless_confirmation.py index 0b72e9f8b607..35c8b90bc9e5 100644 --- a/erpnext/templates/pages/integrations/gocardless_confirmation.py +++ b/erpnext/templates/pages/integrations/gocardless_confirmation.py @@ -1,9 +1,14 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ -from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import gocardless_initialization, get_gateway_controller + +from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import ( + get_gateway_controller, + gocardless_initialization, +) no_cache = 1 diff --git a/erpnext/templates/pages/material_request_info.py b/erpnext/templates/pages/material_request_info.py index e29860ddd67e..c18e201487fc 100644 --- a/erpnext/templates/pages/material_request_info.py +++ b/erpnext/templates/pages/material_request_info.py @@ -2,11 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ - from frappe.utils import flt + def get_context(context): context.no_cache = 1 context.show_sidebar = True diff --git a/erpnext/templates/pages/non_profit/join_chapter.py b/erpnext/templates/pages/non_profit/join_chapter.py index aa54a58eeb1e..a1d1893c643a 100644 --- a/erpnext/templates/pages/non_profit/join_chapter.py +++ b/erpnext/templates/pages/non_profit/join_chapter.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def get_context(context): context.no_cache = True chapter = frappe.get_doc('Chapter', frappe.form_dict.name) diff --git a/erpnext/templates/pages/non_profit/leave_chapter.py b/erpnext/templates/pages/non_profit/leave_chapter.py index 21cb722b8840..ebdb6645d499 100644 --- a/erpnext/templates/pages/non_profit/leave_chapter.py +++ b/erpnext/templates/pages/non_profit/leave_chapter.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def get_context(context): context.no_cache = True chapter = frappe.get_doc('Chapter', frappe.form_dict.name) diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index 816a25963f5a..d4e81ab0967a 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -2,10 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe import _ -from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import show_attachments + +from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( + show_attachments, +) + def get_context(context): context.no_cache = 1 @@ -36,7 +40,9 @@ def get_context(context): # check for the loyalty program of the customer customer_loyalty_program = frappe.db.get_value("Customer", context.doc.customer, "loyalty_program") if customer_loyalty_program: - from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points + from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( + get_loyalty_program_details_with_points, + ) loyalty_program_details = get_loyalty_program_details_with_points(context.doc.customer, customer_loyalty_program) context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points")) diff --git a/erpnext/templates/pages/partners.py b/erpnext/templates/pages/partners.py index 6725a3e29480..44a8f8d1dcaf 100644 --- a/erpnext/templates/pages/partners.py +++ b/erpnext/templates/pages/partners.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe import frappe.website.render diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py index 9ab76deff73b..1b9df2b7e7cc 100644 --- a/erpnext/templates/pages/product_search.py +++ b/erpnext/templates/pages/product_search.py @@ -2,8 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe.utils import cstr, nowdate, cint +from frappe.utils import cint, cstr, nowdate + from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html from erpnext.shopping_cart.product_info import set_product_info_for_website diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py index b369cb6a9917..91d0e44e09ce 100644 --- a/erpnext/templates/pages/projects.py +++ b/erpnext/templates/pages/projects.py @@ -2,9 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe + import json +import frappe + + def get_context(context): project_user = frappe.db.get_value("Project User", {"parent": frappe.form_dict.project, "user": frappe.session.user} , ["user", "view_attachments"], as_dict= True) if frappe.session.user != 'Administrator' and (not project_user or frappe.session.user == 'Guest'): diff --git a/erpnext/templates/pages/regional/india/update_gstin.py b/erpnext/templates/pages/regional/india/update_gstin.py index f555db0d72ac..952858786fa4 100644 --- a/erpnext/templates/pages/regional/india/update_gstin.py +++ b/erpnext/templates/pages/regional/india/update_gstin.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals + import frappe from frappe import _ from six import iteritems + def get_context(context): context.no_cache = 1 party = frappe.form_dict.party diff --git a/erpnext/templates/pages/rfq.py b/erpnext/templates/pages/rfq.py index 67679a1a7d3f..b9f646b8a5d5 100644 --- a/erpnext/templates/pages/rfq.py +++ b/erpnext/templates/pages/rfq.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import formatdate + from erpnext.controllers.website_list_for_contact import get_customers_suppliers + def get_context(context): context.no_cache = 1 context.show_sidebar = True diff --git a/erpnext/templates/pages/search_help.py b/erpnext/templates/pages/search_help.py index 887d8f4724e1..4272b94ffb78 100644 --- a/erpnext/templates/pages/search_help.py +++ b/erpnext/templates/pages/search_help.py @@ -1,11 +1,14 @@ from __future__ import unicode_literals -import frappe, requests + +import frappe +import requests from frappe import _ -from jinja2 import utils -from html2text import html2text -from six import text_type from frappe.utils import sanitize_html from frappe.utils.global_search import search +from html2text import html2text +from jinja2 import utils +from six import text_type + def get_context(context): context.no_cache = 1 diff --git a/erpnext/templates/pages/task_info.py b/erpnext/templates/pages/task_info.py index 260e2788cd0d..4942914d376c 100644 --- a/erpnext/templates/pages/task_info.py +++ b/erpnext/templates/pages/task_info.py @@ -1,8 +1,9 @@ from __future__ import unicode_literals -import frappe +import frappe from frappe import _ + def get_context(context): context.no_cache = 1 diff --git a/erpnext/templates/pages/timelog_info.py b/erpnext/templates/pages/timelog_info.py index ee86483fa299..9ffc00bd800c 100644 --- a/erpnext/templates/pages/timelog_info.py +++ b/erpnext/templates/pages/timelog_info.py @@ -1,8 +1,9 @@ from __future__ import unicode_literals -import frappe +import frappe from frappe import _ + def get_context(context): context.no_cache = 1 diff --git a/erpnext/tests/test_init.py b/erpnext/tests/test_init.py index abc04a880840..dfba0340cebc 100644 --- a/erpnext/tests/test_init.py +++ b/erpnext/tests/test_init.py @@ -1,10 +1,12 @@ from __future__ import unicode_literals + import unittest import frappe -from erpnext import encode_company_abbr from six.moves import range +from erpnext import encode_company_abbr + test_records = frappe.get_test_records('Company') class TestInit(unittest.TestCase): diff --git a/erpnext/tests/test_notifications.py b/erpnext/tests/test_notifications.py index 1fd90beef0f7..331f32bf583c 100644 --- a/erpnext/tests/test_notifications.py +++ b/erpnext/tests/test_notifications.py @@ -2,12 +2,14 @@ # MIT License. See license.txt from __future__ import unicode_literals -import frappe + import unittest +import frappe from frappe.desk import notifications from frappe.test_runner import make_test_objects + class TestNotifications(unittest.TestCase): def test_get_notifications_for_targets(self): ''' diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py index 5b3f45a1af78..fe848a355582 100644 --- a/erpnext/tests/test_regional.py +++ b/erpnext/tests/test_regional.py @@ -1,5 +1,11 @@ from __future__ import unicode_literals -import unittest, frappe, erpnext + +import unittest + +import frappe + +import erpnext + @erpnext.allow_regional def test_method(): diff --git a/erpnext/tests/test_search.py b/erpnext/tests/test_search.py index f60e5e4d9835..a6619b278e1e 100644 --- a/erpnext/tests/test_search.py +++ b/erpnext/tests/test_search.py @@ -1,8 +1,11 @@ from __future__ import unicode_literals + import unittest + import frappe from frappe.contacts.address_and_contact import filter_dynamic_link_doctypes + class TestSearch(unittest.TestCase): # Search for the word "cond", part of the word "conduire" (Lead) in french. def test_contact_search_in_foreign_language(self): diff --git a/erpnext/tests/test_subcontracting.py b/erpnext/tests/test_subcontracting.py index f55137bc9cf8..e45f098f65b9 100644 --- a/erpnext/tests/test_subcontracting.py +++ b/erpnext/tests/test_subcontracting.py @@ -1,16 +1,24 @@ from __future__ import unicode_literals -import frappe -import unittest + import copy -from frappe.utils import cint +import unittest from collections import defaultdict -from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos -from erpnext.stock.doctype.item.test_item import make_item -from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom + +import frappe +from frappe.utils import cint + +from erpnext.buying.doctype.purchase_order.purchase_order import ( + get_materials_from_supplier, + make_purchase_invoice, + make_purchase_receipt, + make_rm_stock_entry, +) from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order -from erpnext.buying.doctype.purchase_order.purchase_order import (make_rm_stock_entry, - make_purchase_receipt, make_purchase_invoice, get_materials_from_supplier) +from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom +from erpnext.stock.doctype.item.test_item import make_item +from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + class TestSubcontracting(unittest.TestCase): def setUp(self): diff --git a/erpnext/tests/test_woocommerce.py b/erpnext/tests/test_woocommerce.py index df715ab20271..ce1b0ef77fb9 100644 --- a/erpnext/tests/test_woocommerce.py +++ b/erpnext/tests/test_woocommerce.py @@ -1,7 +1,16 @@ from __future__ import unicode_literals -import unittest, frappe, requests, os, time, erpnext + +import os +import time +import unittest + +import frappe +import requests + +import erpnext from erpnext.erpnext_integrations.connectors.woocommerce_connection import order + class TestWoocommerce(unittest.TestCase): def setUp(self): if not frappe.db.exists('Company', 'Woocommerce'): diff --git a/erpnext/tests/ui_test_helpers.py b/erpnext/tests/ui_test_helpers.py index 902fd64d686d..76c7608c91ff 100644 --- a/erpnext/tests/ui_test_helpers.py +++ b/erpnext/tests/ui_test_helpers.py @@ -1,6 +1,7 @@ import frappe from frappe.utils import getdate + @frappe.whitelist() def create_employee_records(): create_company() diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py index 11eb6afc1fae..2156bd51a4a9 100644 --- a/erpnext/tests/utils.py +++ b/erpnext/tests/utils.py @@ -6,6 +6,7 @@ import frappe + def create_test_contact_and_address(): frappe.db.sql('delete from tabContact') frappe.db.sql('delete from `tabContact Email`') diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py index 0a5aa3c49b86..ca8bc194d4cc 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -1,9 +1,12 @@ ## temp utility from __future__ import print_function, unicode_literals + import frappe -from erpnext.utilities.activation import get_level from frappe.utils import cstr +from erpnext.utilities.activation import get_level + + def update_doctypes(): for d in frappe.db.sql("""select df.parent, df.fieldname from tabDocField df, tabDocType dt where df.fieldname diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 0f9f2f886de3..c21bff0b252b 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -2,11 +2,14 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe, erpnext +import frappe from frappe import _ from six import iteritems +import erpnext + + def get_level(): activation_level = 0 sales_data = [] diff --git a/erpnext/utilities/bot.py b/erpnext/utilities/bot.py index 485b0b3383f9..9e830a20bf83 100644 --- a/erpnext/utilities/bot.py +++ b/erpnext/utilities/bot.py @@ -3,10 +3,10 @@ from __future__ import unicode_literals -from frappe.utils.bot import BotParser - import frappe from frappe import _ +from frappe.utils.bot import BotParser + class FindItemBot(BotParser): def get_reply(self): diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.py b/erpnext/utilities/doctype/rename_tool/rename_tool.py index 5e3ac1a4c92d..8377cecbac35 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.py +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.py @@ -4,11 +4,12 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document from frappe.model.rename_doc import bulk_rename + class RenameTool(Document): pass diff --git a/erpnext/utilities/doctype/sms_log/sms_log.py b/erpnext/utilities/doctype/sms_log/sms_log.py index e634f8059aef..f8426de064de 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.py +++ b/erpnext/utilities/doctype/sms_log/sms_log.py @@ -2,9 +2,10 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -import frappe +import frappe from frappe.model.document import Document + class SMSLog(Document): pass diff --git a/erpnext/utilities/doctype/sms_log/test_sms_log.py b/erpnext/utilities/doctype/sms_log/test_sms_log.py index 65f52b40018d..953486473ac1 100644 --- a/erpnext/utilities/doctype/sms_log/test_sms_log.py +++ b/erpnext/utilities/doctype/sms_log/test_sms_log.py @@ -3,9 +3,10 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest +import frappe + # test_records = frappe.get_test_records('SMS Log') class TestSMSLog(unittest.TestCase): diff --git a/erpnext/utilities/doctype/video/test_video.py b/erpnext/utilities/doctype/video/test_video.py index 33ea31c919e7..530136c6f390 100644 --- a/erpnext/utilities/doctype/video/test_video.py +++ b/erpnext/utilities/doctype/video/test_video.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestVideo(unittest.TestCase): pass diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py index c2e414eef8cd..d9907cf02e2f 100644 --- a/erpnext/utilities/doctype/video/video.py +++ b/erpnext/utilities/doctype/video/video.py @@ -3,14 +3,17 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe + import re +from datetime import datetime + +import frappe import pytz -from frappe.model.document import Document from frappe import _ -from datetime import datetime -from six import string_types +from frappe.model.document import Document from pyyoutube import Api +from six import string_types + class Video(Document): def validate(self): diff --git a/erpnext/utilities/doctype/video_settings/test_video_settings.py b/erpnext/utilities/doctype/video_settings/test_video_settings.py index b217afe3d847..e871435a9303 100644 --- a/erpnext/utilities/doctype/video_settings/test_video_settings.py +++ b/erpnext/utilities/doctype/video_settings/test_video_settings.py @@ -6,5 +6,6 @@ # import frappe import unittest + class TestVideoSettings(unittest.TestCase): pass diff --git a/erpnext/utilities/doctype/video_settings/video_settings.py b/erpnext/utilities/doctype/video_settings/video_settings.py index db021b473a45..72091343b4cc 100644 --- a/erpnext/utilities/doctype/video_settings/video_settings.py +++ b/erpnext/utilities/doctype/video_settings/video_settings.py @@ -3,10 +3,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe +from apiclient.discovery import build from frappe import _ from frappe.model.document import Document -from apiclient.discovery import build + class VideoSettings(Document): def validate(self): diff --git a/erpnext/utilities/hierarchy_chart.py b/erpnext/utilities/hierarchy_chart.py index cc506e5cfda5..0e7f81fb8ee8 100644 --- a/erpnext/utilities/hierarchy_chart.py +++ b/erpnext/utilities/hierarchy_chart.py @@ -2,9 +2,11 @@ # MIT License. See license.txt from __future__ import unicode_literals + import frappe from frappe import _ + @frappe.whitelist() def get_all_nodes(method, company): '''Recursively gets all data from nodes''' diff --git a/erpnext/utilities/product.py b/erpnext/utilities/product.py index f6c53cacd9e7..e567f771e958 100644 --- a/erpnext/utilities/product.py +++ b/erpnext/utilities/product.py @@ -4,10 +4,12 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, fmt_money, flt, nowdate, getdate +from frappe.utils import cint, flt, fmt_money, getdate, nowdate + from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_for_item from erpnext.stock.doctype.batch.batch import get_batch_qty + def get_qty_in_stock(item_code, item_warehouse_field, warehouse=None): in_stock, stock_qty = 0, '' template_item_code, is_stock_item = frappe.db.get_value("Item", item_code, ["variant_of", "is_stock_item"]) diff --git a/erpnext/utilities/report/youtube_interactions/youtube_interactions.py b/erpnext/utilities/report/youtube_interactions/youtube_interactions.py index 29a489ddcc74..50f3b6856492 100644 --- a/erpnext/utilities/report/youtube_interactions/youtube_interactions.py +++ b/erpnext/utilities/report/youtube_interactions/youtube_interactions.py @@ -2,10 +2,12 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe import _ from frappe.utils import flt + def execute(filters=None): if not frappe.db.get_single_value("Video Settings", "enable_youtube_tracking") or not filters: return [], [] diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index db997263c1a5..3fc1596ed2a3 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -2,13 +2,25 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe import frappe.share from frappe import _ -from frappe.utils import cstr, now_datetime, cint, flt, get_time, get_datetime, get_link_to_form, date_diff, nowdate +from frappe.utils import ( + cint, + cstr, + date_diff, + flt, + get_datetime, + get_link_to_form, + get_time, + now_datetime, + nowdate, +) +from six import string_types + from erpnext.controllers.status_updater import StatusUpdater -from six import string_types class UOMMustBeIntegerError(frappe.ValidationError): pass diff --git a/erpnext/utilities/web_form/addresses/addresses.py b/erpnext/utilities/web_form/addresses/addresses.py index 3fd10175fb0f..1a7d5d6095f2 100644 --- a/erpnext/utilities/web_form/addresses/addresses.py +++ b/erpnext/utilities/web_form/addresses/addresses.py @@ -2,6 +2,7 @@ import frappe + def get_context(context): # do your magic here context.show_sidebar = True diff --git a/erpnext/www/all-products/index.py b/erpnext/www/all-products/index.py index fd6400f48cfb..292960697bc8 100644 --- a/erpnext/www/all-products/index.py +++ b/erpnext/www/all-products/index.py @@ -1,8 +1,13 @@ import frappe -from erpnext.portal.product_configurator.utils import (get_products_for_website, get_product_settings, - get_field_filter_data, get_attribute_filter_data) -from erpnext.shopping_cart.product_query import ProductQuery + +from erpnext.portal.product_configurator.utils import ( + get_attribute_filter_data, + get_field_filter_data, + get_product_settings, + get_products_for_website, +) from erpnext.shopping_cart.filters import ProductFiltersBuilder +from erpnext.shopping_cart.product_query import ProductQuery sitemap = 1 diff --git a/erpnext/www/book_appointment/index.py b/erpnext/www/book_appointment/index.py index d805c275bbc6..8cda3c1b90de 100644 --- a/erpnext/www/book_appointment/index.py +++ b/erpnext/www/book_appointment/index.py @@ -1,10 +1,10 @@ -import frappe import datetime import json + +import frappe import pytz from frappe import _ - WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] no_cache = 1 diff --git a/erpnext/www/book_appointment/verify/index.py b/erpnext/www/book_appointment/verify/index.py index bd766c0ea8a3..dc36f4fc9759 100644 --- a/erpnext/www/book_appointment/verify/index.py +++ b/erpnext/www/book_appointment/verify/index.py @@ -1,6 +1,7 @@ import frappe - from frappe.utils.verified_command import verify_request + + @frappe.whitelist(allow_guest=True) def get_context(context): if not verify_request(): diff --git a/erpnext/www/lms/content.py b/erpnext/www/lms/content.py index 05cbb16d3cb8..97f59180d966 100644 --- a/erpnext/www/lms/content.py +++ b/erpnext/www/lms/content.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py index c18d64e50744..1ec097b9070c 100644 --- a/erpnext/www/lms/course.py +++ b/erpnext/www/lms/course.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/lms/index.py b/erpnext/www/lms/index.py index c14b94326b56..c35fff2e2b83 100644 --- a/erpnext/www/lms/index.py +++ b/erpnext/www/lms/index.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/lms/profile.py b/erpnext/www/lms/profile.py index 7e338e38f13c..d5dcd2bf3927 100644 --- a/erpnext/www/lms/profile.py +++ b/erpnext/www/lms/profile.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/lms/program.py b/erpnext/www/lms/program.py index a4f588ccf182..9980d883a9ba 100644 --- a/erpnext/www/lms/program.py +++ b/erpnext/www/lms/program.py @@ -1,8 +1,10 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe from frappe import _ +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/lms/topic.py b/erpnext/www/lms/topic.py index 993828090ce0..ebedaf5edafd 100644 --- a/erpnext/www/lms/topic.py +++ b/erpnext/www/lms/topic.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals -import erpnext.education.utils as utils + import frappe +import erpnext.education.utils as utils + no_cache = 1 def get_context(context): diff --git a/erpnext/www/payment_setup_certification.py b/erpnext/www/payment_setup_certification.py index 6b02e4e0f1ed..e50908388472 100644 --- a/erpnext/www/payment_setup_certification.py +++ b/erpnext/www/payment_setup_certification.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import frappe no_cache = 1 diff --git a/erpnext/www/support/index.py b/erpnext/www/support/index.py index 70090c7805d9..4857b0d829d9 100644 --- a/erpnext/www/support/index.py +++ b/erpnext/www/support/index.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def get_context(context): context.no_cache = 1 context.align_greeting = '' diff --git a/setup.py b/setup.py index a864e73831cd..35c15b4a00de 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from setuptools import setup, find_packages -import re, ast + +import ast +import re + +from setuptools import find_packages, setup # get version from __version__ variable in erpnext/__init__.py _version_re = re.compile(r'__version__\s+=\s+(.*)') From e1e0a5c2157a77ead9d7e6f728fa59e0ebad9a31 Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:44:15 +0530 Subject: [PATCH 03/10] chore: Remove imports with pycln --- .../helper/semgrep_rules/frappe_correctness.py | 2 +- erpnext/__init__.py | 1 - .../account_balance_timeline.py | 8 ++------ erpnext/accounts/deferred_revenue.py | 1 - .../accounting_dimension/accounting_dimension.py | 1 - erpnext/accounts/doctype/bank/bank.py | 1 - erpnext/accounts/doctype/bank/test_bank.py | 1 - .../doctype/bank_account/test_bank_account.py | 2 +- .../bank_clearance_detail.py | 1 - .../bank_guarantee/test_bank_guarantee.py | 1 - .../doctype/bank_transaction/bank_transaction.py | 1 - erpnext/accounts/doctype/budget/budget.py | 2 +- .../doctype/budget_account/budget_account.py | 1 - erpnext/accounts/doctype/c_form/test_c_form.py | 1 - .../c_form_invoice_detail.py | 1 - .../doctype/cashier_closing/cashier_closing.py | 4 ++-- .../cashier_closing/test_cashier_closing.py | 1 - .../cashier_closing_payments.py | 1 - .../test_chart_of_accounts_importer.py | 1 - .../test_cheque_print_template.py | 1 - .../doctype/closed_document/closed_document.py | 1 - .../accounts/doctype/cost_center/cost_center.py | 2 +- .../doctype/coupon_code/test_coupon_code.py | 2 -- erpnext/accounts/doctype/dunning/dunning.py | 5 +---- .../test_exchange_rate_revaluation.py | 1 - .../exchange_rate_revaluation_account.py | 1 - .../doctype/finance_book/finance_book.py | 1 - .../fiscal_year_company/fiscal_year_company.py | 1 - erpnext/accounts/doctype/gl_entry/gl_entry.py | 2 +- .../accounts/doctype/gst_account/gst_account.py | 1 - .../item_tax_template/test_item_tax_template.py | 1 - .../item_tax_template_detail.py | 1 - .../doctype/journal_entry/journal_entry.py | 2 +- .../journal_entry_account.py | 1 - .../test_loyalty_point_entry.py | 1 - .../loyalty_point_entry_redemption.py | 1 - .../loyalty_program/loyalty_program_dashboard.py | 1 - .../loyalty_program_collection.py | 1 - .../mode_of_payment/test_mode_of_payment.py | 1 - .../mode_of_payment_account.py | 1 - .../monthly_distribution_percentage.py | 1 - .../opening_invoice_creation_tool_item.py | 1 - .../doctype/party_account/party_account.py | 1 - .../payment_entry_deduction.py | 1 - .../payment_entry_reference.py | 1 - .../payment_gateway_account_dashboard.py | 1 - .../test_payment_gateway_account.py | 1 - .../payment_order/payment_order_dashboard.py | 1 - .../payment_order_reference.py | 1 - .../payment_reconciliation.py | 5 ++--- .../payment_reconciliation_invoice.py | 1 - .../payment_reconciliation_payment.py | 1 - .../payment_terms_template.py | 2 +- .../test_period_closing_voucher.py | 2 +- .../pos_closing_entry/pos_closing_entry.py | 2 -- .../pos_closing_entry/test_pos_closing_entry.py | 1 - .../pos_customer_group/pos_customer_group.py | 1 - .../accounts/doctype/pos_invoice/pos_invoice.py | 2 -- .../pos_invoice_merge_log.py | 1 - .../doctype/pos_item_group/pos_item_group.py | 1 - .../accounts/doctype/pos_profile/pos_profile.py | 2 +- .../doctype/pos_settings/pos_settings.py | 1 - erpnext/accounts/doctype/pricing_rule/utils.py | 1 - .../pricing_rule_brand/pricing_rule_brand.py | 1 - .../pricing_rule_detail/pricing_rule_detail.py | 1 - .../pricing_rule_item_code.py | 1 - .../pricing_rule_item_group.py | 1 - .../process_deferred_accounting.py | 1 - .../process_statement_of_accounts.py | 2 -- .../promotional_scheme/promotional_scheme.py | 2 -- .../promotional_scheme_price_discount.py | 1 - .../promotional_scheme_product_discount.py | 1 - .../doctype/purchase_invoice/purchase_invoice.py | 1 - .../purchase_invoice/test_purchase_invoice.py | 2 -- .../purchase_invoice_advance.py | 1 - .../purchase_invoice_item.py | 1 - .../purchase_taxes_and_charges.py | 1 - .../test_purchase_taxes_and_charges_template.py | 1 - .../salary_component_account.py | 1 - .../doctype/sales_invoice/sales_invoice.py | 6 ++---- .../doctype/sales_invoice/test_sales_invoice.py | 2 +- .../sales_invoice_advance.py | 1 - .../sales_invoice_item/sales_invoice_item.py | 1 - .../sales_invoice_payment.py | 1 - .../sales_invoice_timesheet.py | 1 - .../sales_taxes_and_charges.py | 1 - .../doctype/share_balance/share_balance.py | 1 - .../accounts/doctype/share_type/share_type.py | 1 - .../doctype/share_type/test_share_type.py | 1 - .../accounts/doctype/shareholder/shareholder.py | 1 - .../doctype/shareholder/shareholder_dashboard.py | 1 - .../doctype/shareholder/test_shareholder.py | 1 - .../shipping_rule_condition.py | 1 - .../shipping_rule_country.py | 1 - .../doctype/subscription/test_subscription.py | 6 ++---- .../doctype/tax_category/tax_category.py | 1 - .../doctype/tax_category/test_tax_category.py | 1 - .../accounts/doctype/tax_rule/test_tax_rule.py | 6 ++---- .../tax_withholding_account.py | 1 - .../tax_withholding_category.py | 2 +- .../tax_withholding_category_dashboard.py | 1 - .../test_tax_withholding_category.py | 1 - .../tax_withholding_rate/tax_withholding_rate.py | 1 - erpnext/accounts/general_ledger.py | 2 +- erpnext/accounts/party.py | 2 +- .../report/accounts_payable/accounts_payable.py | 1 - .../accounts_payable_summary.py | 1 - .../accounts_receivable/accounts_receivable.py | 3 +-- .../test_accounts_receivable.py | 1 - .../accounts_receivable_summary.py | 2 +- .../asset_depreciation_ledger.py | 1 - .../consolidated_financial_statement.py | 3 +-- .../customer_ledger_summary.py | 1 - .../delivered_items_to_be_billed.py | 1 - erpnext/accounts/report/financial_statements.py | 1 - .../report/general_ledger/general_ledger.py | 3 +-- .../inactive_sales_items/inactive_sales_items.py | 2 +- .../item_wise_purchase_register.py | 5 ++--- .../item_wise_sales_register.py | 1 - erpnext/accounts/report/non_billed_report.py | 1 - .../accounts/report/pos_register/pos_register.py | 3 +-- .../profitability_analysis.py | 2 +- .../purchase_invoice_trends.py | 1 - .../received_items_to_be_billed.py | 1 - .../sales_invoice_trends/sales_invoice_trends.py | 1 - .../report/share_balance/share_balance.py | 2 +- .../accounts/report/share_ledger/share_ledger.py | 3 +-- .../supplier_ledger_summary.py | 1 - .../tds_payable_monthly/tds_payable_monthly.py | 1 - erpnext/accounts/report/utils.py | 2 +- erpnext/accounts/utils.py | 2 -- .../agriculture_analysis_criteria.py | 1 - .../test_agriculture_analysis_criteria.py | 1 - .../doctype/agriculture_task/agriculture_task.py | 1 - .../agriculture_task/test_agriculture_task.py | 1 - .../doctype/detected_disease/detected_disease.py | 1 - .../fertilizer_content/fertilizer_content.py | 1 - .../doctype/linked_location/linked_location.py | 1 - .../linked_plant_analysis.py | 1 - .../linked_soil_analysis/linked_soil_analysis.py | 1 - .../linked_soil_texture/linked_soil_texture.py | 1 - .../doctype/plant_analysis/plant_analysis.py | 1 - .../plant_analysis/test_plant_analysis.py | 1 - .../plant_analysis_criteria.py | 1 - .../doctype/soil_analysis/test_soil_analysis.py | 1 - .../soil_analysis_criteria.py | 1 - .../soil_texture_criteria.py | 1 - .../water_analysis/test_water_analysis.py | 1 - .../water_analysis_criteria.py | 1 - .../agriculture/doctype/weather/test_weather.py | 1 - .../weather_parameter/weather_parameter.py | 1 - erpnext/assets/dashboard_fixtures.py | 2 +- erpnext/assets/doctype/asset/asset.py | 2 -- .../asset_category_account.py | 1 - .../asset_finance_book/asset_finance_book.py | 1 - .../asset_maintenance_task.py | 1 - .../asset_maintenance_team.py | 1 - .../asset_movement/test_asset_movement.py | 5 +---- .../depreciation_schedule.py | 1 - .../doctype/linked_location/linked_location.py | 1 - erpnext/assets/doctype/location/location.py | 2 -- .../maintenance_team_member.py | 1 - .../fixed_asset_register/fixed_asset_register.py | 2 +- .../purchase_order/test_purchase_order.py | 3 --- .../purchase_order_item_supplied.py | 1 - .../purchase_receipt_item_supplied.py | 1 - .../request_for_quotation.py | 2 +- .../request_for_quotation_dashboard.py | 1 - .../request_for_quotation_item.py | 1 - .../request_for_quotation_supplier.py | 1 - erpnext/buying/doctype/supplier/supplier.py | 7 +++---- .../supplier_quotation/supplier_quotation.py | 2 +- .../test_supplier_quotation.py | 1 - .../supplier_quotation_item.py | 1 - .../purchase_order_trends.py | 1 - .../test_subcontracted_item_to_be_received.py | 1 - erpnext/controllers/accounts_controller.py | 5 ++--- erpnext/controllers/buying_controller.py | 8 -------- erpnext/controllers/print_settings.py | 2 -- erpnext/controllers/queries.py | 2 +- erpnext/controllers/stock_controller.py | 1 - erpnext/controllers/tests/test_mapper.py | 1 - erpnext/crm/doctype/appointment/appointment.py | 4 +--- erpnext/crm/doctype/contract/contract.py | 2 +- .../contract_fulfilment_checklist.py | 1 - .../test_contract_fulfilment_checklist.py | 1 - .../contract_template/test_contract_template.py | 1 - .../contract_template_fulfilment_terms.py | 1 - .../crm/doctype/email_campaign/email_campaign.py | 2 +- erpnext/crm/doctype/lead/lead_dashboard.py | 1 - .../crm/doctype/market_segment/market_segment.py | 1 - .../market_segment/test_market_segment.py | 1 - erpnext/crm/doctype/opportunity/opportunity.py | 2 +- .../doctype/opportunity/opportunity_dashboard.py | 1 - .../doctype/opportunity_item/opportunity_item.py | 1 - .../doctype/opportunity_type/opportunity_type.py | 1 - .../opportunity_type/test_opportunity_type.py | 1 - erpnext/crm/doctype/sales_stage/sales_stage.py | 1 - .../crm/doctype/sales_stage/test_sales_stage.py | 1 - .../doctype/twitter_settings/twitter_settings.py | 3 +-- erpnext/crm/doctype/utils.py | 2 -- .../lead_owner_efficiency.py | 1 - erpnext/demo/setup/retail.py | 3 --- erpnext/demo/user/manufacturing.py | 3 --- .../doctype/academic_term/test_academic_term.py | 1 - .../doctype/academic_year/academic_year.py | 2 +- .../doctype/academic_year/test_academic_year.py | 1 - .../education/doctype/article/test_article.py | 1 - .../test_assessment_criteria.py | 1 - .../assessment_criteria_group.py | 1 - .../test_assessment_criteria_group.py | 1 - .../doctype/assessment_group/assessment_group.py | 1 - .../assessment_group/test_assessment_group.py | 1 - .../assessment_plan/test_assessment_plan.py | 1 - .../assessment_plan_criteria.py | 1 - .../assessment_result/test_assessment_result.py | 1 - .../assessment_result_detail.py | 1 - .../assessment_result_tool.py | 1 - .../test_assessment_result_tool.py | 1 - .../doctype/content_activity/content_activity.py | 1 - .../doctype/content_question/content_question.py | 1 - .../content_question/test_content_question.py | 1 - .../course_assessment_criteria.py | 1 - .../doctype/course_content/course_content.py | 1 - .../course_content/test_course_content.py | 1 - .../course_schedule/test_course_schedule.py | 1 - .../test_course_scheduling_tool.py | 1 - .../doctype/course_topic/course_topic.py | 1 - .../doctype/course_topic/test_course_topic.py | 1 - .../test_education_settings.py | 1 - .../doctype/fee_category/fee_category.py | 1 - .../doctype/fee_category/test_fee_category.py | 1 - .../doctype/fee_component/fee_component.py | 1 - .../doctype/fee_structure/test_fee_structure.py | 1 - erpnext/education/doctype/fees/fees.py | 1 - .../doctype/grading_scale/test_grading_scale.py | 1 - .../grading_scale_interval.py | 1 - .../education/doctype/guardian/test_guardian.py | 1 - .../guardian_interest/guardian_interest.py | 1 - .../doctype/guardian_student/guardian_student.py | 1 - .../doctype/instructor/test_instructor.py | 1 - .../doctype/instructor_log/instructor_log.py | 1 - erpnext/education/doctype/options/options.py | 1 - .../doctype/program_course/program_course.py | 1 - .../program_enrollment/program_enrollment.py | 3 +-- .../test_program_enrollment.py | 1 - .../program_enrollment_course.py | 1 - .../program_enrollment_fee.py | 1 - .../test_program_enrollment_tool.py | 1 - .../program_enrollment_tool_student.py | 1 - .../education/doctype/program_fee/program_fee.py | 1 - .../education/doctype/question/test_question.py | 1 - erpnext/education/doctype/quiz/quiz.py | 1 - erpnext/education/doctype/quiz/test_quiz.py | 1 - .../doctype/quiz_activity/quiz_activity.py | 1 - .../doctype/quiz_activity/test_quiz_activity.py | 1 - .../doctype/quiz_question/quiz_question.py | 1 - .../education/doctype/quiz_result/quiz_result.py | 1 - .../doctype/quiz_result/test_quiz_result.py | 1 - erpnext/education/doctype/room/room.py | 1 - erpnext/education/doctype/room/test_room.py | 1 - .../doctype/school_house/school_house.py | 1 - .../doctype/school_house/test_school_house.py | 1 - .../education/doctype/student/test_student.py | 2 -- .../student_admission/test_student_admission.py | 1 - .../student_applicant/test_student_applicant.py | 1 - .../test_student_attendance.py | 1 - .../test_student_attendance_tool.py | 1 - .../student_batch_name/student_batch_name.py | 1 - .../test_student_batch_name.py | 1 - .../doctype/student_category/student_category.py | 1 - .../student_category/test_student_category.py | 1 - .../test_student_group_creation_tool.py | 1 - .../student_group_creation_tool_course.py | 1 - .../student_group_instructor.py | 1 - .../student_group_student.py | 1 - .../doctype/student_guardian/student_guardian.py | 1 - .../doctype/student_language/student_language.py | 1 - .../student_language/test_student_language.py | 1 - .../education/doctype/student_log/student_log.py | 1 - .../doctype/student_log/test_student_log.py | 1 - .../student_report_generation_tool.py | 1 - .../test_student_report_generation_tool.py | 1 - .../doctype/student_sibling/student_sibling.py | 1 - .../doctype/student_siblings/student_siblings.py | 1 - .../doctype/topic_content/test_topic_content.py | 1 - .../doctype/topic_content/topic_content.py | 1 - .../course_wise_assessment_report.py | 1 - .../student_monthly_attendance_sheet.py | 5 ++--- .../student_applicant/student_applicant.py | 1 - .../amazon_mws_settings/amazon_mws_api.py | 2 -- .../test_quickbooks_migrator.py | 1 - .../doctype/shopify_log/test_shopify_log.py | 1 - .../shopify_tax_account/shopify_tax_account.py | 1 - .../shopify_webhook_detail.py | 1 - .../doctype/tally_migration/tally_migration.py | 1 - .../tally_migration/test_tally_migration.py | 1 - .../clinical_procedure/clinical_procedure.py | 2 +- .../healthcare_practitioner.py | 1 - .../inpatient_medication_entry.py | 2 +- erpnext/healthcare/doctype/lab_test/lab_test.py | 2 +- .../test_patient_appointment.py | 1 - .../patient_encounter/patient_encounter.py | 2 +- .../doctype/therapy_session/therapy_session.py | 2 +- .../doctype/vital_signs/vital_signs.py | 1 - .../page/patient_history/patient_history.py | 1 - .../hotels/doctype/hotel_room/test_hotel_room.py | 1 - .../hotel_room_amenity/hotel_room_amenity.py | 1 - .../test_hotel_room_package.py | 1 - .../hotel_room_pricing/hotel_room_pricing.py | 1 - .../test_hotel_room_pricing.py | 1 - .../hotel_room_pricing_item.py | 1 - .../hotel_room_pricing_package.py | 1 - .../test_hotel_room_pricing_package.py | 1 - .../hotel_room_reservation_item.py | 1 - .../doctype/hotel_room_type/hotel_room_type.py | 1 - .../hotel_room_type/test_hotel_room_type.py | 1 - .../doctype/hotel_settings/hotel_settings.py | 1 - .../hotel_settings/test_hotel_settings.py | 1 - erpnext/hr/doctype/appraisal/test_appraisal.py | 1 - .../hr/doctype/appraisal_goal/appraisal_goal.py | 1 - .../appraisal_template_dashboard.py | 1 - .../test_appraisal_template.py | 1 - .../appraisal_template_goal.py | 1 - erpnext/hr/doctype/attendance/attendance.py | 1 - .../doctype/attendance/attendance_dashboard.py | 1 - erpnext/hr/doctype/branch/branch.py | 1 - .../daily_work_summary/daily_work_summary.py | 1 - .../daily_work_summary_group_user.py | 1 - erpnext/hr/doctype/department/department.py | 1 - erpnext/hr/doctype/designation/designation.py | 1 - .../employee_advance_dashboard.py | 1 - .../employee_boarding_activity.py | 1 - .../doctype/employee_checkin/employee_checkin.py | 2 +- .../employee_checkin/test_employee_checkin.py | 2 +- .../employee_education/employee_education.py | 1 - .../employee_external_work_history.py | 1 - .../hr/doctype/employee_grade/employee_grade.py | 1 - .../employee_grade/test_employee_grade.py | 1 - .../employee_health_insurance.py | 1 - .../test_employee_health_insurance.py | 1 - .../employee_internal_work_history.py | 1 - .../employee_onboarding_activity.py | 1 - .../employee_onboarding_template.py | 1 - .../employee_onboarding_template_dashboard.py | 1 - .../test_employee_onboarding_template.py | 1 - .../employee_property_history.py | 1 - .../employee_separation_template.py | 1 - .../employee_separation_template_dashboard.py | 1 - .../test_employee_separation_template.py | 1 - .../employee_transfer_property.py | 1 - .../test_employee_transfer_property.py | 1 - .../doctype/employment_type/employment_type.py | 1 - .../hr/doctype/expense_claim/expense_claim.py | 6 +----- .../expense_claim_account.py | 1 - .../expense_claim_advance.py | 1 - .../expense_claim_detail/expense_claim_detail.py | 1 - .../test_expense_claim_type.py | 1 - erpnext/hr/doctype/holiday/holiday.py | 1 - .../hr/doctype/hr_settings/test_hr_settings.py | 4 ---- .../identification_document_type.py | 1 - .../test_identification_document_type.py | 1 - erpnext/hr/doctype/interest/interest.py | 1 - erpnext/hr/doctype/interest/test_interest.py | 1 - .../job_applicant/job_applicant_dashboard.py | 1 - .../hr/doctype/job_offer_term/job_offer_term.py | 1 - .../doctype/job_opening/job_opening_dashboard.py | 1 - .../hr/doctype/job_opening/test_job_opening.py | 1 - .../doctype/leave_allocation/leave_allocation.py | 2 +- .../leave_allocation_dashboard.py | 1 - .../leave_allocation/test_leave_allocation.py | 3 +-- .../leave_application/test_leave_application.py | 2 +- .../leave_block_list_allow.py | 1 - .../leave_block_list_date.py | 1 - .../leave_control_panel/leave_control_panel.py | 2 +- .../test_leave_control_panel.py | 1 - .../doctype/leave_encashment/leave_encashment.py | 2 +- .../leave_ledger_entry/leave_ledger_entry.py | 2 +- erpnext/hr/doctype/leave_period/leave_period.py | 3 +-- .../leave_policy_assignment.py | 2 +- .../leave_policy_detail/leave_policy_detail.py | 1 - .../test_leave_policy_detail.py | 1 - erpnext/hr/doctype/leave_type/leave_type.py | 2 -- erpnext/hr/doctype/leave_type/test_leave_type.py | 1 - erpnext/hr/doctype/offer_term/offer_term.py | 1 - erpnext/hr/doctype/offer_term/test_offer_term.py | 1 - .../purpose_of_travel/purpose_of_travel.py | 1 - .../purpose_of_travel/test_purpose_of_travel.py | 1 - .../doctype/shift_assignment/shift_assignment.py | 2 +- .../shift_request/shift_request_dashboard.py | 1 - .../doctype/shift_type/shift_type_dashboard.py | 1 - erpnext/hr/doctype/shift_type/test_shift_type.py | 1 - .../staffing_plan/staffing_plan_dashboard.py | 1 - .../staffing_plan_detail/staffing_plan_detail.py | 1 - .../training_event/training_event_dashboard.py | 1 - .../training_event_employee.py | 1 - .../training_result/test_training_result.py | 1 - .../training_result_employee.py | 1 - .../doctype/travel_itinerary/travel_itinerary.py | 1 - .../travel_request/test_travel_request.py | 1 - .../hr/doctype/travel_request/travel_request.py | 1 - .../travel_request_costing.py | 1 - erpnext/hr/doctype/vehicle/test_vehicle.py | 2 +- erpnext/hr/doctype/vehicle_log/vehicle_log.py | 3 +-- .../doctype/vehicle_service/vehicle_service.py | 1 - .../training_feedback/training_feedback.py | 1 - .../training_scheduled/training_scheduled.py | 1 - .../employee_birthday/employee_birthday.py | 1 - .../employee_leave_balance.py | 2 +- .../employee_leave_balance_summary.py | 1 - .../report/vehicle_expenses/vehicle_expenses.py | 1 - .../web_form/job_application/job_application.py | 1 - .../doctype/hub_tracked_item/hub_tracked_item.py | 1 - .../hub_tracked_item/test_hub_tracked_item.py | 1 - erpnext/hub_node/doctype/hub_user/hub_user.py | 1 - erpnext/hub_node/doctype/hub_users/hub_users.py | 1 - .../marketplace_settings/marketplace_settings.py | 8 +------- .../test_marketplace_settings.py | 1 - erpnext/loan_management/doctype/loan/loan.py | 2 +- .../doctype/loan/loan_dashboard.py | 1 - .../loan_management/doctype/loan/test_loan.py | 9 ++------- .../loan_application_dashboard.py | 1 - .../loan_disbursement/loan_disbursement.py | 3 +-- .../loan_interest_accrual.py | 8 ++------ .../test_loan_interest_accrual.py | 6 ++---- .../doctype/loan_repayment/loan_repayment.py | 8 ++------ .../loan_security/loan_security_dashboard.py | 1 - .../loan_security_price/loan_security_price.py | 8 +------- .../loan_security_shortfall.py | 1 - .../loan_security_type_dashboard.py | 1 - .../loan_security_unpledge.py | 4 ---- .../doctype/loan_type/loan_type_dashboard.py | 1 - .../process_loan_interest_accrual_dashboard.py | 1 - .../process_loan_security_shortfall.py | 1 - .../process_loan_security_shortfall_dashboard.py | 1 - .../applicant_wise_loan_security_exposure.py | 2 +- .../maintenance_schedule_detail.py | 1 - .../maintenance_schedule_item.py | 1 - .../maintenance_visit/test_maintenance_visit.py | 1 - .../maintenance_visit_purpose.py | 1 - erpnext/manufacturing/dashboard_fixtures.py | 2 +- .../blanket_order/blanket_order_dashboard.py | 1 - erpnext/manufacturing/doctype/bom/bom.py | 1 - .../bom_explosion_item/bom_explosion_item.py | 1 - .../manufacturing/doctype/bom_item/bom_item.py | 1 - .../doctype/bom_operation/bom_operation.py | 1 - .../doctype/bom_scrap_item/bom_scrap_item.py | 1 - .../doctype/bom_website_item/bom_website_item.py | 1 - .../bom_website_operation.py | 1 - .../doctype/downtime_entry/downtime_entry.py | 1 - .../manufacturing/doctype/job_card/job_card.py | 5 ++--- .../production_plan_item/production_plan_item.py | 1 - .../production_plan_material_request.py | 1 - .../production_plan_sales_order.py | 1 - .../doctype/routing/routing_dashboard.py | 1 - .../doctype/work_order/test_work_order.py | 2 +- .../doctype/work_order/work_order.py | 4 ---- .../work_order_operation/work_order_operation.py | 1 - .../doctype/workstation/workstation.py | 1 - .../workstation_working_hour.py | 1 - .../material_request_receipt_notification.py | 1 - .../report/bom_explorer/bom_explorer.py | 1 - .../exponential_smoothing_forecasting.py | 2 +- .../report/job_card_summary/job_card_summary.py | 2 +- .../certification_application.py | 1 - .../test_certification_application.py | 1 - .../certified_consultant/certified_consultant.py | 1 - .../test_certified_consultant.py | 1 - .../non_profit/doctype/membership/membership.py | 1 - .../doctype/volunteer_skill/volunteer_skill.py | 1 - .../expiring_memberships/expiring_memberships.py | 2 +- .../certification_application.py | 1 - .../certification_application_usd.py | 1 - erpnext/patches/v10_0/delete_hub_documents.py | 1 - erpnext/patches/v11_0/add_market_segments.py | 1 - erpnext/patches/v11_0/add_sales_stages.py | 1 - ...ake_asset_finance_book_against_old_entries.py | 1 - .../v11_0/move_leave_approvers_from_employee.py | 1 - erpnext/patches/v11_0/uom_conversion_data.py | 1 - .../remove_bank_remittance_custom_fields.py | 1 - .../remove_denied_leaves_from_leave_ledger.py | 1 - erpnext/patches/v12_0/set_multi_uom_in_rfq.py | 2 -- ...ed_qty_field_in_sales_order_for_work_order.py | 1 - .../v12_0/update_ewaybill_field_position.py | 1 - .../v12_0/update_price_list_currency_in_bom.py | 2 +- .../v12_0/update_uom_conversion_factor.py | 1 - .../v13_0/add_naming_series_to_old_projects.py | 4 ---- .../item_reposting_for_incorrect_sl_and_gl.py | 1 - ...abs_from_payroll_period_to_income_tax_slab.py | 1 - .../v13_0/print_uom_after_quantity_patch.py | 1 - erpnext/patches/v13_0/set_app_name.py | 1 - erpnext/patches/v13_0/update_old_loans.py | 1 - .../employee_benefit_application.py | 2 +- .../test_employee_incentive.py | 1 - .../employee_tax_exemption_category.py | 1 - .../test_employee_tax_exemption_category.py | 1 - .../employee_tax_exemption_declaration.py | 1 - .../employee_tax_exemption_proof_submission.py | 2 -- .../test_employee_tax_exemption_sub_category.py | 1 - .../payroll_entry/payroll_entry_dashboard.py | 1 - .../payroll_period/payroll_period_dashboard.py | 1 - .../payroll_period/test_payroll_period.py | 1 - .../retention_bonus/test_retention_bonus.py | 1 - .../doctype/salary_detail/salary_detail.py | 1 - .../payroll/doctype/salary_slip/salary_slip.py | 1 - .../doctype/salary_structure/salary_structure.py | 1 - .../salary_structure_dashboard.py | 1 - .../test_salary_structure_assignment.py | 1 - .../retention_bonus/retention_bonus.py | 1 - .../report/bank_remittance/bank_remittance.py | 2 -- .../homepage_featured_product.py | 1 - .../products_settings/test_products_settings.py | 1 - .../test_product_configurator.py | 4 +--- .../doctype/dependent_task/dependent_task.py | 1 - erpnext/projects/doctype/project/project.py | 7 ++----- .../doctype/project_user/project_user.py | 1 - .../projects_settings/projects_settings.py | 1 - .../projects_settings/test_projects_settings.py | 1 - .../doctype/task_depends_on/task_depends_on.py | 1 - .../projects/doctype/task_type/test_task_type.py | 1 - .../projects/doctype/timesheet/test_timesheet.py | 3 +-- erpnext/projects/doctype/timesheet/timesheet.py | 16 ++-------------- .../doctype/timesheet_detail/timesheet_detail.py | 1 - .../employee_billing_summary.py | 1 - .../project_billing_summary.py | 1 - .../doctype/quality_action/quality_action.py | 1 - .../quality_action/test_quality_action.py | 1 - .../test_quality_feedback_template.py | 1 - .../doctype/quality_goal/quality_goal.py | 1 - .../doctype/quality_goal/test_quality_goal.py | 3 --- .../quality_meeting/test_quality_meeting.py | 1 - .../quality_procedure/quality_procedure.py | 2 +- .../doctype/gst_hsn_code/test_gst_hsn_code.py | 1 - .../doctype/gst_settings/test_gst_settings.py | 1 - .../import_supplier_invoice.py | 6 +----- erpnext/regional/france/utils.py | 1 - erpnext/regional/germany/setup.py | 1 - .../regional/germany/utils/datev/datev_csv.py | 1 - erpnext/regional/india/utils.py | 9 ++------- erpnext/regional/italy/utils.py | 1 - erpnext/regional/report/datev/test_datev.py | 5 ++--- erpnext/regional/report/gstr_1/gstr_1.py | 3 +-- .../hsn_wise_summary_of_outward_supplies.py | 1 - erpnext/regional/united_arab_emirates/setup.py | 2 -- .../restaurant/doctype/restaurant/restaurant.py | 1 - .../doctype/restaurant/test_restaurant.py | 1 - .../restaurant_menu_item/restaurant_menu_item.py | 1 - .../restaurant_order_entry_item.py | 1 - .../restaurant_reservation.py | 1 - .../test_restaurant_reservation.py | 1 - .../doctype/restaurant_table/restaurant_table.py | 1 - .../restaurant_table/test_restaurant_table.py | 1 - erpnext/selling/doctype/customer/customer.py | 7 +++---- .../doctype/industry_type/industry_type.py | 1 - .../installation_note/test_installation_note.py | 1 - .../installation_note_item.py | 1 - .../product_bundle_item/product_bundle_item.py | 1 - .../doctype/quotation_item/quotation_item.py | 1 - erpnext/selling/doctype/sales_team/sales_team.py | 1 - .../doctype/selling_settings/selling_settings.py | 1 - .../selling/page/point_of_sale/point_of_sale.py | 1 - .../report/quotation_trends/quotation_trends.py | 1 - .../report/sales_analytics/test_analytics.py | 1 - .../sales_order_trends/sales_order_trends.py | 1 - .../sales_partner_commission_summary.py | 1 - .../item_group_wise_sales_target_variance.py | 1 - ...artner_target_variance_based_on_item_group.py | 1 - .../sales_partner_transaction_summary.py | 1 - .../sales_person_commission_summary.py | 1 - ...person_target_variance_based_on_item_group.py | 1 - .../sales_person_wise_transaction_summary.py | 1 - ...ritory_target_variance_based_on_item_group.py | 1 - .../authorization_rule/authorization_rule.py | 2 +- .../test_authorization_rule.py | 1 - erpnext/setup/doctype/company/company.py | 1 - .../currency_exchange/currency_exchange.py | 1 - .../doctype/email_digest/test_email_digest.py | 1 - .../global_defaults/test_global_defaults.py | 1 - erpnext/setup/doctype/item_group/item_group.py | 1 - .../setup/doctype/party_type/test_party_type.py | 1 - .../setup/doctype/print_heading/print_heading.py | 1 - .../quotation_lost_reason.py | 1 - .../setup/doctype/target_detail/target_detail.py | 1 - erpnext/setup/doctype/uom/uom.py | 1 - .../website_item_group/website_item_group.py | 1 - .../setup/setup_wizard/data/dashboard_charts.py | 1 - .../setup_wizard/operations/company_setup.py | 1 - erpnext/setup/setup_wizard/utils.py | 1 - .../shopping_cart_settings.py | 4 ++-- erpnext/shopping_cart/utils.py | 1 - erpnext/startup/filters.py | 1 - .../warehouse_wise_stock_value.py | 1 - erpnext/stock/doctype/batch/batch.py | 2 +- erpnext/stock/doctype/bin/bin.py | 1 - erpnext/stock/doctype/bin/test_bin.py | 1 - .../customs_tariff_number.py | 1 - .../test_customs_tariff_number.py | 1 - .../stock/doctype/delivery_note/delivery_note.py | 1 - .../doctype/delivery_note/test_delivery_note.py | 1 - .../delivery_note_item/delivery_note_item.py | 1 - .../delivery_settings/delivery_settings.py | 1 - .../delivery_settings/test_delivery_settings.py | 1 - erpnext/stock/doctype/item/item.py | 2 +- .../item_attribute_value/item_attribute_value.py | 1 - .../item_customer_detail/item_customer_detail.py | 1 - .../item_quality_inspection_parameter.py | 1 - .../stock/doctype/item_reorder/item_reorder.py | 1 - .../stock/doctype/item_supplier/item_supplier.py | 1 - erpnext/stock/doctype/item_tax/item_tax.py | 1 - .../stock/doctype/item_variant/item_variant.py | 1 - .../item_variant_attribute.py | 1 - .../item_website_specification.py | 1 - .../doctype/landed_cost_item/landed_cost_item.py | 1 - .../landed_cost_purchase_receipt.py | 1 - .../landed_cost_taxes_and_charges.py | 1 - .../landed_cost_voucher/landed_cost_voucher.py | 1 - .../test_landed_cost_voucher.py | 3 --- .../stock/doctype/manufacturer/manufacturer.py | 4 +--- .../doctype/manufacturer/test_manufacturer.py | 1 - .../doctype/material_request/material_request.py | 4 +--- .../material_request/test_material_request.py | 1 - .../doctype/packing_slip/test_packing_slip.py | 1 - .../packing_slip_item/packing_slip_item.py | 1 - erpnext/stock/doctype/pick_list/pick_list.py | 2 +- .../doctype/pick_list/pick_list_dashboard.py | 1 - erpnext/stock/doctype/price_list/price_list.py | 1 - .../price_list_country/price_list_country.py | 1 - .../doctype/purchase_receipt/purchase_receipt.py | 1 - .../purchase_receipt/test_purchase_receipt.py | 3 +-- .../purchase_receipt_item.py | 1 - .../quality_inspection_reading.py | 1 - .../repost_item_valuation.py | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.py | 1 - .../doctype/stock_entry/test_stock_entry.py | 6 ++---- .../stock_entry_detail/stock_entry_detail.py | 1 - .../stock_entry_type/test_stock_entry_type.py | 1 - .../stock_reconciliation/stock_reconciliation.py | 3 +-- .../stock_reconciliation_item.py | 1 - .../uom_conversion_detail.py | 1 - erpnext/stock/get_item_details.py | 1 - .../batch_item_expiry_status.py | 2 +- erpnext/stock/report/bom_search/bom_search.py | 1 - .../delivery_note_trends/delivery_note_trends.py | 1 - erpnext/stock/report/item_prices/item_prices.py | 2 +- .../purchase_receipt_trends.py | 1 - .../report/serial_no_ledger/serial_no_ledger.py | 1 - .../stock/report/stock_balance/stock_balance.py | 2 +- .../warehouse_wise_item_balance_age_and_value.py | 7 +++---- erpnext/stock/stock_balance.py | 1 - .../doctype/issue_priority/issue_priority.py | 2 -- erpnext/support/doctype/issue_type/issue_type.py | 1 - .../doctype/issue_type/test_issue_type.py | 1 - .../doctype/support_settings/support_settings.py | 1 - .../doctype/warranty_claim/warranty_claim.py | 2 +- erpnext/support/web_form/issues/issues.py | 1 - erpnext/templates/pages/cart.py | 1 - erpnext/templates/pages/partners.py | 1 - erpnext/templates/pages/projects.py | 1 - .../pages/regional/india/update_gstin.py | 1 - erpnext/templates/pages/task_info.py | 1 - erpnext/templates/pages/timelog_info.py | 1 - erpnext/tests/test_notifications.py | 1 - erpnext/tests/test_woocommerce.py | 1 - erpnext/utilities/doctype/sms_log/sms_log.py | 1 - .../utilities/doctype/sms_log/test_sms_log.py | 1 - erpnext/utilities/transaction_base.py | 8 ++------ .../utilities/web_form/addresses/addresses.py | 1 - erpnext/www/all-products/index.py | 5 +---- 668 files changed, 139 insertions(+), 855 deletions(-) diff --git a/.github/helper/semgrep_rules/frappe_correctness.py b/.github/helper/semgrep_rules/frappe_correctness.py index 1cb2b3c45c5f..4373e88451c7 100644 --- a/.github/helper/semgrep_rules/frappe_correctness.py +++ b/.github/helper/semgrep_rules/frappe_correctness.py @@ -1,5 +1,5 @@ import frappe -from frappe import _, flt +from frappe import _ from frappe.model.document import Document diff --git a/erpnext/__init__.py b/erpnext/__init__.py index b123f92706bc..2cdf1bf1829d 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,6 @@ import inspect import frappe -from frappe.utils import getdate from erpnext.hooks import regional_overrides diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index e2e333ae1f71..979b5a381342 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -3,24 +3,20 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ from frappe.utils import ( - add_to_date, - date_diff, + add_to_date, formatdate, - get_last_day, get_link_to_form, getdate, - nowdate, + nowdate ) from frappe.utils.dashboard import cache_source from frappe.utils.dateutils import get_from_date_from_timespan, get_period_ending from frappe.utils.nestedset import get_descendants_of -from erpnext.accounts.report.general_ledger.general_ledger import execute @frappe.whitelist() diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py index 612f962c627c..bcd07718a597 100644 --- a/erpnext/accounts/deferred_revenue.py +++ b/erpnext/accounts/deferred_revenue.py @@ -16,7 +16,6 @@ rounded, today, ) -from frappe.utils.background_jobs import enqueue from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( get_accounting_dimensions, diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py index dbc2167c355c..af8255f94487 100644 --- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py @@ -12,7 +12,6 @@ from frappe.model import core_doctypes_list from frappe.model.document import Document from frappe.utils import cstr -from frappe.utils.background_jobs import enqueue class AccountingDimension(Document): diff --git a/erpnext/accounts/doctype/bank/bank.py b/erpnext/accounts/doctype/bank/bank.py index 1f029eb81060..e1eb984f5f5e 100644 --- a/erpnext/accounts/doctype/bank/bank.py +++ b/erpnext/accounts/doctype/bank/bank.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.contacts.address_and_contact import ( delete_contact_and_address, load_address_and_contact, diff --git a/erpnext/accounts/doctype/bank/test_bank.py b/erpnext/accounts/doctype/bank/test_bank.py index 4d76f77bf523..13713b516380 100644 --- a/erpnext/accounts/doctype/bank/test_bank.py +++ b/erpnext/accounts/doctype/bank/test_bank.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestBank(unittest.TestCase): diff --git a/erpnext/accounts/doctype/bank_account/test_bank_account.py b/erpnext/accounts/doctype/bank_account/test_bank_account.py index 866964bab94e..dc970f3d99e3 100644 --- a/erpnext/accounts/doctype/bank_account/test_bank_account.py +++ b/erpnext/accounts/doctype/bank_account/test_bank_account.py @@ -6,7 +6,7 @@ import unittest import frappe -from frappe import ValidationError, _ +from frappe import ValidationError # test_records = frappe.get_test_records('Bank Account') diff --git a/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py index 2086c968ac6f..1b23400cd379 100644 --- a/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py +++ b/erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py index 380483eb2717..863e1be15bc2 100644 --- a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py +++ b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestBankGuarantee(unittest.TestCase): diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py index 29975bed7364..c4cf37e0c828 100644 --- a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py +++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from frappe.utils import flt from six.moves import reduce diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index bed8be0c5a38..64ac9d6df75a 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -8,7 +8,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.naming import make_autoname -from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate, nowdate +from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( get_accounting_dimensions, diff --git a/erpnext/accounts/doctype/budget_account/budget_account.py b/erpnext/accounts/doctype/budget_account/budget_account.py index cfd5d4a8b84f..454e47d7a1a2 100644 --- a/erpnext/accounts/doctype/budget_account/budget_account.py +++ b/erpnext/accounts/doctype/budget_account/budget_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/c_form/test_c_form.py b/erpnext/accounts/doctype/c_form/test_c_form.py index 15109766fce7..c84f54ba27fa 100644 --- a/erpnext/accounts/doctype/c_form/test_c_form.py +++ b/erpnext/accounts/doctype/c_form/test_c_form.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('C-Form') diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py index cc2651fa4e5e..1316227df91b 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cashier_closing/cashier_closing.py b/erpnext/accounts/doctype/cashier_closing/cashier_closing.py index 752e57eb5b78..cab7d407b547 100644 --- a/erpnext/accounts/doctype/cashier_closing/cashier_closing.py +++ b/erpnext/accounts/doctype/cashier_closing/cashier_closing.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint, throw +from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, cstr, flt +from frappe.utils import flt class CashierClosing(Document): diff --git a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py index f0b3a2b6c657..5d28d17a2735 100644 --- a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py +++ b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCashierClosing(unittest.TestCase): diff --git a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py index c408a284c395..a2a8b9437e42 100644 --- a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py +++ b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py index 9ca9dd1e4c0c..00a954b811ae 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestChartofAccountsImporter(unittest.TestCase): diff --git a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py index 7015c51adf83..d6ec72e1d209 100644 --- a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Cheque Print Template') diff --git a/erpnext/accounts/doctype/closed_document/closed_document.py b/erpnext/accounts/doctype/closed_document/closed_document.py index afe705ceaaee..50469bc19c67 100644 --- a/erpnext/accounts/doctype/closed_document/closed_document.py +++ b/erpnext/accounts/doctype/closed_document/closed_document.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index b4cf3fc44c4e..166ebb83ac2a 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import cint, cstr +from frappe.utils import cint from frappe.utils.nestedset import NestedSet from erpnext.accounts.utils import validate_field_number diff --git a/erpnext/accounts/doctype/coupon_code/test_coupon_code.py b/erpnext/accounts/doctype/coupon_code/test_coupon_code.py index 321d7193f597..bf8c014a5b9b 100644 --- a/erpnext/accounts/doctype/coupon_code/test_coupon_code.py +++ b/erpnext/accounts/doctype/coupon_code/test_coupon_code.py @@ -6,10 +6,8 @@ import unittest import frappe -from frappe.test_runner import make_test_objects from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order -from erpnext.stock.get_item_details import get_item_details test_dependencies = ['Item'] diff --git a/erpnext/accounts/doctype/dunning/dunning.py b/erpnext/accounts/doctype/dunning/dunning.py index ed3cb1524dec..65ada530df58 100644 --- a/erpnext/accounts/doctype/dunning/dunning.py +++ b/erpnext/accounts/doctype/dunning/dunning.py @@ -7,7 +7,7 @@ import json import frappe -from frappe.utils import cint, flt, get_datetime, getdate, rounded +from frappe.utils import cint, flt, getdate from six import string_types from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( @@ -15,9 +15,6 @@ ) from erpnext.accounts.general_ledger import make_gl_entries, make_reverse_gl_entries from erpnext.controllers.accounts_controller import AccountsController -from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( - days_in_year, -) class Dunning(AccountsController): diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py index ba096b08041e..3e3638a73e56 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestExchangeRateRevaluation(unittest.TestCase): diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py index c8ede3f21bb7..58375dd4ef9c 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/finance_book/finance_book.py b/erpnext/accounts/doctype/finance_book/finance_book.py index cb52a4b8158b..527b8e678863 100644 --- a/erpnext/accounts/doctype/finance_book/finance_book.py +++ b/erpnext/accounts/doctype/finance_book/finance_book.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py index a4bdb0fbe295..b9c57f67b0ef 100644 --- a/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py +++ b/erpnext/accounts/doctype/fiscal_year_company/fiscal_year_company.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 0397253d4abf..1e983b1d4292 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -8,7 +8,7 @@ from frappe.model.document import Document from frappe.model.meta import get_field_precision from frappe.model.naming import set_name_from_naming_options -from frappe.utils import cint, flt, fmt_money, formatdate, getdate +from frappe.utils import flt, fmt_money from six import iteritems import erpnext diff --git a/erpnext/accounts/doctype/gst_account/gst_account.py b/erpnext/accounts/doctype/gst_account/gst_account.py index 80b8e9455928..9ca3f9ac51d2 100644 --- a/erpnext/accounts/doctype/gst_account/gst_account.py +++ b/erpnext/accounts/doctype/gst_account/gst_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py index 49d95f020f62..679a54d6663c 100644 --- a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py +++ b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestItemTaxTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py b/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py index 9ac854554abf..aa3b5420d602 100644 --- a/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py +++ b/erpnext/accounts/doctype/item_tax_template_detail/item_tax_template_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 848d55b38624..5b3d1c5c4cb8 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -7,7 +7,7 @@ import frappe from frappe import _, msgprint, scrub -from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, getdate, nowdate +from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, nowdate from six import iteritems, string_types import erpnext diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py index 352b22e39548..86d3df4dc220 100644 --- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py index b57169576a8f..c4315f93733e 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py +++ b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestLoyaltyPointEntry(unittest.TestCase): diff --git a/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py b/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py index b95464e5a099..506e2ce83982 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py +++ b/erpnext/accounts/doctype/loyalty_point_entry_redemption/loyalty_point_entry_redemption.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py index 189004f5ec8f..6a3d0fa9738f 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py b/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py index d2ea76e78fe3..4bbcf3ae9f0f 100644 --- a/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py +++ b/erpnext/accounts/doctype/loyalty_program_collection/loyalty_program_collection.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py index 241ec2888a46..dc80c6bb9615 100644 --- a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Mode of Payment') diff --git a/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py b/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py index 4030eaca1a16..40b5f302f2c8 100644 --- a/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py +++ b/erpnext/accounts/doctype/mode_of_payment_account/mode_of_payment_account.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py index b2d3b6759b86..8ec30c79af74 100644 --- a/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py +++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py index d71a7dc99387..4008022a26bc 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/party_account/party_account.py b/erpnext/accounts/doctype/party_account/party_account.py index b31bd91e5e80..08d67c7a7beb 100644 --- a/erpnext/accounts/doctype/party_account/party_account.py +++ b/erpnext/accounts/doctype/party_account/party_account.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py index 2829322ba328..9cfed7b56d3b 100644 --- a/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py +++ b/erpnext/accounts/doctype/payment_entry_deduction/payment_entry_deduction.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py index 497d145e14b2..a686f495cda5 100644 --- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py +++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py index 08982296f3d9..65b743bfd15a 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py +++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py index 3a0ed549fb9f..c0cdfcdc84c9 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py +++ b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Payment Gateway Account') diff --git a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py index c82f54793663..893da7455daa 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py +++ b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py b/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py index 68e5615b74a1..4bb98a3b61a1 100644 --- a/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py +++ b/erpnext/accounts/doctype/payment_order_reference/payment_order_reference.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 6f6b96ad64e9..c6cafdc0a713 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -10,9 +10,8 @@ import erpnext from erpnext.accounts.utils import ( - get_outstanding_invoices, - reconcile_against_document, - update_reference_in_payment_entry, + get_outstanding_invoices, + reconcile_against_document ) from erpnext.controllers.accounts_controller import get_advance_payment_entries diff --git a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py index f3914a05de5f..5ac1855c0300 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py +++ b/erpnext/accounts/doctype/payment_reconciliation_invoice/payment_reconciliation_invoice.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py index 5e0285f3682f..78c84ff5a6a4 100644 --- a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py +++ b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py index a37a27827be0..356859113246 100644 --- a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py +++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, flt +from frappe.utils import flt class PaymentTermsTemplate(Document): diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 17d64cfda64c..2d417a4cfba0 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -7,7 +7,7 @@ import unittest import frappe -from frappe.utils import flt, today +from frappe.utils import today from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py index 9bc717496dad..8093936119f9 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ @@ -15,7 +14,6 @@ unconsolidate_pos_invoices, ) from erpnext.controllers.status_updater import StatusUpdater -from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data class POSClosingEntry(StatusUpdater): diff --git a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py index 1938983e2658..256ade4f47b8 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/test_pos_closing_entry.py @@ -6,7 +6,6 @@ import unittest import frappe -from frappe.utils import nowdate from erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry import ( make_closing_entry_from_opening, diff --git a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py index a1c68c93ab0e..570eb9ea177b 100644 --- a/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py +++ b/erpnext/accounts/doctype/pos_customer_group/pos_customer_group.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 6ed86da8ef0e..d6e41e6f90de 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -6,7 +6,6 @@ import frappe from frappe import _ -from frappe.model.document import Document from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate from six import iteritems @@ -19,7 +18,6 @@ update_multi_mode_option, ) from erpnext.accounts.party import get_due_date, get_party_account -from erpnext.accounts.utils import get_account_currency from erpnext.stock.doctype.serial_no.serial_no import get_pos_reserved_serial_nos, get_serial_nos diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py index 798381c8479d..0be8ca7ee69b 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py @@ -10,7 +10,6 @@ import six from frappe import _ from frappe.core.page.background_jobs.background_jobs import get_info -from frappe.model import default_fields from frappe.model.document import Document from frappe.model.mapper import map_child_doc, map_doc from frappe.utils import flt, getdate, nowdate diff --git a/erpnext/accounts/doctype/pos_item_group/pos_item_group.py b/erpnext/accounts/doctype/pos_item_group/pos_item_group.py index 177bf25fdaad..b5ff794ccc3e 100644 --- a/erpnext/accounts/doctype/pos_item_group/pos_item_group.py +++ b/erpnext/accounts/doctype/pos_item_group/pos_item_group.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py index 384463a5a500..b64e2eda2db6 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py @@ -6,7 +6,7 @@ import frappe from frappe import _, msgprint from frappe.model.document import Document -from frappe.utils import cint, get_link_to_form, now +from frappe.utils import get_link_to_form, now from six import iteritems diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.py b/erpnext/accounts/doctype/pos_settings/pos_settings.py index 3f613aa511a3..5c5aaa04ed39 100644 --- a/erpnext/accounts/doctype/pos_settings/pos_settings.py +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index 639b39de1677..12b486e45eb1 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -11,7 +11,6 @@ import frappe from frappe import _, bold from frappe.utils import cint, flt, fmt_money, get_link_to_form, getdate, today -from six import string_types from erpnext.setup.doctype.item_group.item_group import get_child_item_groups from erpnext.stock.doctype.warehouse.warehouse import get_child_warehouses diff --git a/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py b/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py index 0b426ebe7f28..5e10b8411a49 100644 --- a/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py +++ b/erpnext/accounts/doctype/pricing_rule_brand/pricing_rule_brand.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py b/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py index c38139495c40..a90ecbb6f7f3 100644 --- a/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py +++ b/erpnext/accounts/doctype/pricing_rule_detail/pricing_rule_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py b/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py index 9f36f14c05a9..4746b39e175b 100644 --- a/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py +++ b/erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py b/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py index 665704f2b784..ff1ba75a60ff 100644 --- a/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py +++ b/erpnext/accounts/doctype/pricing_rule_item_group/pricing_rule_item_group.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py index 418c3cc0882b..72b7b23e149b 100644 --- a/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py +++ b/erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py @@ -8,7 +8,6 @@ from frappe import _ from frappe.model.document import Document -import erpnext from erpnext.accounts.deferred_revenue import ( build_conditions, convert_deferred_expense_to_expense, diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py index 472ebac3551f..73f303851208 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import copy -from datetime import timedelta import frappe from frappe import _ @@ -13,7 +12,6 @@ from frappe.utils import add_days, add_months, format_date, getdate, today from frappe.utils.jinja import validate_template from frappe.utils.pdf import get_pdf -from frappe.utils.print_format import report_to_pdf from frappe.www.printview import get_print_style from erpnext import get_company_currency diff --git a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py index 4d6b86ce5f51..d09f7dc2da20 100644 --- a/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py +++ b/erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py @@ -7,8 +7,6 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.model.naming import make_autoname -from frappe.utils import cstr pricing_rule_fields = ['apply_on', 'mixed_conditions', 'is_cumulative', 'other_item_code', 'other_item_group', 'apply_rule_on_other', 'other_brand', 'selling', 'buying', 'applicable_for', 'valid_from', diff --git a/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py b/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py index 2d6394fb7f45..ab8efc331411 100644 --- a/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py +++ b/erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py b/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py index b33791430651..85019b4e4556 100644 --- a/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py +++ b/erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index f34a8fbd9f28..81c391e5582f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _, throw from frappe.model.mapper import get_mapped_doc from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 04d03f5bc832..e77b60bb1cd5 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -7,8 +7,6 @@ import unittest import frappe -import frappe.defaults -import frappe.model from frappe.utils import add_days, cint, flt, getdate, nowdate, today import erpnext diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py index 4183d054061a..ec2ce65168d9 100644 --- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py +++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py index 447235c8b39e..ad2a24c0e2ff 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py index 9d3b64725149..34ac25753b3e 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py index 85af12ed8c28..8a04ddea2296 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Purchase Taxes and Charges Template') diff --git a/erpnext/accounts/doctype/salary_component_account/salary_component_account.py b/erpnext/accounts/doctype/salary_component_account/salary_component_account.py index 81ccbdeef470..d96ef62c2933 100644 --- a/erpnext/accounts/doctype/salary_component_account/salary_component_account.py +++ b/erpnext/accounts/doctype/salary_component_account/salary_component_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index c9b1afad52f8..8bd79eae0483 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _, msgprint, throw from frappe.contacts.doctype.address.address import get_address_display from frappe.model.mapper import get_mapped_doc @@ -25,9 +24,8 @@ import erpnext from erpnext.accounts.deferred_revenue import validate_service_stop_date from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( - get_loyalty_details, - get_loyalty_program_details_with_points, - validate_loyalty_points, + get_loyalty_program_details_with_points, + validate_loyalty_points ) from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( get_party_tax_withholding_details, diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 2e95aae451f1..face10e95452 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -9,7 +9,7 @@ import frappe from frappe.model.dynamic_links import get_dynamic_link_map from frappe.model.naming import make_autoname -from frappe.utils import add_days, add_months, cint, flt, getdate, nowdate +from frappe.utils import add_days, flt, getdate, nowdate from six import iteritems from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py index 8f4662f08c8d..ae69598a66a4 100644 --- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py +++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py index 732c47dde626..063c591f7682 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py index 69a085fcd079..a980ece580b9 100644 --- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py +++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py index 24dbc70a9630..e8d4b114fef6 100644 --- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py +++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py index 533704c8ef2a..39872f337704 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/share_balance/share_balance.py b/erpnext/accounts/doctype/share_balance/share_balance.py index 9ffbefb79469..0353e9982371 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.py +++ b/erpnext/accounts/doctype/share_balance/share_balance.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/share_type/share_type.py b/erpnext/accounts/doctype/share_type/share_type.py index 7d04e11dacee..5b133aa34ab5 100644 --- a/erpnext/accounts/doctype/share_type/share_type.py +++ b/erpnext/accounts/doctype/share_type/share_type.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/share_type/test_share_type.py b/erpnext/accounts/doctype/share_type/test_share_type.py index d41d407a1041..f2076fd52fe1 100644 --- a/erpnext/accounts/doctype/share_type/test_share_type.py +++ b/erpnext/accounts/doctype/share_type/test_share_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestShareType(unittest.TestCase): diff --git a/erpnext/accounts/doctype/shareholder/shareholder.py b/erpnext/accounts/doctype/shareholder/shareholder.py index 3553ae40da34..12c50c8283b4 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder.py +++ b/erpnext/accounts/doctype/shareholder/shareholder.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.contacts.address_and_contact import ( delete_contact_and_address, load_address_and_contact, diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py index 3b77fd51b5e7..1373c32824d1 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py +++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/accounts/doctype/shareholder/test_shareholder.py b/erpnext/accounts/doctype/shareholder/test_shareholder.py index 0c3f6e5bc738..34feb56418c8 100644 --- a/erpnext/accounts/doctype/shareholder/test_shareholder.py +++ b/erpnext/accounts/doctype/shareholder/test_shareholder.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestShareholder(unittest.TestCase): diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py index 2f35c448aacd..66cd269e51be 100644 --- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py +++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py index 32ead2c7a77c..9576acd0aba6 100644 --- a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py +++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 03ec6e9151ff..40965d372625 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -7,15 +7,13 @@ import frappe from frappe.utils.data import ( - add_days, + add_days, add_months, add_to_date, date_diff, flt, get_date_str, - get_first_day, - get_last_day, - nowdate, + nowdate ) from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor diff --git a/erpnext/accounts/doctype/tax_category/tax_category.py b/erpnext/accounts/doctype/tax_category/tax_category.py index 82758bc916af..df31a5e45f90 100644 --- a/erpnext/accounts/doctype/tax_category/tax_category.py +++ b/erpnext/accounts/doctype/tax_category/tax_category.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/tax_category/test_tax_category.py b/erpnext/accounts/doctype/tax_category/test_tax_category.py index 854671b97bb3..f57a6fb6b5b5 100644 --- a/erpnext/accounts/doctype/tax_category/test_tax_category.py +++ b/erpnext/accounts/doctype/tax_category/test_tax_category.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestTaxCategory(unittest.TestCase): diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py index 0a6bdbc36749..19762350dca1 100644 --- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py @@ -8,10 +8,8 @@ import frappe from erpnext.accounts.doctype.tax_rule.tax_rule import ( - ConflictingTaxRule, - IncorrectCustomerGroup, - IncorrectSupplierType, - get_tax_template, + ConflictingTaxRule, + get_tax_template ) from erpnext.crm.doctype.opportunity.opportunity import make_quotation from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity diff --git a/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py b/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py index ef4757e3fe20..fd194829e564 100644 --- a/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py +++ b/erpnext/accounts/doctype/tax_withholding_account/tax_withholding_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index d7de48c72ffb..b4bdd73c4929 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, flt, getdate +from frappe.utils import cint, getdate from erpnext.accounts.utils import get_fiscal_year diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py index d51ba65b13b7..ae2ba8505374 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py index bf10c9e073a1..c4a5ba52fea0 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py @@ -9,7 +9,6 @@ from frappe.utils import today from erpnext.accounts.utils import get_fiscal_year -from erpnext.buying.doctype.supplier.test_supplier import create_supplier test_dependencies = ["Supplier Group", "Customer Group"] diff --git a/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py b/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py index fb6cd040c87f..6556277509ab 100644 --- a/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py +++ b/erpnext/accounts/doctype/tax_withholding_rate/tax_withholding_rate.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 2bc9e7400608..4bf2b828edd0 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -6,7 +6,7 @@ import frappe from frappe import _ from frappe.model.meta import get_field_precision -from frappe.utils import cint, comma_and, cstr, flt, formatdate, getdate, now, today +from frappe.utils import cint, cstr, flt, formatdate, getdate, now import erpnext from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 8f557c73c2c0..7ea6ccee5b4f 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -27,7 +27,7 @@ getdate, nowdate, ) -from six import iteritems, string_types +from six import iteritems import erpnext from erpnext import get_company_currency diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py index 19b66c4a520e..1bd369bdd8db 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.py +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py index 55780d5b0bfa..1fd977d54236 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import ( AccountsReceivableSummary, diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 58508239e5d0..e91fdf27cdde 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -7,9 +7,8 @@ import frappe from frappe import _, scrub -from frappe.utils import cint, cstr, flt, formatdate, getdate, now, nowdate, time_diff_in_seconds +from frappe.utils import cint, cstr, flt, getdate, nowdate -import erpnext from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( get_accounting_dimensions, get_dimension_with_children, diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py index a748394aaff4..1d24561bb3f4 100644 --- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py @@ -3,7 +3,6 @@ import unittest import frappe -import frappe.defaults from frappe.utils import add_days, getdate, today from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py index edcc25dc4f82..106f224a7406 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py @@ -5,7 +5,7 @@ import frappe from frappe import _, scrub -from frappe.utils import cint, flt +from frappe.utils import cint from six import iteritems from erpnext.accounts.party import get_partywise_advanced_payment_amount diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py index 6542333021ba..c135efe6d470 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.utils import flt -import erpnext def execute(filters=None): diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py index 2fcd12947432..e419727c2d17 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.utils import cint, flt, getdate -import erpnext from erpnext.accounts.report.balance_sheet.balance_sheet import ( check_opening_balance, get_chart_data, @@ -32,7 +31,7 @@ from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import ( get_report_summary as get_pl_summary, ) -from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency +from erpnext.accounts.report.utils import convert_to_presentation_currency def execute(filters=None): diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 3797402ffd88..c4db3281ce7f 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -8,7 +8,6 @@ from frappe.utils import getdate, nowdate from six import iteritems, itervalues -import erpnext class PartyLedgerSummaryReport(object): diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py index fae5be087f6d..f096094296c2 100644 --- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index fceef5abb9eb..2cb8a6802a71 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -15,7 +15,6 @@ from past.builtins import cmp from six import itervalues -import erpnext from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( get_accounting_dimensions, get_dimension_with_children, diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 951c1363ac07..a0445187499c 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -7,10 +7,9 @@ import frappe from frappe import _, _dict -from frappe.utils import cstr, flt, fmt_money, getdate +from frappe.utils import cstr, flt, getdate from six import iteritems -import erpnext from erpnext import get_company_currency, get_default_company from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( get_accounting_dimensions, diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index a6a69b1d6b6b..8f822711a7aa 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import add_days, cint, getdate, today +from frappe.utils import cint def execute(filters=None): diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 7f1b3b541511..892424868f58 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -9,13 +9,12 @@ import erpnext from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import ( - add_sub_total_row, + add_sub_total_row, add_total_row, - get_display_value, get_grand_total, get_group_by_and_display_fields, get_group_by_conditions, - get_tax_accounts, + get_tax_accounts ) from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index eef10ae5fa34..847a127d3653 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -9,7 +9,6 @@ from frappe.utils import cstr, flt from frappe.utils.xlsxutils import handle_html -import erpnext from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import ( get_customer_details, diff --git a/erpnext/accounts/report/non_billed_report.py b/erpnext/accounts/report/non_billed_report.py index cdda1fc5819c..b61f87df5bfa 100644 --- a/erpnext/accounts/report/non_billed_report.py +++ b/erpnext/accounts/report/non_billed_report.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from frappe.model.meta import get_field_precision from erpnext import get_default_currency diff --git a/erpnext/accounts/report/pos_register/pos_register.py b/erpnext/accounts/report/pos_register/pos_register.py index 9357454b44a0..c9463caa6db5 100644 --- a/erpnext/accounts/report/pos_register/pos_register.py +++ b/erpnext/accounts/report/pos_register/pos_register.py @@ -4,9 +4,8 @@ from __future__ import unicode_literals import frappe -from frappe import _, _dict +from frappe import _ -from erpnext import get_company_currency, get_default_company from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index 520dd958d415..ad97808973b4 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import cstr, flt, formatdate, getdate +from frappe.utils import cstr, flt from erpnext.accounts.report.financial_statements import ( filter_accounts, diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py index bc8ab52ba6f3..63d2f0283f38 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py index 5ba0f97cf802..adf6b29ea8f0 100644 --- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py +++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py index fd101d0f6101..f148c8a49b8e 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/accounts/report/share_balance/share_balance.py b/erpnext/accounts/report/share_balance/share_balance.py index 587430dad84c..03efc9ec33a5 100644 --- a/erpnext/accounts/report/share_balance/share_balance.py +++ b/erpnext/accounts/report/share_balance/share_balance.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ def execute(filters=None): diff --git a/erpnext/accounts/report/share_ledger/share_ledger.py b/erpnext/accounts/report/share_ledger/share_ledger.py index fb9538159175..9be662220d0b 100644 --- a/erpnext/accounts/report/share_ledger/share_ledger.py +++ b/erpnext/accounts/report/share_ledger/share_ledger.py @@ -5,8 +5,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint -from frappe.utils import cint, cstr, getdate +from frappe import _ def execute(filters=None): diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py index a27b38f75bb5..65047e1c55f7 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import ( PartyLedgerSummaryReport, diff --git a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py index 3ab5dc5f23a5..9e1382b9222a 100644 --- a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py +++ b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py @@ -5,7 +5,6 @@ import frappe from frappe import _ -from frappe.utils import getdate def execute(filters=None): diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 44a1d97fded5..57ff9b0ec9eb 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, flt, formatdate, get_datetime_str +from frappe.utils import flt, formatdate, get_datetime_str from erpnext import get_company_currency, get_default_company from erpnext.accounts.doctype.fiscal_year.fiscal_year import get_from_and_to_date diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 7478583098f9..d78592c5ab4b 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -9,12 +9,10 @@ from frappe import _, throw from frappe.model.meta import get_field_precision from frappe.utils import cint, cstr, flt, formatdate, get_number_format_info, getdate, now, nowdate -from six import iteritems import erpnext # imported to enable erpnext.accounts.utils.get_account_currency -from erpnext.accounts.doctype.account.account import get_account_currency from erpnext.stock import get_warehouse_account_map from erpnext.stock.utils import get_stock_value_on diff --git a/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py b/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py index c733a98fc579..b0441c236fc4 100644 --- a/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py +++ b/erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py index f0fc1f6220a4..43384dd791bc 100644 --- a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py +++ b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestAgricultureAnalysisCriteria(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py b/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py index 80c861ae0c05..642f49189da5 100644 --- a/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py +++ b/erpnext/agriculture/doctype/agriculture_task/agriculture_task.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py index 87168b784382..b54b46f210f4 100644 --- a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py +++ b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestAgricultureTask(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/detected_disease/detected_disease.py b/erpnext/agriculture/doctype/detected_disease/detected_disease.py index 1d8210617ef8..b73fc32f7fda 100644 --- a/erpnext/agriculture/doctype/detected_disease/detected_disease.py +++ b/erpnext/agriculture/doctype/detected_disease/detected_disease.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py b/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py index 054f98b6429b..a050b7101075 100644 --- a/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py +++ b/erpnext/agriculture/doctype/fertilizer_content/fertilizer_content.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/linked_location/linked_location.py b/erpnext/agriculture/doctype/linked_location/linked_location.py index 592ec6c4479c..e622e84dc32c 100644 --- a/erpnext/agriculture/doctype/linked_location/linked_location.py +++ b/erpnext/agriculture/doctype/linked_location/linked_location.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py b/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py index cd3d7d35ae38..608bf8c5e3a1 100644 --- a/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py +++ b/erpnext/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py b/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py index 4386cd1a8f08..02eb133de91c 100644 --- a/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py +++ b/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py b/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py index 8accae9ea60a..f580e165762b 100644 --- a/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py +++ b/erpnext/agriculture/doctype/linked_soil_texture/linked_soil_texture.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py b/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py index 2b6141d9cfaa..62382500166e 100644 --- a/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py +++ b/erpnext/agriculture/doctype/plant_analysis/plant_analysis.py @@ -6,7 +6,6 @@ import frappe from frappe.model.document import Document -from frappe.model.naming import make_autoname class PlantAnalysis(Document): diff --git a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py index a343932948a5..cb48b099d8bb 100644 --- a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py +++ b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestPlantAnalysis(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py b/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py index 70a28d5ab2ad..9f719874ed29 100644 --- a/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py +++ b/erpnext/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py index d842184e7d1e..c2612b8314d3 100644 --- a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py +++ b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestSoilAnalysis(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py b/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py index f8e4e9ff2920..09b917c549a5 100644 --- a/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py +++ b/erpnext/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py b/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py index 86a6c9e8fba5..9980e8b0cae9 100644 --- a/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py +++ b/erpnext/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py index 5c12294b94e6..74bbad8b385f 100644 --- a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py +++ b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestWaterAnalysis(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py b/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py index 78c866444485..8771733213cc 100644 --- a/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py +++ b/erpnext/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/agriculture/doctype/weather/test_weather.py b/erpnext/agriculture/doctype/weather/test_weather.py index 4aa161060e83..e9e77bd77f07 100644 --- a/erpnext/agriculture/doctype/weather/test_weather.py +++ b/erpnext/agriculture/doctype/weather/test_weather.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestWeather(unittest.TestCase): diff --git a/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py b/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py index ea9256cb35c0..42fcbcb719aa 100644 --- a/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py +++ b/erpnext/agriculture/doctype/weather_parameter/weather_parameter.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/dashboard_fixtures.py b/erpnext/assets/dashboard_fixtures.py index bb3d47f4629e..39f0f1a88be4 100644 --- a/erpnext/assets/dashboard_fixtures.py +++ b/erpnext/assets/dashboard_fixtures.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import add_months, get_date_str, nowdate +from frappe.utils import get_date_str, nowdate from erpnext.accounts.dashboard_fixtures import _get_fiscal_year from erpnext.buying.dashboard_fixtures import get_company_for_dashboards diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index c35828e26e87..8ff4f9790aad 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -9,7 +9,6 @@ import frappe from frappe import _ -from frappe.model.document import Document from frappe.utils import ( add_days, add_months, @@ -27,7 +26,6 @@ import erpnext from erpnext.accounts.general_ledger import make_reverse_gl_entries -from erpnext.accounts.utils import get_account_currency from erpnext.assets.doctype.asset.depreciation import ( get_depreciation_accounts, get_disposal_account_and_cost_center, diff --git a/erpnext/assets/doctype/asset_category_account/asset_category_account.py b/erpnext/assets/doctype/asset_category_account/asset_category_account.py index bc4e34cf3c9b..66280acb2e89 100644 --- a/erpnext/assets/doctype/asset_category_account/asset_category_account.py +++ b/erpnext/assets/doctype/asset_category_account/asset_category_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py index 8fac1311d67b..c4f095305c5c 100644 --- a/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py +++ b/erpnext/assets/doctype/asset_finance_book/asset_finance_book.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py b/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py index 5cfe052ff088..2280f5572848 100644 --- a/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py +++ b/erpnext/assets/doctype/asset_maintenance_task/asset_maintenance_task.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py index 6d7f4a82bf4e..46e9029941cf 100644 --- a/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py +++ b/erpnext/assets/doctype/asset_maintenance_team/asset_maintenance_team.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/asset_movement/test_asset_movement.py b/erpnext/assets/doctype/asset_movement/test_asset_movement.py index 36e3655176f1..058bbd1abd6d 100644 --- a/erpnext/assets/doctype/asset_movement/test_asset_movement.py +++ b/erpnext/assets/doctype/asset_movement/test_asset_movement.py @@ -6,14 +6,11 @@ import unittest import frappe -from frappe.utils import add_days, get_last_day, now, nowdate +from frappe.utils import now -import erpnext from erpnext.assets.doctype.asset.test_asset import create_asset_data from erpnext.hr.doctype.employee.test_employee import make_employee -from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos class TestAssetMovement(unittest.TestCase): diff --git a/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py b/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py index 8e6a25d4b770..3199b7dc8dc9 100644 --- a/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py +++ b/erpnext/assets/doctype/depreciation_schedule/depreciation_schedule.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/linked_location/linked_location.py b/erpnext/assets/doctype/linked_location/linked_location.py index 592ec6c4479c..e622e84dc32c 100644 --- a/erpnext/assets/doctype/linked_location/linked_location.py +++ b/erpnext/assets/doctype/linked_location/linked_location.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/doctype/location/location.py b/erpnext/assets/doctype/location/location.py index 317894cb58e7..1430306bec18 100644 --- a/erpnext/assets/doctype/location/location.py +++ b/erpnext/assets/doctype/location/location.py @@ -8,8 +8,6 @@ import math import frappe -from frappe import _ -from frappe.model.document import Document from frappe.utils import flt from frappe.utils.nestedset import NestedSet, update_nsm diff --git a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py index e70570dceded..8fc5c9c43c1f 100644 --- a/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py +++ b/erpnext/assets/doctype/maintenance_team_member/maintenance_team_member.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py index cf2695802efa..e370b9d0cb31 100644 --- a/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py +++ b/erpnext/assets/report/fixed_asset_register/fixed_asset_register.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import add_years, cstr, flt, formatdate, getdate, today +from frappe.utils import cstr, flt, formatdate, getdate from erpnext.accounts.report.financial_statements import ( get_fiscal_year_data, diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 164e2813f8e9..313200791fd5 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -7,7 +7,6 @@ import unittest import frappe -import frappe.defaults from frappe.utils import add_days, flt, getdate, nowdate from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry @@ -19,9 +18,7 @@ make_rm_stock_entry as make_subcontract_transfer_entry, ) from erpnext.controllers.accounts_controller import update_child_qty_rate -from erpnext.controllers.status_updater import OverAllowanceError from erpnext.manufacturing.doctype.blanket_order.test_blanket_order import make_blanket_order -from erpnext.stock.doctype.batch.test_batch import make_new_batch from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.material_request.material_request import make_purchase_order from erpnext.stock.doctype.material_request.test_material_request import make_material_request diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py index 9ba18e26983f..909faeca6adb 100644 --- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py +++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py index 8c3194d8d5d0..caec4e8b7aab 100644 --- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py +++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py index 7e7a05af128a..af1a9a907a92 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py @@ -11,7 +11,7 @@ from frappe.core.doctype.communication.email import make from frappe.desk.form.load import get_attachments from frappe.model.mapper import get_mapped_doc -from frappe.utils import cint, get_url +from frappe.utils import get_url from frappe.utils.print_format import download_pdf from frappe.utils.user import get_user_fullname from six import string_types diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py index adc035b640e5..8e670e292d84 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py index 6f7997f4bfeb..35f3305b8ef7 100644 --- a/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py +++ b/erpnext/buying/doctype/request_for_quotation_item/request_for_quotation_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py index 8dd524ad8dab..47c0deb39f38 100644 --- a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py +++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 15829009f889..a66f801cb5d9 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -12,10 +12,9 @@ ) from frappe.model.naming import set_name_by_naming_series -from erpnext.accounts.party import ( # keep this - get_dashboard_info, - get_timeline_data, - validate_party_accounts, +from erpnext.accounts.party import ( + get_dashboard_info, + validate_party_accounts ) from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index ae64d2466d1e..af462fc6859b 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -6,7 +6,7 @@ import frappe from frappe import _ from frappe.model.mapper import get_mapped_doc -from frappe.utils import add_days, flt, getdate, nowdate +from frappe.utils import flt, getdate, nowdate from erpnext.buying.utils import validate_for_items from erpnext.controllers.buying_controller import BuyingController diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 2ca3975f9443..2db8e22f08b5 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -7,7 +7,6 @@ import unittest import frappe -import frappe.defaults class TestPurchaseOrder(unittest.TestCase): diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py index 33ed22a6044c..03adab54626c 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py index 7ce73171a1b8..9781480afa7d 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py index 694b5541c29f..7aeae4516455 100644 --- a/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py +++ b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import unittest -from pprint import pprint import frappe diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 4df7fd84012f..a6be85022400 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -8,9 +8,8 @@ import frappe from frappe import _, throw from frappe.model.workflow import ( - WorkflowPermissionError, - get_workflow_name, - is_transition_condition_satisfied, + get_workflow_name, + is_transition_condition_satisfied ) from frappe.utils import ( add_days, diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 426ca52f7f41..5388ecd62669 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -3,13 +3,11 @@ from __future__ import unicode_literals -from collections import OrderedDict import frappe from frappe import _, msgprint from frappe.contacts.doctype.address.address import get_address_display from frappe.utils import cint, cstr, flt, getdate -from six import iteritems from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget from erpnext.accounts.party import get_party_details @@ -17,13 +15,7 @@ from erpnext.controllers.sales_and_purchase_return import get_rate_for_return from erpnext.controllers.stock_controller import StockController from erpnext.controllers.subcontracting import Subcontracting -from erpnext.stock.doctype.serial_no.serial_no import ( - auto_make_serial_nos, - get_auto_serial_nos, - get_serial_nos, -) from erpnext.stock.get_item_details import get_conversion_factor -from erpnext.stock.stock_ledger import get_valuation_rate from erpnext.stock.utils import get_incoming_rate diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index 019825937476..0ccf24edfd40 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -3,8 +3,6 @@ from __future__ import unicode_literals -import frappe -from frappe.utils import cint def set_print_templates_for_item_table(doc, settings): diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index c31279441635..aafaf5b9e083 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -8,7 +8,7 @@ import frappe from frappe.desk.reportview import get_filters_cond, get_match_cond -from frappe.utils import getdate, nowdate, unique +from frappe.utils import nowdate, unique import erpnext from erpnext.stock.get_item_details import _get_item_tax_template diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 718e5d608a42..78a6e52e4d7f 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -5,7 +5,6 @@ from collections import defaultdict import frappe -import frappe.defaults from frappe import _ from frappe.utils import cint, cstr, flt, get_link_to_form, getdate diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py index 7a84aafb2404..2d1ae43f074b 100644 --- a/erpnext/controllers/tests/test_mapper.py +++ b/erpnext/controllers/tests/test_mapper.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import json -import random import unittest import frappe diff --git a/erpnext/crm/doctype/appointment/appointment.py b/erpnext/crm/doctype/appointment/appointment.py index f8432ea6762c..f2055349bd20 100644 --- a/erpnext/crm/doctype/appointment/appointment.py +++ b/erpnext/crm/doctype/appointment/appointment.py @@ -4,15 +4,13 @@ from __future__ import unicode_literals -import urllib from collections import Counter -from datetime import timedelta import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import get_url, getdate -from frappe.utils.verified_command import get_signed_params, verify_request +from frappe.utils.verified_command import get_signed_params class Appointment(Document): diff --git a/erpnext/crm/doctype/contract/contract.py b/erpnext/crm/doctype/contract/contract.py index c39397bf4b4b..9654613f0411 100644 --- a/erpnext/crm/doctype/contract/contract.py +++ b/erpnext/crm/doctype/contract/contract.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import getdate, now_datetime, nowdate +from frappe.utils import getdate, nowdate class Contract(Document): diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py index cd3a3433f819..ae56f93fc84b 100644 --- a/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py +++ b/erpnext/crm/doctype/contract_fulfilment_checklist/contract_fulfilment_checklist.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py index d6d783b3d620..a4c44db5c191 100644 --- a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py +++ b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestContractFulfilmentChecklist(unittest.TestCase): diff --git a/erpnext/crm/doctype/contract_template/test_contract_template.py b/erpnext/crm/doctype/contract_template/test_contract_template.py index 704cc70484a4..e07079be86f8 100644 --- a/erpnext/crm/doctype/contract_template/test_contract_template.py +++ b/erpnext/crm/doctype/contract_template/test_contract_template.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestContractTemplate(unittest.TestCase): diff --git a/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py b/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py index 1d53e8a799eb..28f844d09700 100644 --- a/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py +++ b/erpnext/crm/doctype/contract_template_fulfilment_terms/contract_template_fulfilment_terms.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/email_campaign/email_campaign.py b/erpnext/crm/doctype/email_campaign/email_campaign.py index e9baec461e4f..4b74f25ead7a 100644 --- a/erpnext/crm/doctype/email_campaign/email_campaign.py +++ b/erpnext/crm/doctype/email_campaign/email_campaign.py @@ -8,7 +8,7 @@ from frappe import _ from frappe.core.doctype.communication.email import make from frappe.model.document import Document -from frappe.utils import add_days, cstr, getdate, nowdate, today +from frappe.utils import add_days, getdate, today class EmailCampaign(Document): diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py index e1c46144e3d2..e8c320e7e1fb 100644 --- a/erpnext/crm/doctype/lead/lead_dashboard.py +++ b/erpnext/crm/doctype/lead/lead_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/crm/doctype/market_segment/market_segment.py b/erpnext/crm/doctype/market_segment/market_segment.py index 71ce7bd6278e..92adf56876c9 100644 --- a/erpnext/crm/doctype/market_segment/market_segment.py +++ b/erpnext/crm/doctype/market_segment/market_segment.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/market_segment/test_market_segment.py b/erpnext/crm/doctype/market_segment/test_market_segment.py index 5c09471dbe3a..83b4849d8f11 100644 --- a/erpnext/crm/doctype/market_segment/test_market_segment.py +++ b/erpnext/crm/doctype/market_segment/test_market_segment.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestMarketSegment(unittest.TestCase): diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 7bea150aef97..0b3f50897abc 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -6,7 +6,7 @@ import json import frappe -from frappe import _, msgprint +from frappe import _ from frappe.email.inbox import link_communication_to_document from frappe.model.mapper import get_mapped_doc from frappe.utils import cint, cstr, get_fullname diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py index 2f3369c7fb67..05cb30e84beb 100644 --- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py +++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/crm/doctype/opportunity_item/opportunity_item.py b/erpnext/crm/doctype/opportunity_item/opportunity_item.py index 70e7359881e8..225cfe9d324b 100644 --- a/erpnext/crm/doctype/opportunity_item/opportunity_item.py +++ b/erpnext/crm/doctype/opportunity_item/opportunity_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/opportunity_type/opportunity_type.py b/erpnext/crm/doctype/opportunity_type/opportunity_type.py index 0b0e2550a177..5b64e9809655 100644 --- a/erpnext/crm/doctype/opportunity_type/opportunity_type.py +++ b/erpnext/crm/doctype/opportunity_type/opportunity_type.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py index f1333dc9a391..f5f5304211b6 100644 --- a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py +++ b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestOpportunityType(unittest.TestCase): diff --git a/erpnext/crm/doctype/sales_stage/sales_stage.py b/erpnext/crm/doctype/sales_stage/sales_stage.py index 757f001e1646..e9e176f0871a 100644 --- a/erpnext/crm/doctype/sales_stage/sales_stage.py +++ b/erpnext/crm/doctype/sales_stage/sales_stage.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/crm/doctype/sales_stage/test_sales_stage.py b/erpnext/crm/doctype/sales_stage/test_sales_stage.py index 188d125a6be5..9a176c73c360 100644 --- a/erpnext/crm/doctype/sales_stage/test_sales_stage.py +++ b/erpnext/crm/doctype/sales_stage/test_sales_stage.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestSalesStage(unittest.TestCase): diff --git a/erpnext/crm/doctype/twitter_settings/twitter_settings.py b/erpnext/crm/doctype/twitter_settings/twitter_settings.py index d853c24ddf05..0205cca2b921 100644 --- a/erpnext/crm/doctype/twitter_settings/twitter_settings.py +++ b/erpnext/crm/doctype/twitter_settings/twitter_settings.py @@ -5,13 +5,12 @@ from __future__ import unicode_literals import json -import os import frappe import tweepy from frappe import _ from frappe.model.document import Document -from frappe.utils import get_link_to_form, get_url_to_form +from frappe.utils import get_url_to_form from frappe.utils.file_manager import get_file_path from tweepy.error import TweepError diff --git a/erpnext/crm/doctype/utils.py b/erpnext/crm/doctype/utils.py index 32ed9621c55f..0da0e0e71af8 100644 --- a/erpnext/crm/doctype/utils.py +++ b/erpnext/crm/doctype/utils.py @@ -1,7 +1,5 @@ -import json import frappe -from frappe import _ @frappe.whitelist() diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py index 66a52c983c64..5406eba6d8eb 100644 --- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py +++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data diff --git a/erpnext/demo/setup/retail.py b/erpnext/demo/setup/retail.py index 90de59d7bf47..d94d2d6763ab 100644 --- a/erpnext/demo/setup/retail.py +++ b/erpnext/demo/setup/retail.py @@ -1,14 +1,11 @@ from __future__ import unicode_literals import json -import random import frappe -from frappe.utils import add_days, nowdate from six import iteritems from erpnext.demo.domains import data -from erpnext.demo.setup.setup_data import import_json def setup_data(): diff --git a/erpnext/demo/user/manufacturing.py b/erpnext/demo/user/manufacturing.py index acc5d35c25bd..6e01f0f5a672 100644 --- a/erpnext/demo/user/manufacturing.py +++ b/erpnext/demo/user/manufacturing.py @@ -12,7 +12,6 @@ import erpnext from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record -from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError def work(): @@ -21,8 +20,6 @@ def work(): frappe.set_user(frappe.db.get_global('demo_manufacturing_user')) if not frappe.get_all('Sales Order'): return - from erpnext.projects.doctype.timesheet.timesheet import OverlapError - ppt = frappe.new_doc("Production Plan") ppt.company = erpnext.get_default_company() # ppt.use_multi_level_bom = 1 #refactored diff --git a/erpnext/education/doctype/academic_term/test_academic_term.py b/erpnext/education/doctype/academic_term/test_academic_term.py index 4581afc4ac33..bf5ca700ae4e 100644 --- a/erpnext/education/doctype/academic_term/test_academic_term.py +++ b/erpnext/education/doctype/academic_term/test_academic_term.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Academic Term') diff --git a/erpnext/education/doctype/academic_year/academic_year.py b/erpnext/education/doctype/academic_year/academic_year.py index 9aeeed0d00ff..77b67d8a5d7f 100644 --- a/erpnext/education/doctype/academic_year/academic_year.py +++ b/erpnext/education/doctype/academic_year/academic_year.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ from frappe.model.document import Document diff --git a/erpnext/education/doctype/academic_year/test_academic_year.py b/erpnext/education/doctype/academic_year/test_academic_year.py index ca6bb7f65ba0..aa9feccf197b 100644 --- a/erpnext/education/doctype/academic_year/test_academic_year.py +++ b/erpnext/education/doctype/academic_year/test_academic_year.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Academic Year') diff --git a/erpnext/education/doctype/article/test_article.py b/erpnext/education/doctype/article/test_article.py index 8de405088a7f..74c71f1c68e1 100644 --- a/erpnext/education/doctype/article/test_article.py +++ b/erpnext/education/doctype/article/test_article.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestArticle(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py index 879cad3446b1..a8649d981c99 100644 --- a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py +++ b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Assessment Criteria') diff --git a/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py index f0901b0d3c2c..e62c0305520e 100644 --- a/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py +++ b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py index 83148a119dec..5f65356c2d87 100644 --- a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py +++ b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Assessment Criteria Group') diff --git a/erpnext/education/doctype/assessment_group/assessment_group.py b/erpnext/education/doctype/assessment_group/assessment_group.py index 166e2af0feae..3425109331fd 100644 --- a/erpnext/education/doctype/assessment_group/assessment_group.py +++ b/erpnext/education/doctype/assessment_group/assessment_group.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_group/test_assessment_group.py b/erpnext/education/doctype/assessment_group/test_assessment_group.py index 80b8d3edf111..6524fd81018b 100644 --- a/erpnext/education/doctype/assessment_group/test_assessment_group.py +++ b/erpnext/education/doctype/assessment_group/test_assessment_group.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Assessment Group') diff --git a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py index 16f37f8abbaa..7278fa2b99ab 100644 --- a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py +++ b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Assessment Plan') diff --git a/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py index bcfd73024285..795462d6308c 100644 --- a/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py +++ b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_result/test_assessment_result.py b/erpnext/education/doctype/assessment_result/test_assessment_result.py index 2b4f22badc11..b7911df47a3e 100644 --- a/erpnext/education/doctype/assessment_result/test_assessment_result.py +++ b/erpnext/education/doctype/assessment_result/test_assessment_result.py @@ -5,7 +5,6 @@ import unittest -import frappe from erpnext.education.api import get_grade diff --git a/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py index 48eff847e1dc..234dff044f51 100644 --- a/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py +++ b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py index d10820003821..83b4f5634e93 100644 --- a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py +++ b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py index 1e6dcbb8ecd3..70a271143c8c 100644 --- a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py +++ b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestAssessmentResultTool(unittest.TestCase): diff --git a/erpnext/education/doctype/content_activity/content_activity.py b/erpnext/education/doctype/content_activity/content_activity.py index 7a0843394bd6..076e2d37c001 100644 --- a/erpnext/education/doctype/content_activity/content_activity.py +++ b/erpnext/education/doctype/content_activity/content_activity.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/content_question/content_question.py b/erpnext/education/doctype/content_question/content_question.py index 9e8773845e66..9c2491697de6 100644 --- a/erpnext/education/doctype/content_question/content_question.py +++ b/erpnext/education/doctype/content_question/content_question.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/content_question/test_content_question.py b/erpnext/education/doctype/content_question/test_content_question.py index bc0a4f85f0c3..8de51f0edaba 100644 --- a/erpnext/education/doctype/content_question/test_content_question.py +++ b/erpnext/education/doctype/content_question/test_content_question.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestContentQuestion(unittest.TestCase): diff --git a/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py index 7ffce22da0d0..df384c53143e 100644 --- a/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py +++ b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/course_content/course_content.py b/erpnext/education/doctype/course_content/course_content.py index 67691dde637b..1dd08adbb013 100644 --- a/erpnext/education/doctype/course_content/course_content.py +++ b/erpnext/education/doctype/course_content/course_content.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/course_content/test_course_content.py b/erpnext/education/doctype/course_content/test_course_content.py index accf005feccf..8dfaafa9492d 100644 --- a/erpnext/education/doctype/course_content/test_course_content.py +++ b/erpnext/education/doctype/course_content/test_course_content.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCourseContent(unittest.TestCase): diff --git a/erpnext/education/doctype/course_schedule/test_course_schedule.py b/erpnext/education/doctype/course_schedule/test_course_schedule.py index 247bfb0ad334..1b45ceda484f 100644 --- a/erpnext/education/doctype/course_schedule/test_course_schedule.py +++ b/erpnext/education/doctype/course_schedule/test_course_schedule.py @@ -8,7 +8,6 @@ import frappe from frappe.utils import to_timedelta, today -from frappe.utils.make_random import get_random from erpnext.education.utils import OverlapError diff --git a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py index c7c3f47e980c..baa40e316bfc 100644 --- a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py +++ b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCourseSchedulingTool(unittest.TestCase): diff --git a/erpnext/education/doctype/course_topic/course_topic.py b/erpnext/education/doctype/course_topic/course_topic.py index fabe60a074ef..11eb457b7c3f 100644 --- a/erpnext/education/doctype/course_topic/course_topic.py +++ b/erpnext/education/doctype/course_topic/course_topic.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/course_topic/test_course_topic.py b/erpnext/education/doctype/course_topic/test_course_topic.py index 8f224e985a44..306957958555 100644 --- a/erpnext/education/doctype/course_topic/test_course_topic.py +++ b/erpnext/education/doctype/course_topic/test_course_topic.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCourseTopic(unittest.TestCase): diff --git a/erpnext/education/doctype/education_settings/test_education_settings.py b/erpnext/education/doctype/education_settings/test_education_settings.py index aca1de9c74c7..acc82bd6f7fa 100644 --- a/erpnext/education/doctype/education_settings/test_education_settings.py +++ b/erpnext/education/doctype/education_settings/test_education_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEducationSettings(unittest.TestCase): diff --git a/erpnext/education/doctype/fee_category/fee_category.py b/erpnext/education/doctype/fee_category/fee_category.py index ebfa2f953bf9..f531f8af6ee9 100644 --- a/erpnext/education/doctype/fee_category/fee_category.py +++ b/erpnext/education/doctype/fee_category/fee_category.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/fee_category/test_fee_category.py b/erpnext/education/doctype/fee_category/test_fee_category.py index 0bdd78da4997..3f859c78e92f 100644 --- a/erpnext/education/doctype/fee_category/test_fee_category.py +++ b/erpnext/education/doctype/fee_category/test_fee_category.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Fee Category') diff --git a/erpnext/education/doctype/fee_component/fee_component.py b/erpnext/education/doctype/fee_component/fee_component.py index b370d11246c4..dba39af59482 100644 --- a/erpnext/education/doctype/fee_component/fee_component.py +++ b/erpnext/education/doctype/fee_component/fee_component.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/fee_structure/test_fee_structure.py b/erpnext/education/doctype/fee_structure/test_fee_structure.py index 762e83da152c..57a0efa42a2e 100644 --- a/erpnext/education/doctype/fee_structure/test_fee_structure.py +++ b/erpnext/education/doctype/fee_structure/test_fee_structure.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Fee Structure') diff --git a/erpnext/education/doctype/fees/fees.py b/erpnext/education/doctype/fees/fees.py index 4586a00138d4..a5dc0dca31c7 100644 --- a/erpnext/education/doctype/fees/fees.py +++ b/erpnext/education/doctype/fees/fees.py @@ -6,7 +6,6 @@ import frappe from frappe import _ -from frappe.model.document import Document from frappe.utils import money_in_words from frappe.utils.csvutils import getlink diff --git a/erpnext/education/doctype/grading_scale/test_grading_scale.py b/erpnext/education/doctype/grading_scale/test_grading_scale.py index 043d0f1d4308..fc4c9cd997c7 100644 --- a/erpnext/education/doctype/grading_scale/test_grading_scale.py +++ b/erpnext/education/doctype/grading_scale/test_grading_scale.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Grading Scale') diff --git a/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py index 7c6533e1b4ac..6e55aac40ba5 100644 --- a/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py +++ b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/guardian/test_guardian.py b/erpnext/education/doctype/guardian/test_guardian.py index 4dba6a248da0..72ea9b494da2 100644 --- a/erpnext/education/doctype/guardian/test_guardian.py +++ b/erpnext/education/doctype/guardian/test_guardian.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Guardian') diff --git a/erpnext/education/doctype/guardian_interest/guardian_interest.py b/erpnext/education/doctype/guardian_interest/guardian_interest.py index 5a909c6ed599..4a3040f06008 100644 --- a/erpnext/education/doctype/guardian_interest/guardian_interest.py +++ b/erpnext/education/doctype/guardian_interest/guardian_interest.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/guardian_student/guardian_student.py b/erpnext/education/doctype/guardian_student/guardian_student.py index 758da58cb2ad..62867d89089b 100644 --- a/erpnext/education/doctype/guardian_student/guardian_student.py +++ b/erpnext/education/doctype/guardian_student/guardian_student.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/instructor/test_instructor.py b/erpnext/education/doctype/instructor/test_instructor.py index cf5aa1021910..0ab512182d76 100644 --- a/erpnext/education/doctype/instructor/test_instructor.py +++ b/erpnext/education/doctype/instructor/test_instructor.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Instructor') diff --git a/erpnext/education/doctype/instructor_log/instructor_log.py b/erpnext/education/doctype/instructor_log/instructor_log.py index b1198260ddc6..68ab7a639e95 100644 --- a/erpnext/education/doctype/instructor_log/instructor_log.py +++ b/erpnext/education/doctype/instructor_log/instructor_log.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/options/options.py b/erpnext/education/doctype/options/options.py index 98d80659ead6..a064384129bb 100644 --- a/erpnext/education/doctype/options/options.py +++ b/erpnext/education/doctype/options/options.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/program_course/program_course.py b/erpnext/education/doctype/program_course/program_course.py index 3bc95c33dad9..d5236a109a46 100644 --- a/erpnext/education/doctype/program_course/program_course.py +++ b/erpnext/education/doctype/program_course/program_course.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index 1a417d4a4a65..cc1a8a095026 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -6,11 +6,10 @@ import frappe from frappe import _, msgprint -from frappe.desk.reportview import get_filters_cond, get_match_cond +from frappe.desk.reportview import get_match_cond from frappe.model.document import Document from frappe.utils import comma_and, get_link_to_form, getdate -import erpnext.www.lms as lms class ProgramEnrollment(Document): diff --git a/erpnext/education/doctype/program_enrollment/test_program_enrollment.py b/erpnext/education/doctype/program_enrollment/test_program_enrollment.py index a3ebec58ab62..65de38af2ddf 100644 --- a/erpnext/education/doctype/program_enrollment/test_program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/test_program_enrollment.py @@ -7,7 +7,6 @@ import frappe -from erpnext.education.doctype.course_activity.test_course_activity import make_course_activity from erpnext.education.doctype.program.test_program import make_program_and_linked_courses from erpnext.education.doctype.student.test_student import create_student, get_student diff --git a/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py index c1741f60b454..5c0706dbce16 100644 --- a/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py +++ b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py index 4b96836503d9..53bae7c1504c 100644 --- a/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py +++ b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py index 7e0a45fcdd8c..973174d7f304 100644 --- a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py +++ b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestProgramEnrollmentTool(unittest.TestCase): diff --git a/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py index 921c4054f384..67653458f5fd 100644 --- a/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py +++ b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/program_fee/program_fee.py b/erpnext/education/doctype/program_fee/program_fee.py index c6f0449f52d7..70105ee6be97 100644 --- a/erpnext/education/doctype/program_fee/program_fee.py +++ b/erpnext/education/doctype/program_fee/program_fee.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/question/test_question.py b/erpnext/education/doctype/question/test_question.py index 34c8c12bdbbb..7d04f23223c0 100644 --- a/erpnext/education/doctype/question/test_question.py +++ b/erpnext/education/doctype/question/test_question.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQuestion(unittest.TestCase): diff --git a/erpnext/education/doctype/quiz/quiz.py b/erpnext/education/doctype/quiz/quiz.py index 6ba8c7c42e8c..a982cbe1d323 100644 --- a/erpnext/education/doctype/quiz/quiz.py +++ b/erpnext/education/doctype/quiz/quiz.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ diff --git a/erpnext/education/doctype/quiz/test_quiz.py b/erpnext/education/doctype/quiz/test_quiz.py index 234bf4f041fd..4a7307199a83 100644 --- a/erpnext/education/doctype/quiz/test_quiz.py +++ b/erpnext/education/doctype/quiz/test_quiz.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQuiz(unittest.TestCase): diff --git a/erpnext/education/doctype/quiz_activity/quiz_activity.py b/erpnext/education/doctype/quiz_activity/quiz_activity.py index 4245ac04671f..0fc76032283e 100644 --- a/erpnext/education/doctype/quiz_activity/quiz_activity.py +++ b/erpnext/education/doctype/quiz_activity/quiz_activity.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py index 9b815ded07c2..8b609e910a0e 100644 --- a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py +++ b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQuizActivity(unittest.TestCase): diff --git a/erpnext/education/doctype/quiz_question/quiz_question.py b/erpnext/education/doctype/quiz_question/quiz_question.py index f228f50e2562..20cb9f7b38c1 100644 --- a/erpnext/education/doctype/quiz_question/quiz_question.py +++ b/erpnext/education/doctype/quiz_question/quiz_question.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/quiz_result/quiz_result.py b/erpnext/education/doctype/quiz_result/quiz_result.py index 64436bc5d55f..059d294cff64 100644 --- a/erpnext/education/doctype/quiz_result/quiz_result.py +++ b/erpnext/education/doctype/quiz_result/quiz_result.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/quiz_result/test_quiz_result.py b/erpnext/education/doctype/quiz_result/test_quiz_result.py index e5a2108e7008..38b23698c652 100644 --- a/erpnext/education/doctype/quiz_result/test_quiz_result.py +++ b/erpnext/education/doctype/quiz_result/test_quiz_result.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQuizResult(unittest.TestCase): diff --git a/erpnext/education/doctype/room/room.py b/erpnext/education/doctype/room/room.py index 1b28268ff467..dc68a0dd0cf8 100644 --- a/erpnext/education/doctype/room/room.py +++ b/erpnext/education/doctype/room/room.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/room/test_room.py b/erpnext/education/doctype/room/test_room.py index 317781c291bf..b11f9999ef1c 100644 --- a/erpnext/education/doctype/room/test_room.py +++ b/erpnext/education/doctype/room/test_room.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Room') diff --git a/erpnext/education/doctype/school_house/school_house.py b/erpnext/education/doctype/school_house/school_house.py index 129c61b3fac1..2f9c5f46a801 100644 --- a/erpnext/education/doctype/school_house/school_house.py +++ b/erpnext/education/doctype/school_house/school_house.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/school_house/test_school_house.py b/erpnext/education/doctype/school_house/test_school_house.py index 53153af9a425..4b4f8378ee5b 100644 --- a/erpnext/education/doctype/school_house/test_school_house.py +++ b/erpnext/education/doctype/school_house/test_school_house.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestSchoolHouse(unittest.TestCase): diff --git a/erpnext/education/doctype/student/test_student.py b/erpnext/education/doctype/student/test_student.py index a6e4423dd37c..ec6abb56efbc 100644 --- a/erpnext/education/doctype/student/test_student.py +++ b/erpnext/education/doctype/student/test_student.py @@ -6,9 +6,7 @@ import unittest import frappe -from frappe.test_runner import make_test_records -from erpnext.education.doctype.course.test_course import make_course from erpnext.education.doctype.program.test_program import make_program_and_linked_courses test_records = frappe.get_test_records('Student') diff --git a/erpnext/education/doctype/student_admission/test_student_admission.py b/erpnext/education/doctype/student_admission/test_student_admission.py index 918d3689201e..ed91fcf3d6a5 100644 --- a/erpnext/education/doctype/student_admission/test_student_admission.py +++ b/erpnext/education/doctype/student_admission/test_student_admission.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Admission') diff --git a/erpnext/education/doctype/student_applicant/test_student_applicant.py b/erpnext/education/doctype/student_applicant/test_student_applicant.py index adea988c4e93..9402b7267879 100644 --- a/erpnext/education/doctype/student_applicant/test_student_applicant.py +++ b/erpnext/education/doctype/student_applicant/test_student_applicant.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Applicant') diff --git a/erpnext/education/doctype/student_attendance/test_student_attendance.py b/erpnext/education/doctype/student_attendance/test_student_attendance.py index b662404a9654..6cf74e6231c3 100644 --- a/erpnext/education/doctype/student_attendance/test_student_attendance.py +++ b/erpnext/education/doctype/student_attendance/test_student_attendance.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Attendance') diff --git a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py index fdf8b8a92196..5052503ab3b3 100644 --- a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py +++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestStudentAttendanceTool(unittest.TestCase): diff --git a/erpnext/education/doctype/student_batch_name/student_batch_name.py b/erpnext/education/doctype/student_batch_name/student_batch_name.py index f4a9cb69a555..ce507160e053 100644 --- a/erpnext/education/doctype/student_batch_name/student_batch_name.py +++ b/erpnext/education/doctype/student_batch_name/student_batch_name.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py index 816c36ac16d3..3312027b1931 100644 --- a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py +++ b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Batch Name') diff --git a/erpnext/education/doctype/student_category/student_category.py b/erpnext/education/doctype/student_category/student_category.py index c5dfe3c352c9..bb362d5834a5 100644 --- a/erpnext/education/doctype/student_category/student_category.py +++ b/erpnext/education/doctype/student_category/student_category.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_category/test_student_category.py b/erpnext/education/doctype/student_category/test_student_category.py index b34d9376fc07..a683d4915688 100644 --- a/erpnext/education/doctype/student_category/test_student_category.py +++ b/erpnext/education/doctype/student_category/test_student_category.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Category') diff --git a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py index a2fd0a368d3f..d77bc2fc98b7 100644 --- a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py +++ b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestStudentGroupCreationTool(unittest.TestCase): diff --git a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py index 000b51685c58..b9d1e0d7fe79 100644 --- a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py +++ b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py index 5ec6c52e9499..81a7ed25af5e 100644 --- a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py +++ b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_group_student/student_group_student.py b/erpnext/education/doctype/student_group_student/student_group_student.py index 2737d538a14d..7ee4caec5e33 100644 --- a/erpnext/education/doctype/student_group_student/student_group_student.py +++ b/erpnext/education/doctype/student_group_student/student_group_student.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_guardian/student_guardian.py b/erpnext/education/doctype/student_guardian/student_guardian.py index cef740551b50..56d7df7d0a88 100644 --- a/erpnext/education/doctype/student_guardian/student_guardian.py +++ b/erpnext/education/doctype/student_guardian/student_guardian.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_language/student_language.py b/erpnext/education/doctype/student_language/student_language.py index 65a6bc5c90f6..6ec0b1fc6e1c 100644 --- a/erpnext/education/doctype/student_language/student_language.py +++ b/erpnext/education/doctype/student_language/student_language.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_language/test_student_language.py b/erpnext/education/doctype/student_language/test_student_language.py index 8cc25c3a7807..add64cb47892 100644 --- a/erpnext/education/doctype/student_language/test_student_language.py +++ b/erpnext/education/doctype/student_language/test_student_language.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Language') diff --git a/erpnext/education/doctype/student_log/student_log.py b/erpnext/education/doctype/student_log/student_log.py index d90b2866d350..2ca49ca12d31 100644 --- a/erpnext/education/doctype/student_log/student_log.py +++ b/erpnext/education/doctype/student_log/student_log.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_log/test_student_log.py b/erpnext/education/doctype/student_log/test_student_log.py index bb7b8787a505..882a2ed53fce 100644 --- a/erpnext/education/doctype/student_log/test_student_log.py +++ b/erpnext/education/doctype/student_log/test_student_log.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Student Log') diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py index ff9b9052c9fd..1cf792131508 100644 --- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py +++ b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py @@ -11,7 +11,6 @@ from frappe.model.document import Document from frappe.utils.pdf import get_pdf -from erpnext.education.api import get_grade from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import ( get_child_assessment_groups, get_formatted_result, diff --git a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py index 11832f85a92b..4226effca4c2 100644 --- a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py +++ b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestStudentReportGenerationTool(unittest.TestCase): diff --git a/erpnext/education/doctype/student_sibling/student_sibling.py b/erpnext/education/doctype/student_sibling/student_sibling.py index bc9ddedaa488..b36cf59dbb34 100644 --- a/erpnext/education/doctype/student_sibling/student_sibling.py +++ b/erpnext/education/doctype/student_sibling/student_sibling.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/student_siblings/student_siblings.py b/erpnext/education/doctype/student_siblings/student_siblings.py index ed731a1555ce..412cf050c163 100644 --- a/erpnext/education/doctype/student_siblings/student_siblings.py +++ b/erpnext/education/doctype/student_siblings/student_siblings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/doctype/topic_content/test_topic_content.py b/erpnext/education/doctype/topic_content/test_topic_content.py index 2ff50fa66b92..9c58dea65fa7 100644 --- a/erpnext/education/doctype/topic_content/test_topic_content.py +++ b/erpnext/education/doctype/topic_content/test_topic_content.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestTopicContent(unittest.TestCase): diff --git a/erpnext/education/doctype/topic_content/topic_content.py b/erpnext/education/doctype/topic_content/topic_content.py index 984b1ae322f8..9339bbde5aa9 100644 --- a/erpnext/education/doctype/topic_content/topic_content.py +++ b/erpnext/education/doctype/topic_content/topic_content.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py index 4a43912f6d98..ad07ee1949ca 100644 --- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py +++ b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py @@ -7,7 +7,6 @@ import frappe from frappe import _ -from frappe.utils import flt from erpnext.education.api import get_grade diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py index 7abdc64e8e7e..2e4543043b43 100644 --- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py +++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py @@ -3,11 +3,10 @@ from __future__ import unicode_literals -from calendar import monthrange import frappe -from frappe import _, msgprint -from frappe.utils import add_days, cint, cstr, date_diff, get_first_day, get_last_day, getdate +from frappe import _ +from frappe.utils import add_days, cstr, date_diff, get_first_day, get_last_day, getdate from erpnext.education.api import get_student_group_students from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list diff --git a/erpnext/education/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/education/web_form/student_applicant/student_applicant.py +++ b/erpnext/education/web_form/student_applicant/student_applicant.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py index 03c05570bc84..a440f672b382 100755 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py @@ -10,10 +10,8 @@ import hashlib import hmac import re -import urllib from urllib.parse import quote -import six from erpnext.erpnext_integrations.doctype.amazon_mws_settings import xml_utils diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py index d6077ae136f6..4cf66ef2dac3 100644 --- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py +++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQuickBooksMigrator(unittest.TestCase): diff --git a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py index a1ac2e2726d5..2bef90ef6929 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py +++ b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Shopify Log') diff --git a/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py b/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py index dd0a7d61b4a9..fc7e49b17153 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py +++ b/erpnext/erpnext_integrations/doctype/shopify_tax_account/shopify_tax_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py b/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py index bf43b0638de4..881f45b1be9e 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py +++ b/erpnext/erpnext_integrations/doctype/shopify_webhook_detail/shopify_webhook_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py index 83b521e61693..e1e7f62df4e1 100644 --- a/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py +++ b/erpnext/erpnext_integrations/doctype/tally_migration/tally_migration.py @@ -16,7 +16,6 @@ from frappe import _ from frappe.custom.doctype.custom_field.custom_field import create_custom_field from frappe.model.document import Document -from frappe.model.naming import getseries, revert_series_if_last from frappe.utils.data import format_datetime from erpnext import encode_company_abbr diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py index 4e88549dd59d..47cc1d5a0e9d 100644 --- a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py +++ b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestTallyMigration(unittest.TestCase): diff --git a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py index ba78fddd8e02..df4c2ef9055f 100644 --- a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py +++ b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py @@ -8,7 +8,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe.utils import cstr, flt, nowdate, nowtime +from frappe.utils import flt, nowdate, nowtime from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account from erpnext.healthcare.doctype.lab_test.lab_test import create_sample_doc diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py index 314700ab1cee..4550e7ab4c2a 100644 --- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py +++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py @@ -10,7 +10,6 @@ delete_contact_and_address, load_address_and_contact, ) -from frappe.desk.reportview import build_match_conditions, get_filters_cond from frappe.model.document import Document from frappe.model.naming import append_number_if_name_exists diff --git a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py index 538062bec843..b28e37a9c31b 100644 --- a/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py +++ b/erpnext/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, get_link_to_form, getdate, nowtime +from frappe.utils import flt, get_link_to_form from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account from erpnext.stock.utils import get_latest_stock_qty diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py index f9c47a9ef1e1..7db497c24d7c 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/lab_test.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cstr, get_link_to_form, getdate +from frappe.utils import get_link_to_form, getdate class LabTest(Document): diff --git a/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py index 15fe764e1963..d9c2fbfb3a70 100644 --- a/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py @@ -7,7 +7,6 @@ import frappe from frappe.utils import add_days, now_datetime, nowdate -from frappe.utils.make_random import get_random from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from erpnext.healthcare.doctype.patient_appointment.patient_appointment import ( diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py index d32611b96500..2daa6c145c81 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py @@ -8,7 +8,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe.utils import add_days, cstr, getdate +from frappe.utils import add_days, getdate class PatientEncounter(Document): diff --git a/erpnext/healthcare/doctype/therapy_session/therapy_session.py b/erpnext/healthcare/doctype/therapy_session/therapy_session.py index dcc739c46174..915e6e42f4c0 100644 --- a/erpnext/healthcare/doctype/therapy_session/therapy_session.py +++ b/erpnext/healthcare/doctype/therapy_session/therapy_session.py @@ -10,7 +10,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc -from frappe.utils import cstr, flt, get_link_to_form, get_time, getdate +from frappe.utils import flt, get_link_to_form, get_time, getdate from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import ( get_income_account, diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py index d4dd3590b24a..29dbeb470ddd 100644 --- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py +++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py @@ -7,7 +7,6 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cstr class VitalSigns(Document): diff --git a/erpnext/healthcare/page/patient_history/patient_history.py b/erpnext/healthcare/page/patient_history/patient_history.py index 11d47f546e58..96e6fc5fb3b6 100644 --- a/erpnext/healthcare/page/patient_history/patient_history.py +++ b/erpnext/healthcare/page/patient_history/patient_history.py @@ -9,7 +9,6 @@ import frappe from frappe.utils import cint -from erpnext.healthcare.utils import render_docs_as_html @frappe.whitelist() diff --git a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py index 918d0dc11261..634a5c5a511d 100644 --- a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py +++ b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py @@ -5,7 +5,6 @@ import unittest -import frappe test_dependencies = ["Hotel Room Package"] test_records = [ diff --git a/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py b/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py index aa86d0c1c075..982b3ef911d1 100644 --- a/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py +++ b/erpnext/hotels/doctype/hotel_room_amenity/hotel_room_amenity.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py index f369031dc145..0c8593eef020 100644 --- a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py +++ b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py @@ -5,7 +5,6 @@ import unittest -import frappe test_records = [ dict(doctype='Item', item_code='Breakfast', diff --git a/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py b/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py index 90696cfbc986..5797fef30db0 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py +++ b/erpnext/hotels/doctype/hotel_room_pricing/hotel_room_pricing.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py index a3298ebf04a6..5d2dc18a132b 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py +++ b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py @@ -5,7 +5,6 @@ import unittest -import frappe test_dependencies = ["Hotel Room Package"] test_records = [ diff --git a/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py b/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py index ccc02ee96e10..4a344df84859 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_item/hotel_room_pricing_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py b/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py index e12a2a52612d..f594ac709ecb 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_package/hotel_room_pricing_package.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py index 186527a2b5d5..e82c7afa0484 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestHotelRoomPricingPackage(unittest.TestCase): diff --git a/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py b/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py index 04679910a39e..0cf854722e10 100644 --- a/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py +++ b/erpnext/hotels/doctype/hotel_room_reservation_item/hotel_room_reservation_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py b/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py index 5793077acbea..610cf181c1dc 100644 --- a/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py +++ b/erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py index 05148177e74e..4d0b7135180b 100644 --- a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py +++ b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestHotelRoomType(unittest.TestCase): diff --git a/erpnext/hotels/doctype/hotel_settings/hotel_settings.py b/erpnext/hotels/doctype/hotel_settings/hotel_settings.py index 4d16a9d3502f..f8f8fe964daf 100644 --- a/erpnext/hotels/doctype/hotel_settings/hotel_settings.py +++ b/erpnext/hotels/doctype/hotel_settings/hotel_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py index 90ddd1660eb3..fa782f277755 100644 --- a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py +++ b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestHotelSettings(unittest.TestCase): diff --git a/erpnext/hr/doctype/appraisal/test_appraisal.py b/erpnext/hr/doctype/appraisal/test_appraisal.py index 93b50e00f5ae..3c223d22d634 100644 --- a/erpnext/hr/doctype/appraisal/test_appraisal.py +++ b/erpnext/hr/doctype/appraisal/test_appraisal.py @@ -4,7 +4,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Appraisal') diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py index f73d035495ab..d9789a028bdf 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py index 3b29b3e04940..d55233436fdf 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py index d84370eb1318..e543a9f6c850 100644 --- a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py @@ -4,7 +4,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Appraisal Template') diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py index baeae62b5201..1b15fbd51e10 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index a2d2af64e08f..002f9bbcac21 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -135,7 +135,6 @@ def mark_attendance(employee, attendance_date, status, shift=None, leave_type=No @frappe.whitelist() def mark_bulk_attendance(data): import json - from pprint import pprint if isinstance(data, str): data = json.loads(data) data = frappe._dict(data) diff --git a/erpnext/hr/doctype/attendance/attendance_dashboard.py b/erpnext/hr/doctype/attendance/attendance_dashboard.py index ca9fb9d47bb3..e1d793a44a4f 100644 --- a/erpnext/hr/doctype/attendance/attendance_dashboard.py +++ b/erpnext/hr/doctype/attendance/attendance_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/branch/branch.py b/erpnext/hr/doctype/branch/branch.py index ae987a39036b..c770dc340906 100644 --- a/erpnext/hr/doctype/branch/branch.py +++ b/erpnext/hr/doctype/branch/branch.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py index 8be8bd6c80c4..94a4c0e4d57a 100644 --- a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +++ b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py @@ -11,7 +11,6 @@ from frappe.utils import global_date_format from six import string_types -from erpnext.hr.doctype.employee.employee import is_holiday class DailyWorkSummary(Document): diff --git a/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py b/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py index 65fa5b4ee6da..d69a7fbf987b 100644 --- a/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py +++ b/erpnext/hr/doctype/daily_work_summary_group_user/daily_work_summary_group_user.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py index a606708fbb6c..b4771b3fed05 100644 --- a/erpnext/hr/doctype/department/department.py +++ b/erpnext/hr/doctype/department/department.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe.model.document import Document from frappe.utils.nestedset import NestedSet, get_root_of from erpnext.utilities.transaction_base import delete_events diff --git a/erpnext/hr/doctype/designation/designation.py b/erpnext/hr/doctype/designation/designation.py index f2e0893bff64..0291a992cd9f 100644 --- a/erpnext/hr/doctype/designation/designation.py +++ b/erpnext/hr/doctype/designation/designation.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py index 06c05d5c1c5a..523646671083 100644 --- a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py +++ b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py b/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py index cfc50a1dbadf..48c85f48aa2c 100644 --- a/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py +++ b/erpnext/hr/doctype/employee_boarding_activity/employee_boarding_activity.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_checkin/employee_checkin.py b/erpnext/hr/doctype/employee_checkin/employee_checkin.py index 98ead42c17d8..1ae9b1fa829f 100644 --- a/erpnext/hr/doctype/employee_checkin/employee_checkin.py +++ b/erpnext/hr/doctype/employee_checkin/employee_checkin.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, get_datetime, now +from frappe.utils import cint, get_datetime from erpnext.hr.doctype.shift_assignment.shift_assignment import ( get_actual_start_end_datetime_of_shift, diff --git a/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py b/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py index 7e3637e6f454..71c6498dd7c2 100644 --- a/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py +++ b/erpnext/hr/doctype/employee_checkin/test_employee_checkin.py @@ -7,7 +7,7 @@ from datetime import timedelta import frappe -from frappe.utils import now_datetime, nowdate, to_timedelta +from frappe.utils import now_datetime, nowdate from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.employee_checkin.employee_checkin import ( diff --git a/erpnext/hr/doctype/employee_education/employee_education.py b/erpnext/hr/doctype/employee_education/employee_education.py index 6229ad2f74b6..cadf5d645949 100644 --- a/erpnext/hr/doctype/employee_education/employee_education.py +++ b/erpnext/hr/doctype/employee_education/employee_education.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py index aa616eb709cb..4d0e8d9b74a0 100644 --- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py +++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_grade/employee_grade.py b/erpnext/hr/doctype/employee_grade/employee_grade.py index 9c464201856c..b097038b5c20 100644 --- a/erpnext/hr/doctype/employee_grade/employee_grade.py +++ b/erpnext/hr/doctype/employee_grade/employee_grade.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_grade/test_employee_grade.py b/erpnext/hr/doctype/employee_grade/test_employee_grade.py index 2490f4ef50a6..42536f6e00cc 100644 --- a/erpnext/hr/doctype/employee_grade/test_employee_grade.py +++ b/erpnext/hr/doctype/employee_grade/test_employee_grade.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeGrade(unittest.TestCase): diff --git a/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py b/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py index 15a752e8c121..4f2d1a07653a 100644 --- a/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py +++ b/erpnext/hr/doctype/employee_health_insurance/employee_health_insurance.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py index 030e5dba0f0b..f24d6c34b74d 100644 --- a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py +++ b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeHealthInsurance(unittest.TestCase): diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py index d37ab908729f..6076abb3468a 100644 --- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py +++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py b/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py index 830b0e4d7532..526c2c9cde6a 100644 --- a/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py +++ b/erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py index fdf0d0d4bdd0..a46b3cdda399 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py index cb9951c1a61b..621a0499931d 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py index f317f4c4a776..e9ef548bb1b3 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py +++ b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeOnboardingTemplate(unittest.TestCase): diff --git a/erpnext/hr/doctype/employee_property_history/employee_property_history.py b/erpnext/hr/doctype/employee_property_history/employee_property_history.py index 613828752d41..9e2549284fb7 100644 --- a/erpnext/hr/doctype/employee_property_history/employee_property_history.py +++ b/erpnext/hr/doctype/employee_property_history/employee_property_history.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py index 1c91d9603647..7a263dcac107 100644 --- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py index acd525637b3f..f7ccb9a522c5 100644 --- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py index d246f484762d..48496373d1b5 100644 --- a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py +++ b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeSeparationTemplate(unittest.TestCase): diff --git a/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py b/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py index fa9a635b53a8..f67fd7c6564e 100644 --- a/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py +++ b/erpnext/hr/doctype/employee_transfer_property/employee_transfer_property.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py index e22604db8eee..247db3c91893 100644 --- a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py +++ b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeTransferProperty(unittest.TestCase): diff --git a/erpnext/hr/doctype/employment_type/employment_type.py b/erpnext/hr/doctype/employment_type/employment_type.py index 995d8e2021b4..e2a55570fd97 100644 --- a/erpnext/hr/doctype/employment_type/employment_type.py +++ b/erpnext/hr/doctype/employment_type/employment_type.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index fc903c526ab4..d785db7872c8 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -5,15 +5,11 @@ import frappe from frappe import _ -from frappe.model.document import Document -from frappe.utils import cstr, flt, get_fullname, get_link_to_form -from frappe.utils.csvutils import getlink +from frappe.utils import cstr, flt, get_link_to_form import erpnext from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.accounts.party import get_party_account -from erpnext.accounts.utils import get_account_currency from erpnext.controllers.accounts_controller import AccountsController from erpnext.hr.utils import set_employee_name, share_doc_with_approver, validate_active_employee diff --git a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py index 4dbf7ac0379a..a982002ebb49 100644 --- a/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py +++ b/erpnext/hr/doctype/expense_claim_account/expense_claim_account.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py b/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py index d773119b8094..5607f41d9170 100644 --- a/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py +++ b/erpnext/hr/doctype/expense_claim_advance/expense_claim_advance.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py index 2e8551e9f6d5..019e9f4dfe2d 100644 --- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py +++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py index 997f2e89eb87..8cf0a3f6ac4e 100644 --- a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py +++ b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Expense Claim Type') diff --git a/erpnext/hr/doctype/holiday/holiday.py b/erpnext/hr/doctype/holiday/holiday.py index bce0dda6c514..fbfe7563aa2b 100644 --- a/erpnext/hr/doctype/holiday/holiday.py +++ b/erpnext/hr/doctype/holiday/holiday.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/hr_settings/test_hr_settings.py b/erpnext/hr/doctype/hr_settings/test_hr_settings.py index 8df2064d6f46..5b05e84a5214 100644 --- a/erpnext/hr/doctype/hr_settings/test_hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/test_hr_settings.py @@ -4,12 +4,8 @@ from __future__ import unicode_literals import unittest -from datetime import timedelta -import frappe -from frappe.utils import now_datetime -from erpnext.hr.doctype.employee.test_employee import make_employee class TestHRSettings(unittest.TestCase): diff --git a/erpnext/hr/doctype/identification_document_type/identification_document_type.py b/erpnext/hr/doctype/identification_document_type/identification_document_type.py index d7e42a33fff7..862cd374fb45 100644 --- a/erpnext/hr/doctype/identification_document_type/identification_document_type.py +++ b/erpnext/hr/doctype/identification_document_type/identification_document_type.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py index bca211d73e6a..3fc4bc58186e 100644 --- a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py +++ b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestIdentificationDocumentType(unittest.TestCase): diff --git a/erpnext/hr/doctype/interest/interest.py b/erpnext/hr/doctype/interest/interest.py index 4378fea8cdc8..1b8f49f95855 100644 --- a/erpnext/hr/doctype/interest/interest.py +++ b/erpnext/hr/doctype/interest/interest.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/interest/test_interest.py b/erpnext/hr/doctype/interest/test_interest.py index 3ee1e39442fd..473cc1625d1c 100644 --- a/erpnext/hr/doctype/interest/test_interest.py +++ b/erpnext/hr/doctype/interest/test_interest.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Interest') diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index 0e329410ef16..b6df665cefc7 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/job_offer_term/job_offer_term.py b/erpnext/hr/doctype/job_offer_term/job_offer_term.py index 236d4aa8c74c..573cc6ae21d9 100644 --- a/erpnext/hr/doctype/job_offer_term/job_offer_term.py +++ b/erpnext/hr/doctype/job_offer_term/job_offer_term.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py index ca02e98c8d0d..f6213405d4be 100644 --- a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/job_opening/test_job_opening.py b/erpnext/hr/doctype/job_opening/test_job_opening.py index ab0ba5b36e3d..fade505aae67 100644 --- a/erpnext/hr/doctype/job_opening/test_job_opening.py +++ b/erpnext/hr/doctype/job_opening/test_job_opening.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Job Opening') diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index f69bdf76307b..e4886d7ae724 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -6,7 +6,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import add_days, date_diff, flt, formatdate, getdate, today +from frappe.utils import add_days, date_diff, flt, formatdate, getdate from erpnext.hr.doctype.leave_application.leave_application import get_approved_leaves_for_period from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import ( diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py index 369270795205..28d8062db850 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py index db2e71bda2fc..a258581e718d 100644 --- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py @@ -7,8 +7,7 @@ import erpnext from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import ( - expire_allocation, - process_expired_allocation, + process_expired_allocation ) from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index bbe4eab68810..b9c785a8a9c9 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -6,7 +6,7 @@ import frappe from frappe.permissions import clear_user_permissions_for_doctype -from frappe.utils import add_days, add_months, getdate, now_datetime, nowdate +from frappe.utils import add_days, add_months, getdate, nowdate from erpnext.hr.doctype.employee.test_employee import make_employee from erpnext.hr.doctype.leave_allocation.test_leave_allocation import create_leave_allocation diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py index e0cc0466c3d2..2f648470f733 100644 --- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py +++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py index 240b226e79e0..4a8f45dbcd15 100644 --- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py +++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index 16bedc4a1ad2..681a5e279436 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -6,7 +6,7 @@ import frappe from frappe import _, msgprint from frappe.model.document import Document -from frappe.utils import cint, comma_and, cstr, date_diff, flt, nowdate +from frappe.utils import cint, comma_and, cstr, flt class LeaveControlPanel(Document): diff --git a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py index 827f13be83c9..baa213ff165f 100644 --- a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestLeaveControlPanel(unittest.TestCase): diff --git a/erpnext/hr/doctype/leave_encashment/leave_encashment.py b/erpnext/hr/doctype/leave_encashment/leave_encashment.py index 58ef63ad8793..7656abfa45e8 100644 --- a/erpnext/hr/doctype/leave_encashment/leave_encashment.py +++ b/erpnext/hr/doctype/leave_encashment/leave_encashment.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, getdate, nowdate +from frappe.utils import getdate, nowdate from erpnext.hr.doctype.leave_allocation.leave_allocation import get_unused_leaves from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import create_leave_ledger_entry diff --git a/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py b/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py index 460661202eae..6cf96851556c 100644 --- a/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py +++ b/erpnext/hr/doctype/leave_ledger_entry/leave_ledger_entry.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import DATE_FORMAT, add_days, flt, getdate, today +from frappe.utils import DATE_FORMAT, flt, getdate, today class LeaveLedgerEntry(Document): diff --git a/erpnext/hr/doctype/leave_period/leave_period.py b/erpnext/hr/doctype/leave_period/leave_period.py index 45d6eed42cb1..143d23ab14b6 100644 --- a/erpnext/hr/doctype/leave_period/leave_period.py +++ b/erpnext/hr/doctype/leave_period/leave_period.py @@ -7,8 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import add_days, ceil, cstr, date_diff, getdate -from frappe.utils.background_jobs import enqueue +from frappe.utils import getdate from erpnext.hr.utils import validate_overlap diff --git a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py index be1f69c41d23..f62b3002194b 100644 --- a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py +++ b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py @@ -10,7 +10,7 @@ import frappe from frappe import _, bold from frappe.model.document import Document -from frappe.utils import comma_and, date_diff, flt, formatdate, get_datetime, getdate +from frappe.utils import date_diff, flt, formatdate, get_datetime, getdate from six import string_types diff --git a/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py b/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py index a9c7231d6ccd..f889424ee519 100644 --- a/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py +++ b/erpnext/hr/doctype/leave_policy_detail/leave_policy_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py index 9da034422959..0da34052dfa4 100644 --- a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py +++ b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestLeavePolicyDetail(unittest.TestCase): diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py index 109c0db8ce1a..1c0e41b8675d 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.py +++ b/erpnext/hr/doctype/leave_type/leave_type.py @@ -3,8 +3,6 @@ from __future__ import unicode_literals -import calendar -from datetime import datetime import frappe from frappe import _ diff --git a/erpnext/hr/doctype/leave_type/test_leave_type.py b/erpnext/hr/doctype/leave_type/test_leave_type.py index 048dddd3ef94..ee8db743f2ad 100644 --- a/erpnext/hr/doctype/leave_type/test_leave_type.py +++ b/erpnext/hr/doctype/leave_type/test_leave_type.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ test_records = frappe.get_test_records('Leave Type') diff --git a/erpnext/hr/doctype/offer_term/offer_term.py b/erpnext/hr/doctype/offer_term/offer_term.py index c6de54b2e2eb..5f8f591c97cf 100644 --- a/erpnext/hr/doctype/offer_term/offer_term.py +++ b/erpnext/hr/doctype/offer_term/offer_term.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/offer_term/test_offer_term.py b/erpnext/hr/doctype/offer_term/test_offer_term.py index 7afc23bc2d43..9a0ef8f4c237 100644 --- a/erpnext/hr/doctype/offer_term/test_offer_term.py +++ b/erpnext/hr/doctype/offer_term/test_offer_term.py @@ -4,7 +4,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Offer Term') diff --git a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py index 1512e90e3bd5..f66fd276a56a 100644 --- a/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py +++ b/erpnext/hr/doctype/purpose_of_travel/purpose_of_travel.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py index 58a55dfc8778..98f38422b285 100644 --- a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py +++ b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestPurposeofTravel(unittest.TestCase): diff --git a/erpnext/hr/doctype/shift_assignment/shift_assignment.py b/erpnext/hr/doctype/shift_assignment/shift_assignment.py index da2cf539e72b..69af5c54c3b6 100644 --- a/erpnext/hr/doctype/shift_assignment/shift_assignment.py +++ b/erpnext/hr/doctype/shift_assignment/shift_assignment.py @@ -9,7 +9,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, now_datetime, nowdate +from frappe.utils import cstr, getdate, now_datetime, nowdate from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py index 482d98810aad..5decf3991716 100644 --- a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py index 5d8719a3ac16..4bf2948e4c99 100644 --- a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/shift_type/test_shift_type.py b/erpnext/hr/doctype/shift_type/test_shift_type.py index 5faade060278..55eac7dbd915 100644 --- a/erpnext/hr/doctype/shift_type/test_shift_type.py +++ b/erpnext/hr/doctype/shift_type/test_shift_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestShiftType(unittest.TestCase): diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py index f941a76f5770..a04e7c83ab7c 100644 --- a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py index e85ee04d57e8..ea89df3ba6ec 100644 --- a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py +++ b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index 18b183508bf4..e0caa14a402c 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/hr/doctype/training_event_employee/training_event_employee.py b/erpnext/hr/doctype/training_event_employee/training_event_employee.py index 1ad28d6208f4..089235507a21 100644 --- a/erpnext/hr/doctype/training_event_employee/training_event_employee.py +++ b/erpnext/hr/doctype/training_event_employee/training_event_employee.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/training_result/test_training_result.py b/erpnext/hr/doctype/training_result/test_training_result.py index c0c5aadf0b8f..f39fefbca675 100644 --- a/erpnext/hr/doctype/training_result/test_training_result.py +++ b/erpnext/hr/doctype/training_result/test_training_result.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Training Result') diff --git a/erpnext/hr/doctype/training_result_employee/training_result_employee.py b/erpnext/hr/doctype/training_result_employee/training_result_employee.py index 9304241c3d49..b0d4605910c1 100644 --- a/erpnext/hr/doctype/training_result_employee/training_result_employee.py +++ b/erpnext/hr/doctype/training_result_employee/training_result_employee.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py index f389825cd55d..467ef16aaee8 100644 --- a/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py +++ b/erpnext/hr/doctype/travel_itinerary/travel_itinerary.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/travel_request/test_travel_request.py b/erpnext/hr/doctype/travel_request/test_travel_request.py index 7d5f6fa1ab6e..16bec98bd832 100644 --- a/erpnext/hr/doctype/travel_request/test_travel_request.py +++ b/erpnext/hr/doctype/travel_request/test_travel_request.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestTravelRequest(unittest.TestCase): diff --git a/erpnext/hr/doctype/travel_request/travel_request.py b/erpnext/hr/doctype/travel_request/travel_request.py index 5083a02c476d..b10333fd2d61 100644 --- a/erpnext/hr/doctype/travel_request/travel_request.py +++ b/erpnext/hr/doctype/travel_request/travel_request.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document from erpnext.hr.utils import validate_active_employee diff --git a/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py index 73aa1e72801a..9b38d888fcbc 100644 --- a/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py +++ b/erpnext/hr/doctype/travel_request_costing/travel_request_costing.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/doctype/vehicle/test_vehicle.py b/erpnext/hr/doctype/vehicle/test_vehicle.py index 97eae850162f..2bc94c650906 100644 --- a/erpnext/hr/doctype/vehicle/test_vehicle.py +++ b/erpnext/hr/doctype/vehicle/test_vehicle.py @@ -6,7 +6,7 @@ import unittest import frappe -from frappe.utils import cstr, flt, nowdate, random_string +from frappe.utils import random_string # test_records = frappe.get_test_records('Vehicle') diff --git a/erpnext/hr/doctype/vehicle_log/vehicle_log.py b/erpnext/hr/doctype/vehicle_log/vehicle_log.py index 48231cd33c83..73c848b03468 100644 --- a/erpnext/hr/doctype/vehicle_log/vehicle_log.py +++ b/erpnext/hr/doctype/vehicle_log/vehicle_log.py @@ -7,8 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.model.mapper import get_mapped_doc -from frappe.utils import cstr, flt +from frappe.utils import flt class VehicleLog(Document): diff --git a/erpnext/hr/doctype/vehicle_service/vehicle_service.py b/erpnext/hr/doctype/vehicle_service/vehicle_service.py index dfebc65c44a1..bc93a97481d2 100644 --- a/erpnext/hr/doctype/vehicle_service/vehicle_service.py +++ b/erpnext/hr/doctype/vehicle_service/vehicle_service.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hr/notification/training_feedback/training_feedback.py b/erpnext/hr/notification/training_feedback/training_feedback.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/hr/notification/training_feedback/training_feedback.py +++ b/erpnext/hr/notification/training_feedback/training_feedback.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/hr/notification/training_scheduled/training_scheduled.py b/erpnext/hr/notification/training_scheduled/training_scheduled.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/hr/notification/training_scheduled/training_scheduled.py +++ b/erpnext/hr/notification/training_scheduled/training_scheduled.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.py b/erpnext/hr/report/employee_birthday/employee_birthday.py index 63a6b1038433..b284e6babe65 100644 --- a/erpnext/hr/report/employee_birthday/employee_birthday.py +++ b/erpnext/hr/report/employee_birthday/employee_birthday.py @@ -5,7 +5,6 @@ import frappe from frappe import _ -from frappe.utils import flt def execute(filters=None): diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py index 6546e5fef029..6bca1368d3fe 100644 --- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py +++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py @@ -7,7 +7,7 @@ import frappe from frappe import _ -from frappe.utils import add_days, flt +from frappe.utils import add_days from erpnext.hr.doctype.leave_application.leave_application import ( get_leave_balance_on, diff --git a/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py b/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py index b0cf58418448..14ce9ed22a66 100644 --- a/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py +++ b/erpnext/hr/report/employee_leave_balance_summary/employee_leave_balance_summary.py @@ -5,7 +5,6 @@ import frappe from frappe import _ -from frappe.utils import flt from erpnext.hr.doctype.leave_application.leave_application import get_leave_details from erpnext.hr.report.employee_leave_balance.employee_leave_balance import ( diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py index 3481cd3307e2..2be3565a0590 100644 --- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py +++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.utils import flt -import erpnext from erpnext.accounts.report.financial_statements import get_period_list diff --git a/erpnext/hr/web_form/job_application/job_application.py b/erpnext/hr/web_form/job_application/job_application.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/hr/web_form/job_application/job_application.py +++ b/erpnext/hr/web_form/job_application/job_application.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py index 2ab86b22ad5c..823c79eb72b6 100644 --- a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py +++ b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py index c598abb0a6eb..1be78390ec5a 100644 --- a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py +++ b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestHubTrackedItem(unittest.TestCase): diff --git a/erpnext/hub_node/doctype/hub_user/hub_user.py b/erpnext/hub_node/doctype/hub_user/hub_user.py index 713e3bede434..1f7c8fc3f207 100644 --- a/erpnext/hub_node/doctype/hub_user/hub_user.py +++ b/erpnext/hub_node/doctype/hub_user/hub_user.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hub_node/doctype/hub_users/hub_users.py b/erpnext/hub_node/doctype/hub_users/hub_users.py index 60a4d10edf1d..e08ed68ed8f0 100644 --- a/erpnext/hub_node/doctype/hub_users/hub_users.py +++ b/erpnext/hub_node/doctype/hub_users/hub_users.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index e13bf00bfc22..54f0b60574d3 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -4,17 +4,12 @@ from __future__ import unicode_literals import json -import time import frappe -import requests -from frappe import _ from frappe.frappeclient import FrappeClient from frappe.model.document import Document -from frappe.utils import add_years, cint, get_datetime, get_datetime_str, now -from six import string_types +from frappe.utils import cint -from erpnext.utilities.product import get_price, get_qty_in_stock class MarketplaceSettings(Document): @@ -89,7 +84,6 @@ def get_connection(self): def unregister(self): """Disable the User on hubmarket.org""" - pass @frappe.whitelist() def is_marketplace_enabled(): diff --git a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py index 1f01f3348fd3..0a18efae7765 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestMarketplaceSettings(unittest.TestCase): diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py index 10bc1e6eecbd..7dbd42297e1f 100644 --- a/erpnext/loan_management/doctype/loan/loan.py +++ b/erpnext/loan_management/doctype/loan/loan.py @@ -9,7 +9,7 @@ import frappe from frappe import _ -from frappe.utils import add_months, flt, getdate, now_datetime, nowdate, rounded +from frappe.utils import add_months, flt, getdate, now_datetime, nowdate from six import string_types import erpnext diff --git a/erpnext/loan_management/doctype/loan/loan_dashboard.py b/erpnext/loan_management/doctype/loan/loan_dashboard.py index 4fe45c9199e2..3da999eeea98 100644 --- a/erpnext/loan_management/doctype/loan/loan_dashboard.py +++ b/erpnext/loan_management/doctype/loan/loan_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py index e6417d3e4720..d26315930a99 100644 --- a/erpnext/loan_management/doctype/loan/test_loan.py +++ b/erpnext/loan_management/doctype/loan/test_loan.py @@ -7,20 +7,15 @@ import frappe from frappe.utils import ( - add_days, + add_days, add_months, add_to_date, date_diff, flt, get_datetime, - get_first_day, - get_last_day, - getdate, - now_datetime, - nowdate, + nowdate ) -import erpnext from erpnext.loan_management.doctype.loan.loan import ( make_loan_write_off, request_loan_closure, diff --git a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py index a30b35cc86c7..08338641db13 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py index bbc46cce8a1d..6d9d4f490d35 100644 --- a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py +++ b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py @@ -6,8 +6,7 @@ import frappe from frappe import _ -from frappe.model.document import Document -from frappe.utils import add_days, flt, get_datetime, getdate, nowdate +from frappe.utils import add_days, flt, get_datetime, nowdate import erpnext from erpnext.accounts.general_ledger import make_gl_entries diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index c111c19920af..327a0a309cfb 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -6,18 +6,14 @@ import frappe from frappe import _ -from frappe.model.document import Document from frappe.utils import ( - add_days, + add_days, cint, date_diff, flt, get_datetime, - get_first_day, - get_last_day, getdate, - now_datetime, - nowdate, + nowdate ) import erpnext diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index a97bed4cef15..d9fd902d5511 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -7,14 +7,12 @@ import frappe from frappe.utils import ( - add_days, - add_to_date, + add_to_date, date_diff, flt, get_datetime, get_first_day, - get_last_day, - nowdate, + nowdate ) from erpnext.loan_management.doctype.loan.test_loan import ( diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index 6875c922951e..be57c539d1c8 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -4,20 +4,16 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ -from frappe.model.document import Document from frappe.utils import ( - add_days, - add_months, + add_days, cint, date_diff, flt, get_datetime, - get_first_day, - getdate, + getdate ) from six import iteritems diff --git a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py index af70b253fda1..4cf69ca7a188 100644 --- a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py index 0bc16bdaa4bb..ad918a763b29 100644 --- a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py +++ b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py @@ -8,14 +8,8 @@ from frappe import _ from frappe.model.document import Document from frappe.utils import ( - add_to_date, - get_datetime, - get_datetime_str, - get_timestamp, - getdate, - now_datetime, + get_datetime ) -from six import iteritems class LoanSecurityPrice(Document): diff --git a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py index bd4ebc720c9b..5863c03f0f43 100644 --- a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py @@ -7,7 +7,6 @@ import frappe from frappe.model.document import Document from frappe.utils import flt, get_datetime -from six import iteritems from erpnext.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import ( get_pledged_security_qty, diff --git a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py index 466b2fdcd364..9f44eefa61a9 100644 --- a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py index 9e8aee4580a4..584d9a29913a 100644 --- a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py +++ b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ @@ -12,9 +11,6 @@ from frappe.utils import flt, get_datetime, getdate from six import iteritems -from erpnext.loan_management.doctype.loan_security_price.loan_security_price import ( - get_loan_security_price, -) class LoanSecurityUnpledge(Document): diff --git a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py index c4c453a6a7e0..368b0553976c 100644 --- a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py index 642668ce400e..8c7783742fdb 100644 --- a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py index 5a171a15745a..c3f59543c4ea 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from frappe.model.document import Document from frappe.utils import get_datetime diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py index b88b4ee1189b..c4ab9863e3b1 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py index c29fed9a7439..ff527029f67a 100644 --- a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py +++ b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import flt, get_datetime +from frappe.utils import flt from six import iteritems import erpnext diff --git a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py index bd56685380c2..27c95a1ea2b2 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py +++ b/erpnext/maintenance/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py b/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py index 18240c61b2a2..9c4a690789dd 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py +++ b/erpnext/maintenance/doctype/maintenance_schedule_item/maintenance_schedule_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py index a25c5683e085..8e8db838e0e9 100644 --- a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py +++ b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Maintenance Visit') diff --git a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py index 2e7bed443db9..4c59562685d4 100644 --- a/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py +++ b/erpnext/maintenance/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/dashboard_fixtures.py b/erpnext/manufacturing/dashboard_fixtures.py index 33466f2b44ba..1bc12ff35eba 100644 --- a/erpnext/manufacturing/dashboard_fixtures.py +++ b/erpnext/manufacturing/dashboard_fixtures.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import add_months, get_first_day, get_last_day, nowdate +from frappe.utils import add_months, nowdate import erpnext diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py index ba384d8346b8..23d927f6332d 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 3846e2f7879e..1463aa7d34a5 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -14,7 +14,6 @@ from frappe.website.website_generator import WebsiteGenerator import erpnext -from erpnext.controllers.queries import get_match_cond from erpnext.setup.utils import get_exchange_rate from erpnext.stock.doctype.item.item import get_item_details from erpnext.stock.get_item_details import get_conversion_factor, get_price_list_rate diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py index 499674cfd756..4317d3adf68c 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py index 3c612fcec42f..2954238a571e 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.py +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py index 3da26189c3f8..5e46c7ef9325 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py b/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py index 7637cc79a84c..891fc53c71e6 100644 --- a/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py +++ b/erpnext/manufacturing/doctype/bom_scrap_item/bom_scrap_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py index cc6706dbaaa9..f627b4e52830 100644 --- a/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py +++ b/erpnext/manufacturing/doctype/bom_website_item/bom_website_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py index 551b0e0ff92d..5bd8cf568c7f 100644 --- a/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py +++ b/erpnext/manufacturing/doctype/bom_website_operation/bom_website_operation.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py index b87298abdade..62833d7cd20f 100644 --- a/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py +++ b/erpnext/manufacturing/doctype/downtime_entry/downtime_entry.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document from frappe.utils import time_diff_in_hours diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index c4cbe5e74cca..605027096e7a 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -12,18 +12,17 @@ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import ( - add_days, + add_days, add_to_date, cint, flt, get_datetime, - get_datetime_str, get_link_to_form, get_time, getdate, time_diff, time_diff_in_hours, - time_diff_in_seconds, + time_diff_in_seconds ) from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py index 6029fcfdc6cd..24029d8f2cec 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py b/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py index adcf4a94656c..d1d935c955b6 100644 --- a/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py +++ b/erpnext/manufacturing/doctype/production_plan_material_request/production_plan_material_request.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py index 6ca19fa51bb7..ea53a9869644 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py index 70ae5752a2ca..2d7c0bff9c4f 100644 --- a/erpnext/manufacturing/doctype/routing/routing_dashboard.py +++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index 4564cf93104e..bb431498636b 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -7,7 +7,7 @@ import unittest import frappe -from frappe.utils import add_months, add_to_date, cint, flt, now, today +from frappe.utils import add_months, cint, flt, now, today from erpnext.manufacturing.doctype.job_card.job_card import JobCardCancelError from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index ffa97d2e081f..e282dd3ecba5 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -2,7 +2,6 @@ # License: GNU General Public License v3. See license.txt import json -import math import frappe from dateutil.relativedelta import relativedelta @@ -19,7 +18,6 @@ nowdate, time_diff_in_hours, ) -from frappe.utils.csvutils import getlink from erpnext.manufacturing.doctype.bom.bom import ( get_bom_item_rate, @@ -29,8 +27,6 @@ from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( get_mins_between_operations, ) -from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError -from erpnext.projects.doctype.timesheet.timesheet import OverlapError from erpnext.stock.doctype.batch.batch import make_batch from erpnext.stock.doctype.item.item import get_item_defaults, validate_end_of_life from erpnext.stock.doctype.serial_no.serial_no import ( diff --git a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py index 3773345b5ed6..d25c9f218908 100644 --- a/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py +++ b/erpnext/manufacturing/doctype/work_order_operation/work_order_operation.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index d8d6cbaef0f8..6daf950c5ff4 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from dateutil.parser import parse from frappe import _ from frappe.model.document import Document from frappe.utils import ( diff --git a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py index 5d635dc6fd6b..719d83db51a0 100644 --- a/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py +++ b/erpnext/manufacturing/doctype/workstation_working_hour/workstation_working_hour.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py index 069638a305dd..d3004efc4409 100644 --- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py +++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -from pprint import pprint import frappe diff --git a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py index 4e160d6c7006..f014e7f9b57c 100644 --- a/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py +++ b/erpnext/manufacturing/report/exponential_smoothing_forecasting/exponential_smoothing_forecasting.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import add_years, cint, flt, getdate, nowdate +from frappe.utils import add_years, cint, flt, getdate import erpnext from erpnext.accounts.report.financial_statements import get_period_list diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py index 3003eed63ce3..a7aec315ff2a 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import flt, getdate +from frappe.utils import getdate from erpnext.stock.report.stock_analytics.stock_analytics import get_period, get_period_date_ranges diff --git a/erpnext/non_profit/doctype/certification_application/certification_application.py b/erpnext/non_profit/doctype/certification_application/certification_application.py index 8c5cdd6b31a7..ff400c81ae3a 100644 --- a/erpnext/non_profit/doctype/certification_application/certification_application.py +++ b/erpnext/non_profit/doctype/certification_application/certification_application.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/non_profit/doctype/certification_application/test_certification_application.py b/erpnext/non_profit/doctype/certification_application/test_certification_application.py index b60dbdd81db4..ec3ab733f5c5 100644 --- a/erpnext/non_profit/doctype/certification_application/test_certification_application.py +++ b/erpnext/non_profit/doctype/certification_application/test_certification_application.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCertificationApplication(unittest.TestCase): diff --git a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py index e255fb42dd98..0cbc2088c96b 100644 --- a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py +++ b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py index 40e4c98282cb..c87611e0de6a 100644 --- a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py +++ b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCertifiedConsultant(unittest.TestCase): diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py index e385a6828c8f..b65dc8e1e37a 100644 --- a/erpnext/non_profit/doctype/membership/membership.py +++ b/erpnext/non_profit/doctype/membership/membership.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import json -import os from datetime import datetime import frappe diff --git a/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py b/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py index 157a76b5c4b4..3422ec2dec39 100644 --- a/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py +++ b/erpnext/non_profit/doctype/volunteer_skill/volunteer_skill.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py b/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py index 7c07a82dfc20..2167b651c34b 100644 --- a/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py +++ b/erpnext/non_profit/report/expiring_memberships/expiring_memberships.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ def execute(filters=None): diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.py b/erpnext/non_profit/web_form/certification_application/certification_application.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/non_profit/web_form/certification_application/certification_application.py +++ b/erpnext/non_profit/web_form/certification_application/certification_application.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/patches/v10_0/delete_hub_documents.py b/erpnext/patches/v10_0/delete_hub_documents.py index db063718f3d4..16c7abfc978f 100644 --- a/erpnext/patches/v10_0/delete_hub_documents.py +++ b/erpnext/patches/v10_0/delete_hub_documents.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe.model.utils.rename_field import rename_field def execute(): diff --git a/erpnext/patches/v11_0/add_market_segments.py b/erpnext/patches/v11_0/add_market_segments.py index 23fc9925b3aa..e7cc7d1117cb 100644 --- a/erpnext/patches/v11_0/add_market_segments.py +++ b/erpnext/patches/v11_0/add_market_segments.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from erpnext.setup.setup_wizard.operations.install_fixtures import add_market_segments diff --git a/erpnext/patches/v11_0/add_sales_stages.py b/erpnext/patches/v11_0/add_sales_stages.py index e30f3390dd1c..23e48747b82d 100644 --- a/erpnext/patches/v11_0/add_sales_stages.py +++ b/erpnext/patches/v11_0/add_sales_stages.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from erpnext.setup.setup_wizard.operations.install_fixtures import add_sale_stages diff --git a/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py b/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py index 57606dcf1752..1d3f8c1204db 100644 --- a/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py +++ b/erpnext/patches/v11_0/make_asset_finance_book_against_old_entries.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe.utils.nestedset import rebuild_tree def execute(): diff --git a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py index fb7d9e8a1ae6..accfa5ecb395 100644 --- a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py +++ b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from frappe.model.utils.rename_field import rename_field diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py index 310ab30b55f5..8d6632ec6082 100644 --- a/erpnext/patches/v11_0/uom_conversion_data.py +++ b/erpnext/patches/v11_0/uom_conversion_data.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import json import frappe diff --git a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py index a690443b52ae..fa5e5799e865 100644 --- a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py +++ b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py @@ -2,7 +2,6 @@ import frappe -from erpnext.regional.india.setup import make_custom_fields def execute(): diff --git a/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py b/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py index fb596d61dd84..f6a1984e17a3 100644 --- a/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py +++ b/erpnext/patches/v12_0/remove_denied_leaves_from_leave_ledger.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe.utils import getdate, today def execute(): diff --git a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py index decc49cb382d..6e60228104c3 100644 --- a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py +++ b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py @@ -4,9 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt -from erpnext.stock.get_item_details import get_conversion_factor def execute(): diff --git a/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py b/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py index f8ed689a657e..9c851ddcee1b 100644 --- a/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py +++ b/erpnext/patches/v12_0/set_produced_qty_field_in_sales_order_for_work_order.py @@ -1,5 +1,4 @@ import frappe -from frappe.utils import flt from erpnext.selling.doctype.sales_order.sales_order import update_produced_qty_in_so_item diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py index dd2dce7dd33c..59295adc1a0b 100644 --- a/erpnext/patches/v12_0/update_ewaybill_field_position.py +++ b/erpnext/patches/v12_0/update_ewaybill_field_position.py @@ -2,7 +2,6 @@ import frappe -from erpnext.regional.india.setup import make_custom_fields def execute(): diff --git a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py index b85a8e084b6b..e4c100892355 100644 --- a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py +++ b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt, getdate +from frappe.utils import getdate from erpnext.setup.utils import get_exchange_rate diff --git a/erpnext/patches/v12_0/update_uom_conversion_factor.py b/erpnext/patches/v12_0/update_uom_conversion_factor.py index eaabd56825e6..ffeaf6538121 100644 --- a/erpnext/patches/v12_0/update_uom_conversion_factor.py +++ b/erpnext/patches/v12_0/update_uom_conversion_factor.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import json import frappe diff --git a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py index 600a8787d444..f029f75accde 100644 --- a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py +++ b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py @@ -1,10 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe.custom.doctype.property_setter.property_setter import ( - delete_property_setter, - make_property_setter, -) def execute(): diff --git a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py index 9afa868c94fc..e4cb9ae7cdcc 100644 --- a/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py +++ b/erpnext/patches/v13_0/item_reposting_for_incorrect_sl_and_gl.py @@ -1,5 +1,4 @@ import frappe -from frappe import _ from frappe.utils import get_time, getdate, today from erpnext.accounts.utils import update_gl_entries_after diff --git a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py index 1dbebff8ae61..e73fa7b9ecd1 100644 --- a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py +++ b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe.model.utils.rename_field import rename_field def execute(): diff --git a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py index e74ffc714c22..b24b34434886 100644 --- a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py +++ b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.setup.install import create_print_uom_after_qty_custom_field diff --git a/erpnext/patches/v13_0/set_app_name.py b/erpnext/patches/v13_0/set_app_name.py index 75d28283c8c6..4a88442bcdc8 100644 --- a/erpnext/patches/v13_0/set_app_name.py +++ b/erpnext/patches/v13_0/set_app_name.py @@ -1,5 +1,4 @@ import frappe -from frappe import _ def execute(): diff --git a/erpnext/patches/v13_0/update_old_loans.py b/erpnext/patches/v13_0/update_old_loans.py index b423a3a8e1a8..b01a87722efa 100644 --- a/erpnext/patches/v13_0/update_old_loans.py +++ b/erpnext/patches/v13_0/update_old_loans.py @@ -6,7 +6,6 @@ from frappe.utils import flt, nowdate from erpnext.accounts.doctype.account.test_account import create_account -from erpnext.loan_management.doctype.loan.loan import make_repayment_entry from erpnext.loan_management.doctype.loan_repayment.loan_repayment import ( get_accrued_interest_entries, ) diff --git a/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py index db64ec797900..9983f012875a 100644 --- a/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py +++ b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, rounded +from frappe.utils import add_days, cint, cstr, date_diff, getdate, rounded from erpnext.hr.utils import ( get_holiday_dates_for_employee, diff --git a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py index 834394182de5..3dca8d52ec51 100644 --- a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py +++ b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeIncentive(unittest.TestCase): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py index d9c82d236225..f88f551a2ee6 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py index 69de6b119691..3abe4a9aebc6 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeTaxExemptionCategory(unittest.TestCase): diff --git a/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py index 53fcd33e6cbc..099ab0dcde0a 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import flt diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py index 53d91f611505..f35fd3caf90b 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py @@ -4,8 +4,6 @@ from __future__ import unicode_literals -import frappe -from frappe import _ from frappe.model.document import Document from frappe.utils import flt diff --git a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py index fc2de6836bec..e41c652d8bd2 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestEmployeeTaxExemptionSubCategory(unittest.TestCase): diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py index 41f15993efe4..42101518a3ca 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py index b24af9d610b4..d6c3684cc243 100644 --- a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py index 5296b7853951..914cd3092f53 100644 --- a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py +++ b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestPayrollPeriod(unittest.TestCase): diff --git a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py index ab25d73ef420..67b5769bb2de 100644 --- a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py +++ b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestRetentionBonus(unittest.TestCase): diff --git a/erpnext/payroll/doctype/salary_detail/salary_detail.py b/erpnext/payroll/doctype/salary_detail/salary_detail.py index 52ba92e972c8..50d1958caecd 100644 --- a/erpnext/payroll/doctype/salary_detail/salary_detail.py +++ b/erpnext/payroll/doctype/salary_detail/salary_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py index fdccd2dd7c8a..695aafffb527 100644 --- a/erpnext/payroll/doctype/salary_slip/salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py @@ -26,7 +26,6 @@ import erpnext from erpnext.accounts.utils import get_fiscal_year -from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee from erpnext.loan_management.doctype.loan_repayment.loan_repayment import ( calculate_amounts, diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure.py b/erpnext/payroll/doctype/salary_structure/salary_structure.py index 9af7da358888..ef401b2d1a71 100644 --- a/erpnext/payroll/doctype/salary_structure/salary_structure.py +++ b/erpnext/payroll/doctype/salary_structure/salary_structure.py @@ -8,7 +8,6 @@ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import cint, cstr, flt -from six import iteritems import erpnext diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py index 907adea7034b..dabf2d8474c5 100644 --- a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py index bfc181343f57..64087f4ee4dd 100644 --- a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py +++ b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestSalaryStructureAssignment(unittest.TestCase): diff --git a/erpnext/payroll/notification/retention_bonus/retention_bonus.py b/erpnext/payroll/notification/retention_bonus/retention_bonus.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/payroll/notification/retention_bonus/retention_bonus.py +++ b/erpnext/payroll/notification/retention_bonus/retention_bonus.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/payroll/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py index e8d01c45c24d..dacd2c0f98c3 100644 --- a/erpnext/payroll/report/bank_remittance/bank_remittance.py +++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py @@ -3,11 +3,9 @@ from __future__ import unicode_literals -import itertools import frappe from frappe import _, get_all -from frappe.utils import formatdate def execute(filters=None): diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py index 82b9a8e6b2b4..8e8f77605e66 100644 --- a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/portal/doctype/products_settings/test_products_settings.py b/erpnext/portal/doctype/products_settings/test_products_settings.py index 05e38f5f2dfd..2b211799858a 100644 --- a/erpnext/portal/doctype/products_settings/test_products_settings.py +++ b/erpnext/portal/doctype/products_settings/test_products_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestProductsSettings(unittest.TestCase): diff --git a/erpnext/portal/product_configurator/test_product_configurator.py b/erpnext/portal/product_configurator/test_product_configurator.py index ded5287b45cb..5db74f2c40d2 100644 --- a/erpnext/portal/product_configurator/test_product_configurator.py +++ b/erpnext/portal/product_configurator/test_product_configurator.py @@ -4,11 +4,9 @@ import frappe from bs4 import BeautifulSoup -from frappe.utils import get_html_for_route, set_request -from frappe.website.render import render +from frappe.utils import get_html_for_route from erpnext.portal.product_configurator.utils import get_products_for_website -from erpnext.stock.doctype.item.test_item import make_item_variant test_dependencies = ["Item"] diff --git a/erpnext/projects/doctype/dependent_task/dependent_task.py b/erpnext/projects/doctype/dependent_task/dependent_task.py index 1c346df1107a..3f62cef70560 100644 --- a/erpnext/projects/doctype/dependent_task/dependent_task.py +++ b/erpnext/projects/doctype/dependent_task/dependent_task.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 772bf66ad887..da1ba055d0d1 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -9,17 +9,14 @@ from frappe.desk.reportview import get_match_cond from frappe.model.document import Document from frappe.utils import ( - add_days, + add_days, flt, get_datetime, get_time, get_url, - getdate, - now, nowtime, - today, + today ) -from six import iteritems from erpnext.controllers.queries import get_filters_cond from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list diff --git a/erpnext/projects/doctype/project_user/project_user.py b/erpnext/projects/doctype/project_user/project_user.py index 9ec4776fa5d7..7abe9459f24f 100644 --- a/erpnext/projects/doctype/project_user/project_user.py +++ b/erpnext/projects/doctype/project_user/project_user.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/projects/doctype/projects_settings/projects_settings.py b/erpnext/projects/doctype/projects_settings/projects_settings.py index 5e7fe1f20611..88bb247a3c65 100644 --- a/erpnext/projects/doctype/projects_settings/projects_settings.py +++ b/erpnext/projects/doctype/projects_settings/projects_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/projects/doctype/projects_settings/test_projects_settings.py b/erpnext/projects/doctype/projects_settings/test_projects_settings.py index 7a43aac87aa7..f86c1fb4143a 100644 --- a/erpnext/projects/doctype/projects_settings/test_projects_settings.py +++ b/erpnext/projects/doctype/projects_settings/test_projects_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestProjectsSettings(unittest.TestCase): diff --git a/erpnext/projects/doctype/task_depends_on/task_depends_on.py b/erpnext/projects/doctype/task_depends_on/task_depends_on.py index dc1e81bf90de..ddb67ee30cbc 100644 --- a/erpnext/projects/doctype/task_depends_on/task_depends_on.py +++ b/erpnext/projects/doctype/task_depends_on/task_depends_on.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/projects/doctype/task_type/test_task_type.py b/erpnext/projects/doctype/task_type/test_task_type.py index e2916205d76f..39188d15acee 100644 --- a/erpnext/projects/doctype/task_type/test_task_type.py +++ b/erpnext/projects/doctype/task_type/test_task_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestTaskType(unittest.TestCase): diff --git a/erpnext/projects/doctype/timesheet/test_timesheet.py b/erpnext/projects/doctype/timesheet/test_timesheet.py index e9467e280778..6b32c66dfe51 100644 --- a/erpnext/projects/doctype/timesheet/test_timesheet.py +++ b/erpnext/projects/doctype/timesheet/test_timesheet.py @@ -7,8 +7,7 @@ import unittest import frappe -from frappe.utils import add_days, add_months, now_datetime, nowdate -from frappe.utils.make_random import get_random +from frappe.utils import add_months, now_datetime, nowdate from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.hr.doctype.employee.test_employee import make_employee diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index d22ceda31b55..d72a82ac878a 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -5,30 +5,18 @@ from __future__ import unicode_literals import json -from datetime import timedelta import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import ( - add_to_date, - cint, - date_diff, - flt, - get_datetime, + flt, getdate, - time_diff_in_hours, + time_diff_in_hours ) from erpnext.controllers.queries import get_match_cond from erpnext.hr.utils import validate_active_employee -from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( - get_mins_between_operations, -) -from erpnext.manufacturing.doctype.workstation.workstation import ( - WorkstationHolidayError, - check_if_within_operating_hours, -) from erpnext.setup.utils import get_exchange_rate diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py index b113ca59b2db..4fd233ebb212 100644 --- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py +++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py index e71dded3f354..30bd9f0182fc 100644 --- a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py +++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from erpnext.projects.report.billing_summary import get_columns, get_data diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.py b/erpnext/projects/report/project_billing_summary/project_billing_summary.py index e71dded3f354..30bd9f0182fc 100644 --- a/erpnext/projects/report/project_billing_summary/project_billing_summary.py +++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from erpnext.projects.report.billing_summary import get_columns, get_data diff --git a/erpnext/quality_management/doctype/quality_action/quality_action.py b/erpnext/quality_management/doctype/quality_action/quality_action.py index 5e459a159539..646a0dfc2c8f 100644 --- a/erpnext/quality_management/doctype/quality_action/quality_action.py +++ b/erpnext/quality_management/doctype/quality_action/quality_action.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/quality_management/doctype/quality_action/test_quality_action.py b/erpnext/quality_management/doctype/quality_action/test_quality_action.py index 2864b5e550f5..8ea59e37dd02 100644 --- a/erpnext/quality_management/doctype/quality_action/test_quality_action.py +++ b/erpnext/quality_management/doctype/quality_action/test_quality_action.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQualityAction(unittest.TestCase): diff --git a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py index bf1a1117e09e..ca2510865dd3 100644 --- a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py +++ b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQualityFeedbackTemplate(unittest.TestCase): diff --git a/erpnext/quality_management/doctype/quality_goal/quality_goal.py b/erpnext/quality_management/doctype/quality_goal/quality_goal.py index f2f44d98f0ae..2888401782a2 100644 --- a/erpnext/quality_management/doctype/quality_goal/quality_goal.py +++ b/erpnext/quality_management/doctype/quality_goal/quality_goal.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py index 7024abdc35a9..083397aa8939 100644 --- a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py +++ b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py @@ -7,9 +7,6 @@ import frappe -from erpnext.quality_management.doctype.quality_procedure.test_quality_procedure import ( - create_procedure, -) class TestQualityGoal(unittest.TestCase): diff --git a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py index bf4451d63feb..353ea58d140f 100644 --- a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py +++ b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestQualityMeeting(unittest.TestCase): diff --git a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py index 0c724a73c67b..56293c98e092 100644 --- a/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py +++ b/erpnext/quality_management/doctype/quality_procedure/quality_procedure.py @@ -6,7 +6,7 @@ import frappe from frappe import _ -from frappe.utils.nestedset import NestedSet, rebuild_tree +from frappe.utils.nestedset import NestedSet class QualityProcedure(NestedSet): diff --git a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py index 3171cf49bc6e..f59d95e535f4 100644 --- a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py +++ b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestGSTHSNCode(unittest.TestCase): diff --git a/erpnext/regional/doctype/gst_settings/test_gst_settings.py b/erpnext/regional/doctype/gst_settings/test_gst_settings.py index 624bd349f696..3cad9ac02478 100644 --- a/erpnext/regional/doctype/gst_settings/test_gst_settings.py +++ b/erpnext/regional/doctype/gst_settings/test_gst_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestGSTSettings(unittest.TestCase): diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py index 2a989cba6ca8..76cb621f541f 100644 --- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py +++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py @@ -3,19 +3,15 @@ from __future__ import unicode_literals -import json import re -import traceback import zipfile -from decimal import Decimal import dateutil import frappe from bs4 import BeautifulSoup as bs from frappe import _ -from frappe.custom.doctype.custom_field.custom_field import create_custom_field from frappe.model.document import Document -from frappe.utils import add_days, cint, flt, get_datetime_str, get_files_path, nowdate, today +from frappe.utils import flt, get_datetime_str, today from frappe.utils.data import format_datetime from frappe.utils.file_manager import save_file diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py index b2f85690fc29..d113e4824114 100644 --- a/erpnext/regional/france/utils.py +++ b/erpnext/regional/france/utils.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe # don't remove this function it is used in tests diff --git a/erpnext/regional/germany/setup.py b/erpnext/regional/germany/setup.py index 25221a302ecc..35d14135ba5f 100644 --- a/erpnext/regional/germany/setup.py +++ b/erpnext/regional/germany/setup.py @@ -1,4 +1,3 @@ -import os import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields diff --git a/erpnext/regional/germany/utils/datev/datev_csv.py b/erpnext/regional/germany/utils/datev/datev_csv.py index 18517dd70912..9d1fabbada74 100644 --- a/erpnext/regional/germany/utils/datev/datev_csv.py +++ b/erpnext/regional/germany/utils/datev/datev_csv.py @@ -7,7 +7,6 @@ import frappe import pandas as pd -import six from frappe import _ from six import BytesIO diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 90ece88805a5..c34fc0d4911c 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -7,20 +7,15 @@ from frappe import _ from frappe.model.utils import get_fetch_values from frappe.utils import ( - cint, + cint, cstr, date_diff, flt, getdate, - money_in_words, - nowdate, - round_based_on_smallest_currency_fraction, + nowdate ) from six import string_types -import erpnext -from erpnext.accounts.general_ledger import make_gl_entries -from erpnext.accounts.utils import get_account_currency from erpnext.controllers.accounts_controller import get_taxes_and_charges from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount from erpnext.hr.utils import get_salary_assignment diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index 94562ffc1f5c..d6c7f1dbfa90 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -5,7 +5,6 @@ import frappe from frappe import _ -from frappe.desk.form.load import get_attachments from frappe.utils import cstr, flt from frappe.utils.file_manager import remove_file from six import string_types diff --git a/erpnext/regional/report/datev/test_datev.py b/erpnext/regional/report/datev/test_datev.py index bd3654585aa1..a8d23eb1ad5b 100644 --- a/erpnext/regional/report/datev/test_datev.py +++ b/erpnext/regional/report/datev/test_datev.py @@ -16,12 +16,11 @@ ) from erpnext.regional.germany.utils.datev.datev_csv import get_datev_csv, get_header from erpnext.regional.report.datev.datev import ( - download_datev_csv, + download_datev_csv, get_account_names, get_customers, get_suppliers, - get_transactions, - validate, + get_transactions ) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 95954ec999ba..7c4731eda077 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -8,10 +8,9 @@ import frappe from frappe import _ -from frappe.utils import flt, formatdate, getdate, now_datetime +from frappe.utils import flt, formatdate, getdate from six import iteritems -from erpnext.regional.doctype.gstr_3b_report.gstr_3b_report import get_period from erpnext.regional.india.utils import get_gst_accounts diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py index 340a36921d01..7a938c7e0f22 100644 --- a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py +++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py @@ -9,7 +9,6 @@ from frappe import _ from frappe.model.meta import get_field_precision from frappe.utils import cstr, flt, getdate -from frappe.utils.xlsxutils import handle_html from six import iteritems import erpnext diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py index 38f6142fc1ee..a5971edb3e07 100644 --- a/erpnext/regional/united_arab_emirates/setup.py +++ b/erpnext/regional/united_arab_emirates/setup.py @@ -3,8 +3,6 @@ from __future__ import unicode_literals -import json -import os import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields diff --git a/erpnext/restaurant/doctype/restaurant/restaurant.py b/erpnext/restaurant/doctype/restaurant/restaurant.py index 10d79b579678..486afc3a11e7 100644 --- a/erpnext/restaurant/doctype/restaurant/restaurant.py +++ b/erpnext/restaurant/doctype/restaurant/restaurant.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.py b/erpnext/restaurant/doctype/restaurant/test_restaurant.py index 9fa075d6874b..b08cd7b92023 100644 --- a/erpnext/restaurant/doctype/restaurant/test_restaurant.py +++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.py @@ -5,7 +5,6 @@ import unittest -import frappe test_records = [ dict(doctype='Restaurant', name='Test Restaurant 1', company='_Test Company 1', diff --git a/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py index 276e4822f178..5d095f49a8ea 100644 --- a/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py +++ b/erpnext/restaurant/doctype/restaurant_menu_item/restaurant_menu_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py index f45ea0fe01c5..ee8928b13a16 100644 --- a/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py +++ b/erpnext/restaurant/doctype/restaurant_order_entry_item/restaurant_order_entry_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py index d369afbd7ec2..f6d2a7c8cc4b 100644 --- a/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py +++ b/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py @@ -6,7 +6,6 @@ from datetime import timedelta -import frappe from frappe.model.document import Document from frappe.utils import get_datetime diff --git a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py index b74fc13af3b0..0cce1a7d4637 100644 --- a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py +++ b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestRestaurantReservation(unittest.TestCase): diff --git a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py index c1efc69fe74a..0b5d63527115 100644 --- a/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py +++ b/erpnext/restaurant/doctype/restaurant_table/restaurant_table.py @@ -6,7 +6,6 @@ import re -import frappe from frappe.model.document import Document from frappe.model.naming import make_autoname diff --git a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py index 9651a9104a72..ca75a27aefb2 100644 --- a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py +++ b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py @@ -5,7 +5,6 @@ import unittest -import frappe test_records = [ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1), diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 2ae1ce1724e0..062132e290a0 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -19,10 +19,9 @@ from frappe.utils import cint, cstr, flt, get_formatted_email, today from frappe.utils.user import get_users_with_role -from erpnext.accounts.party import ( # keep this - get_dashboard_info, - get_timeline_data, - validate_party_accounts, +from erpnext.accounts.party import ( + get_dashboard_info, + validate_party_accounts ) from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/selling/doctype/industry_type/industry_type.py b/erpnext/selling/doctype/industry_type/industry_type.py index a314cc4e5b48..6d413ece2e7d 100644 --- a/erpnext/selling/doctype/industry_type/industry_type.py +++ b/erpnext/selling/doctype/industry_type/industry_type.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/selling/doctype/installation_note/test_installation_note.py b/erpnext/selling/doctype/installation_note/test_installation_note.py index 7135817f834e..c9fd40dc8929 100644 --- a/erpnext/selling/doctype/installation_note/test_installation_note.py +++ b/erpnext/selling/doctype/installation_note/test_installation_note.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Installation Note') diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.py b/erpnext/selling/doctype/installation_note_item/installation_note_item.py index 8295fd0bdbd2..862c2a1bb51c 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.py +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py index 600bb7c87440..5f71a27f369b 100644 --- a/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py +++ b/erpnext/selling/doctype/product_bundle_item/product_bundle_item.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.py b/erpnext/selling/doctype/quotation_item/quotation_item.py index 12fee1869d00..ea472497299f 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.py +++ b/erpnext/selling/doctype/quotation_item/quotation_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/selling/doctype/sales_team/sales_team.py b/erpnext/selling/doctype/sales_team/sales_team.py index d85fde81fd39..9b542c0eead8 100644 --- a/erpnext/selling/doctype/sales_team/sales_team.py +++ b/erpnext/selling/doctype/sales_team/sales_team.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py index cf1a6a18d3f1..2439d1c54fab 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -6,7 +6,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe.custom.doctype.property_setter.property_setter import make_property_setter from frappe.model.document import Document from frappe.utils import cint diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py index e564baebcf49..fbf4266e6a94 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -6,7 +6,6 @@ import json import frappe -from frappe.utils import cint from frappe.utils.nestedset import get_root_of from erpnext.accounts.doctype.pos_invoice.pos_invoice import get_stock_availability diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.py b/erpnext/selling/report/quotation_trends/quotation_trends.py index fdd8c1913d31..d2ee9a8b742c 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.py +++ b/erpnext/selling/report/quotation_trends/quotation_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/selling/report/sales_analytics/test_analytics.py b/erpnext/selling/report/sales_analytics/test_analytics.py index 6594f8c5ec86..a1800993f4f1 100644 --- a/erpnext/selling/report/sales_analytics/test_analytics.py +++ b/erpnext/selling/report/sales_analytics/test_analytics.py @@ -6,7 +6,6 @@ import unittest import frappe -import frappe.defaults from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.selling.report.sales_analytics.sales_analytics import execute diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py index 7fbac6526574..89daf4477816 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.py +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py index 14df1552fde3..a84dec032e5b 100644 --- a/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py +++ b/erpnext/selling/report/sales_partner_commission_summary/sales_partner_commission_summary.py @@ -5,7 +5,6 @@ import frappe from frappe import _, msgprint -from frappe.utils import flt def execute(filters=None): diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py index 186207f0c4f5..d4f49c71464f 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/item_group_wise_sales_target_variance.py @@ -5,7 +5,6 @@ import frappe from frappe import _ -from frappe.utils import flt from erpnext.accounts.doctype.monthly_distribution.monthly_distribution import ( get_periodwise_distribution_data, diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py index ab7055a6fc6d..ff3d805edbac 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, diff --git a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py index 24d8dfa5a96a..39ec072f6ba3 100644 --- a/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py +++ b/erpnext/selling/report/sales_partner_transaction_summary/sales_partner_transaction_summary.py @@ -5,7 +5,6 @@ import frappe from frappe import _, msgprint -from frappe.utils import flt def execute(filters=None): diff --git a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py index c83805fa9d9d..13245b789ef4 100644 --- a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py +++ b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.py @@ -5,7 +5,6 @@ import frappe from frappe import _, msgprint -from frappe.utils import flt def execute(filters=None): diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py index b679787fcafe..f21c683348a4 100644 --- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index 39e7d030d54e..9dc2923b0a2f 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -5,7 +5,6 @@ import frappe from frappe import _, msgprint -from frappe.utils import flt from erpnext import get_company_currency diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py index 071105d1c1aa..05ae3c1106b6 100644 --- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py index efa696b9b0f8..ab0f4201219e 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ from frappe.model.document import Document from frappe.utils import cstr, flt diff --git a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py index 944752d7c259..2e7400889e6e 100644 --- a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Authorization Rule') diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 394084a96bdd..f9f70264f6dc 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -12,7 +12,6 @@ from frappe import _ from frappe.cache_manager import clear_defaults_cache from frappe.contacts.address_and_contact import load_address_and_contact -from frappe.model.document import Document from frappe.utils import cint, formatdate, get_timestamp, today from frappe.utils.nestedset import NestedSet from past.builtins import cmp diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py index 1dfb401bd798..0b86e2937788 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe import _, throw from frappe.model.document import Document from frappe.utils import cint, formatdate, get_datetime_str, nowdate diff --git a/erpnext/setup/doctype/email_digest/test_email_digest.py b/erpnext/setup/doctype/email_digest/test_email_digest.py index 86335fb017d4..0e3fd33046c3 100644 --- a/erpnext/setup/doctype/email_digest/test_email_digest.py +++ b/erpnext/setup/doctype/email_digest/test_email_digest.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Email Digest') diff --git a/erpnext/setup/doctype/global_defaults/test_global_defaults.py b/erpnext/setup/doctype/global_defaults/test_global_defaults.py index e629e7619244..446f53af9d2a 100644 --- a/erpnext/setup/doctype/global_defaults/test_global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/test_global_defaults.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestGlobalDefaults(unittest.TestCase): diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 7cc8e988ca1d..45df8460ad11 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -9,7 +9,6 @@ from frappe import _ from frappe.utils import cint, cstr, nowdate from frappe.utils.nestedset import NestedSet -from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow from frappe.website.render import clear_cache from frappe.website.website_generator import WebsiteGenerator from six.moves.urllib.parse import quote diff --git a/erpnext/setup/doctype/party_type/test_party_type.py b/erpnext/setup/doctype/party_type/test_party_type.py index 7d5fd86ee630..675ad3c3cfa4 100644 --- a/erpnext/setup/doctype/party_type/test_party_type.py +++ b/erpnext/setup/doctype/party_type/test_party_type.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Party Type') diff --git a/erpnext/setup/doctype/print_heading/print_heading.py b/erpnext/setup/doctype/print_heading/print_heading.py index 4b5d63167b72..cf25638608b5 100644 --- a/erpnext/setup/doctype/print_heading/print_heading.py +++ b/erpnext/setup/doctype/print_heading/print_heading.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py index 08a67db889e0..9131cc334a7b 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py +++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/setup/doctype/target_detail/target_detail.py b/erpnext/setup/doctype/target_detail/target_detail.py index 431f8e3257ef..89cd814f2d14 100644 --- a/erpnext/setup/doctype/target_detail/target_detail.py +++ b/erpnext/setup/doctype/target_detail/target_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py index 339e3b924bcb..f0e97b34e25c 100644 --- a/erpnext/setup/doctype/uom/uom.py +++ b/erpnext/setup/doctype/uom/uom.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.py b/erpnext/setup/doctype/website_item_group/website_item_group.py index bcd700d9e974..2f7201344849 100644 --- a/erpnext/setup/doctype/website_item_group/website_item_group.py +++ b/erpnext/setup/doctype/website_item_group/website_item_group.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/setup/setup_wizard/data/dashboard_charts.py b/erpnext/setup/setup_wizard/data/dashboard_charts.py index 7cf21b3bf0e5..5369bbab3568 100644 --- a/erpnext/setup/setup_wizard/data/dashboard_charts.py +++ b/erpnext/setup/setup_wizard/data/dashboard_charts.py @@ -3,7 +3,6 @@ import json import frappe -from frappe import _ def get_company_for_dashboards(): diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py index 17e42623bb2b..da7bacff65e9 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.utils import cstr, getdate -from erpnext.accounts.doctype.account.account import RootNotEditable from .default_website import website_maker diff --git a/erpnext/setup/setup_wizard/utils.py b/erpnext/setup/setup_wizard/utils.py index 1c5de7559b97..7a973430c6ed 100644 --- a/erpnext/setup/setup_wizard/utils.py +++ b/erpnext/setup/setup_wizard/utils.py @@ -5,7 +5,6 @@ from frappe.desk.page.setup_wizard.setup_wizard import setup_complete -from erpnext.setup.setup_wizard import setup_wizard def complete(): diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py index 2967a39fc609..8f4afda57e4b 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ from frappe.model.document import Document -from frappe.utils import flt, get_datetime, get_datetime_str, now_datetime +from frappe.utils import flt class ShoppingCartSetupError(frappe.ValidationError): pass diff --git a/erpnext/shopping_cart/utils.py b/erpnext/shopping_cart/utils.py index 6a9f2dad9030..f412e61f062e 100644 --- a/erpnext/shopping_cart/utils.py +++ b/erpnext/shopping_cart/utils.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ( is_cart_enabled, diff --git a/erpnext/startup/filters.py b/erpnext/startup/filters.py index 73c60c35ae90..c0ccf54d5f61 100644 --- a/erpnext/startup/filters.py +++ b/erpnext/startup/filters.py @@ -1,5 +1,4 @@ -import frappe def get_filters_config(): diff --git a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py index 36eff965682c..871af140b8fc 100644 --- a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py +++ b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import json import frappe from frappe import _ diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 23022096c415..76db581a063b 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -10,7 +10,7 @@ from frappe.utils import cint, flt, get_link_to_form from frappe.utils.data import add_days from frappe.utils.jinja import render_template -from six import string_types, text_type +from six import text_type class UnableToSelectBatchError(frappe.ValidationError): diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 8dbec18d9eb0..5fbc2d8dee1f 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe.model.document import Document from frappe.utils import flt, nowdate diff --git a/erpnext/stock/doctype/bin/test_bin.py b/erpnext/stock/doctype/bin/test_bin.py index 3bc34115df36..a8a757805fb6 100644 --- a/erpnext/stock/doctype/bin/test_bin.py +++ b/erpnext/stock/doctype/bin/test_bin.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Bin') diff --git a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py index d883ba6a438b..d484301572b1 100644 --- a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py index 2b11afed79c9..040fe1785e91 100644 --- a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestCustomsTariffNumber(unittest.TestCase): diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 7b0b73456fd4..5542cd00d4cb 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _ from frappe.contacts.doctype.address.address import get_company_address from frappe.desk.notifications import clear_doctype_notifications diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index b2d93f2fda4b..7fda94b269d7 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -8,7 +8,6 @@ import unittest import frappe -import frappe.defaults from frappe.utils import cstr, flt, nowdate, nowtime from erpnext.accounts.doctype.account.test_account import get_inventory_account diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py index 623b8fc1a149..693caabfb857 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/delivery_settings/delivery_settings.py b/erpnext/stock/doctype/delivery_settings/delivery_settings.py index 27f578de3c0a..c25907defebe 100644 --- a/erpnext/stock/doctype/delivery_settings/delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/delivery_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py index 022bf5c2d319..a3b553b66794 100644 --- a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestDeliverySettings(unittest.TestCase): diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 987f5597e274..f3c798107a22 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -6,7 +6,7 @@ import json import frappe -from frappe import _, msgprint +from frappe import _ from frappe.utils import ( cint, cstr, diff --git a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py index 30a2dd101245..ceffb4972a98 100644 --- a/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py +++ b/erpnext/stock/doctype/item_attribute_value/item_attribute_value.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py index cb64e0bcac84..55fd0ec3436b 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py index ab15e4e709e1..0dd7e4310548 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.py b/erpnext/stock/doctype/item_reorder/item_reorder.py index 2da6b37a8ade..598339deee82 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.py +++ b/erpnext/stock/doctype/item_reorder/item_reorder.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.py b/erpnext/stock/doctype/item_supplier/item_supplier.py index 71505db6adf6..9b5da55f6003 100644 --- a/erpnext/stock/doctype/item_supplier/item_supplier.py +++ b/erpnext/stock/doctype/item_supplier/item_supplier.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_tax/item_tax.py b/erpnext/stock/doctype/item_tax/item_tax.py index 8708cede77c7..33c1e49f4091 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.py +++ b/erpnext/stock/doctype/item_tax/item_tax.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_variant/item_variant.py b/erpnext/stock/doctype/item_variant/item_variant.py index 3cc84c3f1696..47ab07fe98d5 100644 --- a/erpnext/stock/doctype/item_variant/item_variant.py +++ b/erpnext/stock/doctype/item_variant/item_variant.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py index c4df73cf1989..78dda6535fc1 100644 --- a/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py +++ b/erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.py b/erpnext/stock/doctype/item_website_specification/item_website_specification.py index 4af43d90fa61..85491b739216 100644 --- a/erpnext/stock/doctype/item_website_specification/item_website_specification.py +++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py index 2683ec776c53..7dd3aa5c3461 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py index 0b808e0161f5..3d81d9641117 100644 --- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py +++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py b/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py index 2b3525f93ff7..e649e4d0797e 100644 --- a/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py +++ b/erpnext/stock/doctype/landed_cost_taxes_and_charges/landed_cost_taxes_and_charges.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py index 7a863da41ac3..51ccea982d94 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py @@ -10,7 +10,6 @@ from frappe.utils import flt import erpnext -from erpnext.accounts.doctype.account.account import get_account_currency from erpnext.controllers.taxes_and_totals import init_landed_taxes_and_totals from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py index 15945cbb8f3d..58a72f72dd1f 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py @@ -16,9 +16,6 @@ get_gl_entries, make_purchase_receipt, ) -from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import ( - test_records as pr_test_records, -) class TestLandedCostVoucher(unittest.TestCase): diff --git a/erpnext/stock/doctype/manufacturer/manufacturer.py b/erpnext/stock/doctype/manufacturer/manufacturer.py index 9efd6ae1aeeb..63f9d6e40636 100644 --- a/erpnext/stock/doctype/manufacturer/manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/manufacturer.py @@ -4,10 +4,8 @@ from __future__ import unicode_literals -import frappe from frappe.contacts.address_and_contact import ( - delete_contact_and_address, - load_address_and_contact, + load_address_and_contact ) from frappe.model.document import Document diff --git a/erpnext/stock/doctype/manufacturer/test_manufacturer.py b/erpnext/stock/doctype/manufacturer/test_manufacturer.py index 5513aa34bf4e..023c71d0dd68 100644 --- a/erpnext/stock/doctype/manufacturer/test_manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/test_manufacturer.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Manufacturer') diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index b92d8aeab350..ce685e89aacf 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -6,13 +6,11 @@ from __future__ import unicode_literals -import json import frappe from frappe import _, msgprint from frappe.model.mapper import get_mapped_doc -from frappe.utils import add_days, cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate -from six import string_types +from frappe.utils import cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items from erpnext.controllers.buying_controller import BuyingController diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index e1ff207bec98..5c2ac2584f7f 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -11,7 +11,6 @@ import frappe from frappe.utils import flt, today -import erpnext from erpnext.stock.doctype.item.test_item import create_item from erpnext.stock.doctype.material_request.material_request import ( make_purchase_order, diff --git a/erpnext/stock/doctype/packing_slip/test_packing_slip.py b/erpnext/stock/doctype/packing_slip/test_packing_slip.py index e13ef8709512..153d7953e179 100644 --- a/erpnext/stock/doctype/packing_slip/test_packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/test_packing_slip.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('Packing Slip') diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py index 5dc37e42af31..8363968187b2 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 56139d9cc266..dffbe80fa39b 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -10,7 +10,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.model.mapper import get_mapped_doc, map_child_doc +from frappe.model.mapper import map_child_doc from frappe.utils import cint, floor, flt, today from six import iteritems diff --git a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py index 26e3fa6b3caf..6bd53d38d769 100644 --- a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py +++ b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from frappe import _ def get_data(): diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index ba2e247b0d9a..01040c6b8bcc 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _, throw from frappe.model.document import Document from frappe.utils import cint diff --git a/erpnext/stock/doctype/price_list_country/price_list_country.py b/erpnext/stock/doctype/price_list_country/price_list_country.py index bea48b3d1272..a57729fb2e43 100644 --- a/erpnext/stock/doctype/price_list_country/price_list_country.py +++ b/erpnext/stock/doctype/price_list_country/price_list_country.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 11f407f8faa5..475ac2f06f06 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _, throw from frappe.desk.notifications import clear_doctype_notifications from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 0c55e54dbe5f..c61304098f4b 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -7,8 +7,7 @@ import unittest import frappe -import frappe.defaults -from frappe.utils import add_days, cint, cstr, flt, random_string, today +from frappe.utils import add_days, cint, cstr, flt, today from six import iteritems import erpnext diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py index 375ff9a9a3fb..2d25140d2b67 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py index d3935294de96..7b56603321aa 100644 --- a/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py +++ b/erpnext/stock/doctype/quality_inspection_reading/quality_inspection_reading.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 64677d167c1b..5f97798974c9 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import add_to_date, cint, get_link_to_form, now, time_diff_in_hours, today +from frappe.utils import cint, get_link_to_form, now, today from frappe.utils.user import get_users_with_role from rq.timeouts import JobTimeoutException diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 2a254a23ec67..09ab0980b917 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -6,7 +6,6 @@ import json import frappe -import frappe.defaults from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.utils import cint, comma_or, cstr, flt, format_time, formatdate, getdate, nowdate diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 34f6eaf40aea..e056d8df8547 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -6,7 +6,6 @@ import unittest import frappe -import frappe.defaults from frappe.permissions import add_user_permission, remove_user_permission from frappe.utils import flt, nowdate, nowtime from six import iteritems @@ -17,10 +16,9 @@ make_item_variant, set_item_variant_settings, ) -from erpnext.stock.doctype.serial_no.serial_no import * +from erpnext.stock.doctype.serial_no.serial_no import * # noqa from erpnext.stock.doctype.stock_entry.stock_entry import ( - make_stock_in_entry, - move_sample_to_retention_warehouse, + move_sample_to_retention_warehouse ) from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import StockFreezeError diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py index c0507ac928a2..6c03425a9e2f 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py index 1ed2a62930c2..6058d1a0dc08 100644 --- a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py +++ b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestStockEntryType(unittest.TestCase): diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index d3d023500ad5..f2c1b9a51538 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.defaults from frappe import _, msgprint from frappe.utils import cint, cstr, flt @@ -13,7 +12,7 @@ from erpnext.controllers.stock_controller import StockController from erpnext.stock.doctype.batch.batch import get_batch_qty from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos -from erpnext.stock.utils import get_available_serial_nos, get_incoming_rate, get_stock_balance +from erpnext.stock.utils import get_stock_balance class OpeningEntryAccountError(frappe.ValidationError): pass diff --git a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py index b2a72869c8c7..227e72769b5a 100644 --- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py +++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py index fc0636f23e06..9d9d4c6f25bc 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 656ebc8d3a1f..d578e6a83a0b 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import copy import json import frappe diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py index 2dad1d24113f..da57baddc8cb 100644 --- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py +++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py @@ -5,7 +5,7 @@ import frappe from frappe import _ -from frappe.utils import cint, flt, getdate +from frappe.utils import cint, getdate def execute(filters=None): diff --git a/erpnext/stock/report/bom_search/bom_search.py b/erpnext/stock/report/bom_search/bom_search.py index 3228d59e5f4c..68071b598112 100644 --- a/erpnext/stock/report/bom_search/bom_search.py +++ b/erpnext/stock/report/bom_search/bom_search.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import json import frappe from six import iteritems diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py index e6c192c78781..6d03ec1c0508 100644 --- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py index 434a436658b7..aa5ae0ed3d46 100644 --- a/erpnext/stock/report/item_prices/item_prices.py +++ b/erpnext/stock/report/item_prices/item_prices.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe import _, msgprint +from frappe import _ from frappe.utils import flt diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py index 4703d2bb7746..29595323980a 100644 --- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe import _ from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py index c0ed09c54bc2..897a130a51af 100644 --- a/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py +++ b/erpnext/stock/report/serial_no_ledger/serial_no_ledger.py @@ -5,7 +5,6 @@ from frappe import _ -from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos from erpnext.stock.stock_ledger import get_stock_ledger_entries diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 7dd966eb0527..fc5d5c12da47 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -7,7 +7,7 @@ import frappe from frappe import _ -from frappe.utils import cint, date_diff, flt, getdate, now +from frappe.utils import cint, date_diff, flt, getdate from six import iteritems import erpnext diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py index 9ae316fd1960..354faa01a436 100644 --- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py +++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py @@ -8,16 +8,15 @@ import frappe from frappe import _ -from frappe.utils import cint, flt, getdate +from frappe.utils import flt from six import iteritems from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue from erpnext.stock.report.stock_balance.stock_balance import ( - get_item_details, - get_item_reorder_details, + get_item_details, get_item_warehouse_map, get_items, - get_stock_ledger_entries, + get_stock_ledger_entries ) from erpnext.stock.utils import is_reposting_item_valuation_in_progress diff --git a/erpnext/stock/stock_balance.py b/erpnext/stock/stock_balance.py index 6a8c5b8bdb00..1cb0f0d0a498 100644 --- a/erpnext/stock/stock_balance.py +++ b/erpnext/stock/stock_balance.py @@ -7,7 +7,6 @@ from frappe.utils import cstr, flt, nowdate, nowtime from erpnext.controllers.stock_controller import create_repost_item_valuation_entry -from erpnext.stock.stock_ledger import update_entries_after from erpnext.stock.utils import update_bin diff --git a/erpnext/support/doctype/issue_priority/issue_priority.py b/erpnext/support/doctype/issue_priority/issue_priority.py index f7b97e02a128..1a7daf693d25 100644 --- a/erpnext/support/doctype/issue_priority/issue_priority.py +++ b/erpnext/support/doctype/issue_priority/issue_priority.py @@ -4,8 +4,6 @@ from __future__ import unicode_literals -import frappe -from frappe import _ from frappe.model.document import Document diff --git a/erpnext/support/doctype/issue_type/issue_type.py b/erpnext/support/doctype/issue_type/issue_type.py index e74ea53a8b6d..089ae28491a7 100644 --- a/erpnext/support/doctype/issue_type/issue_type.py +++ b/erpnext/support/doctype/issue_type/issue_type.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/support/doctype/issue_type/test_issue_type.py b/erpnext/support/doctype/issue_type/test_issue_type.py index 225473915ea4..c05039b2925b 100644 --- a/erpnext/support/doctype/issue_type/test_issue_type.py +++ b/erpnext/support/doctype/issue_type/test_issue_type.py @@ -5,7 +5,6 @@ import unittest -import frappe class TestIssueType(unittest.TestCase): diff --git a/erpnext/support/doctype/support_settings/support_settings.py b/erpnext/support/doctype/support_settings/support_settings.py index 1d06f88cbbde..73aad9d82fdb 100644 --- a/erpnext/support/doctype/support_settings/support_settings.py +++ b/erpnext/support/doctype/support_settings/support_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.py b/erpnext/support/doctype/warranty_claim/warranty_claim.py index 224a5927f1e6..5fb11242a9dd 100644 --- a/erpnext/support/doctype/warranty_claim/warranty_claim.py +++ b/erpnext/support/doctype/warranty_claim/warranty_claim.py @@ -6,7 +6,7 @@ import frappe from frappe import _, session -from frappe.utils import now_datetime, today +from frappe.utils import now_datetime from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/support/web_form/issues/issues.py b/erpnext/support/web_form/issues/issues.py index d252f49b06b9..7b390ea2e4da 100644 --- a/erpnext/support/web_form/issues/issues.py +++ b/erpnext/support/web_form/issues/issues.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py index 5cf208711a2a..7c441f7623a7 100644 --- a/erpnext/templates/pages/cart.py +++ b/erpnext/templates/pages/cart.py @@ -4,7 +4,6 @@ no_cache = 1 -import frappe from erpnext.shopping_cart.cart import get_cart_quotation diff --git a/erpnext/templates/pages/partners.py b/erpnext/templates/pages/partners.py index 44a8f8d1dcaf..b1c668a2f637 100644 --- a/erpnext/templates/pages/partners.py +++ b/erpnext/templates/pages/partners.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe -import frappe.website.render page_title = "Partners" diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py index 91d0e44e09ce..159c58ab34e6 100644 --- a/erpnext/templates/pages/projects.py +++ b/erpnext/templates/pages/projects.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import json import frappe diff --git a/erpnext/templates/pages/regional/india/update_gstin.py b/erpnext/templates/pages/regional/india/update_gstin.py index 952858786fa4..a8d03d586319 100644 --- a/erpnext/templates/pages/regional/india/update_gstin.py +++ b/erpnext/templates/pages/regional/india/update_gstin.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ from six import iteritems diff --git a/erpnext/templates/pages/task_info.py b/erpnext/templates/pages/task_info.py index 4942914d376c..f219c3deb7b5 100644 --- a/erpnext/templates/pages/task_info.py +++ b/erpnext/templates/pages/task_info.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ def get_context(context): diff --git a/erpnext/templates/pages/timelog_info.py b/erpnext/templates/pages/timelog_info.py index 9ffc00bd800c..e0fb60da23d8 100644 --- a/erpnext/templates/pages/timelog_info.py +++ b/erpnext/templates/pages/timelog_info.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import frappe -from frappe import _ def get_context(context): diff --git a/erpnext/tests/test_notifications.py b/erpnext/tests/test_notifications.py index 331f32bf583c..5fd9582dea03 100644 --- a/erpnext/tests/test_notifications.py +++ b/erpnext/tests/test_notifications.py @@ -7,7 +7,6 @@ import frappe from frappe.desk import notifications -from frappe.test_runner import make_test_objects class TestNotifications(unittest.TestCase): diff --git a/erpnext/tests/test_woocommerce.py b/erpnext/tests/test_woocommerce.py index ce1b0ef77fb9..881f286baebb 100644 --- a/erpnext/tests/test_woocommerce.py +++ b/erpnext/tests/test_woocommerce.py @@ -7,7 +7,6 @@ import frappe import requests -import erpnext from erpnext.erpnext_integrations.connectors.woocommerce_connection import order diff --git a/erpnext/utilities/doctype/sms_log/sms_log.py b/erpnext/utilities/doctype/sms_log/sms_log.py index f8426de064de..ce3cc46665ba 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.py +++ b/erpnext/utilities/doctype/sms_log/sms_log.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals -import frappe from frappe.model.document import Document diff --git a/erpnext/utilities/doctype/sms_log/test_sms_log.py b/erpnext/utilities/doctype/sms_log/test_sms_log.py index 953486473ac1..c58a8e0a8c39 100644 --- a/erpnext/utilities/doctype/sms_log/test_sms_log.py +++ b/erpnext/utilities/doctype/sms_log/test_sms_log.py @@ -5,7 +5,6 @@ import unittest -import frappe # test_records = frappe.get_test_records('SMS Log') diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 3fc1596ed2a3..15da1524d393 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -7,15 +7,11 @@ import frappe.share from frappe import _ from frappe.utils import ( - cint, + cint, cstr, - date_diff, flt, - get_datetime, - get_link_to_form, get_time, - now_datetime, - nowdate, + now_datetime ) from six import string_types diff --git a/erpnext/utilities/web_form/addresses/addresses.py b/erpnext/utilities/web_form/addresses/addresses.py index 1a7d5d6095f2..a2236a352a1a 100644 --- a/erpnext/utilities/web_form/addresses/addresses.py +++ b/erpnext/utilities/web_form/addresses/addresses.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import frappe def get_context(context): diff --git a/erpnext/www/all-products/index.py b/erpnext/www/all-products/index.py index 292960697bc8..2de7a779f2f8 100644 --- a/erpnext/www/all-products/index.py +++ b/erpnext/www/all-products/index.py @@ -1,10 +1,7 @@ import frappe from erpnext.portal.product_configurator.utils import ( - get_attribute_filter_data, - get_field_filter_data, - get_product_settings, - get_products_for_website, + get_product_settings ) from erpnext.shopping_cart.filters import ProductFiltersBuilder from erpnext.shopping_cart.product_query import ProductQuery From e33d7f1e945f8c401402da84ac03dfafb8c7218f Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:44:43 +0530 Subject: [PATCH 04/10] chore: Sort imports with isort --- .../account_balance_timeline.py | 10 +--------- erpnext/accounts/doctype/bank/test_bank.py | 1 - .../doctype/bank_guarantee/test_bank_guarantee.py | 1 - erpnext/accounts/doctype/c_form/test_c_form.py | 1 - .../doctype/cashier_closing/test_cashier_closing.py | 1 - .../test_chart_of_accounts_importer.py | 1 - .../test_cheque_print_template.py | 1 - .../test_exchange_rate_revaluation.py | 1 - .../item_tax_template/test_item_tax_template.py | 1 - .../loyalty_point_entry/test_loyalty_point_entry.py | 1 - .../loyalty_program/loyalty_program_dashboard.py | 1 - .../doctype/mode_of_payment/test_mode_of_payment.py | 1 - .../payment_gateway_account_dashboard.py | 1 - .../test_payment_gateway_account.py | 1 - .../doctype/payment_order/payment_order_dashboard.py | 1 - .../payment_reconciliation/payment_reconciliation.py | 5 +---- .../doctype/pos_closing_entry/pos_closing_entry.py | 1 - .../test_purchase_taxes_and_charges_template.py | 1 - .../accounts/doctype/sales_invoice/sales_invoice.py | 4 ++-- erpnext/accounts/doctype/share_type/test_share_type.py | 1 - .../doctype/shareholder/shareholder_dashboard.py | 1 - .../accounts/doctype/shareholder/test_shareholder.py | 1 - .../accounts/doctype/subscription/test_subscription.py | 4 ++-- .../accounts/doctype/tax_category/test_tax_category.py | 1 - erpnext/accounts/doctype/tax_rule/test_tax_rule.py | 5 +---- .../tax_withholding_category_dashboard.py | 1 - .../report/accounts_payable/accounts_payable.py | 1 - .../accounts_payable_summary.py | 1 - .../asset_depreciation_ledger.py | 1 - .../customer_ledger_summary/customer_ledger_summary.py | 1 - .../item_wise_purchase_register.py | 4 ++-- .../purchase_invoice_trends/purchase_invoice_trends.py | 1 - .../sales_invoice_trends/sales_invoice_trends.py | 1 - .../supplier_ledger_summary/supplier_ledger_summary.py | 1 - .../test_agriculture_analysis_criteria.py | 1 - .../doctype/agriculture_task/test_agriculture_task.py | 1 - .../doctype/plant_analysis/test_plant_analysis.py | 1 - .../doctype/soil_analysis/test_soil_analysis.py | 1 - .../doctype/water_analysis/test_water_analysis.py | 1 - erpnext/agriculture/doctype/weather/test_weather.py | 1 - .../request_for_quotation_dashboard.py | 1 - erpnext/buying/doctype/supplier/supplier.py | 5 +---- erpnext/controllers/accounts_controller.py | 5 +---- erpnext/controllers/buying_controller.py | 1 - erpnext/controllers/print_settings.py | 1 - .../test_contract_fulfilment_checklist.py | 1 - .../contract_template/test_contract_template.py | 1 - erpnext/crm/doctype/lead/lead_dashboard.py | 1 - .../crm/doctype/market_segment/test_market_segment.py | 1 - .../crm/doctype/opportunity/opportunity_dashboard.py | 1 - .../doctype/opportunity_type/test_opportunity_type.py | 1 - erpnext/crm/doctype/sales_stage/test_sales_stage.py | 1 - .../doctype/academic_term/test_academic_term.py | 1 - .../doctype/academic_year/test_academic_year.py | 1 - erpnext/education/doctype/article/test_article.py | 1 - .../assessment_criteria/test_assessment_criteria.py | 1 - .../test_assessment_criteria_group.py | 1 - .../doctype/assessment_group/test_assessment_group.py | 1 - .../doctype/assessment_plan/test_assessment_plan.py | 1 - .../assessment_result/test_assessment_result.py | 1 - .../test_assessment_result_tool.py | 1 - .../doctype/content_question/test_content_question.py | 1 - .../doctype/course_content/test_course_content.py | 1 - .../test_course_scheduling_tool.py | 1 - .../doctype/course_topic/test_course_topic.py | 1 - .../education_settings/test_education_settings.py | 1 - .../doctype/fee_category/test_fee_category.py | 1 - .../doctype/fee_structure/test_fee_structure.py | 1 - .../doctype/grading_scale/test_grading_scale.py | 1 - erpnext/education/doctype/guardian/test_guardian.py | 1 - .../education/doctype/instructor/test_instructor.py | 1 - .../doctype/program_enrollment/program_enrollment.py | 1 - .../test_program_enrollment_tool.py | 1 - erpnext/education/doctype/question/test_question.py | 1 - erpnext/education/doctype/quiz/quiz.py | 1 - erpnext/education/doctype/quiz/test_quiz.py | 1 - .../doctype/quiz_activity/test_quiz_activity.py | 1 - .../education/doctype/quiz_result/test_quiz_result.py | 1 - erpnext/education/doctype/room/test_room.py | 1 - .../doctype/school_house/test_school_house.py | 1 - .../student_admission/test_student_admission.py | 1 - .../student_applicant/test_student_applicant.py | 1 - .../student_attendance/test_student_attendance.py | 1 - .../test_student_attendance_tool.py | 1 - .../student_batch_name/test_student_batch_name.py | 1 - .../doctype/student_category/test_student_category.py | 1 - .../test_student_group_creation_tool.py | 1 - .../doctype/student_language/test_student_language.py | 1 - .../education/doctype/student_log/test_student_log.py | 1 - .../test_student_report_generation_tool.py | 1 - .../doctype/topic_content/test_topic_content.py | 1 - .../student_monthly_attendance_sheet.py | 1 - .../web_form/student_applicant/student_applicant.py | 1 - .../doctype/amazon_mws_settings/amazon_mws_api.py | 1 - .../quickbooks_migrator/test_quickbooks_migrator.py | 1 - .../doctype/shopify_log/test_shopify_log.py | 1 - .../doctype/tally_migration/test_tally_migration.py | 1 - .../healthcare/page/patient_history/patient_history.py | 1 - erpnext/hotels/doctype/hotel_room/test_hotel_room.py | 1 - .../hotel_room_package/test_hotel_room_package.py | 1 - .../hotel_room_pricing/test_hotel_room_pricing.py | 1 - .../test_hotel_room_pricing_package.py | 1 - .../doctype/hotel_room_type/test_hotel_room_type.py | 1 - .../doctype/hotel_settings/test_hotel_settings.py | 1 - erpnext/hr/doctype/appraisal/test_appraisal.py | 1 - .../appraisal_template/appraisal_template_dashboard.py | 1 - .../appraisal_template/test_appraisal_template.py | 1 - erpnext/hr/doctype/attendance/attendance_dashboard.py | 1 - .../doctype/daily_work_summary/daily_work_summary.py | 1 - .../employee_advance/employee_advance_dashboard.py | 1 - .../hr/doctype/employee_grade/test_employee_grade.py | 1 - .../test_employee_health_insurance.py | 1 - .../employee_onboarding_template_dashboard.py | 1 - .../test_employee_onboarding_template.py | 1 - .../employee_separation_template_dashboard.py | 1 - .../test_employee_separation_template.py | 1 - .../test_employee_transfer_property.py | 1 - .../expense_claim_type/test_expense_claim_type.py | 1 - erpnext/hr/doctype/hr_settings/test_hr_settings.py | 2 -- .../test_identification_document_type.py | 1 - erpnext/hr/doctype/interest/test_interest.py | 1 - .../doctype/job_applicant/job_applicant_dashboard.py | 1 - .../hr/doctype/job_opening/job_opening_dashboard.py | 1 - erpnext/hr/doctype/job_opening/test_job_opening.py | 1 - .../leave_allocation/leave_allocation_dashboard.py | 1 - .../doctype/leave_allocation/test_leave_allocation.py | 4 +--- .../leave_control_panel/test_leave_control_panel.py | 1 - .../leave_policy_detail/test_leave_policy_detail.py | 1 - erpnext/hr/doctype/leave_type/leave_type.py | 1 - erpnext/hr/doctype/offer_term/test_offer_term.py | 1 - .../purpose_of_travel/test_purpose_of_travel.py | 1 - .../doctype/shift_request/shift_request_dashboard.py | 1 - erpnext/hr/doctype/shift_type/shift_type_dashboard.py | 1 - erpnext/hr/doctype/shift_type/test_shift_type.py | 1 - .../doctype/staffing_plan/staffing_plan_dashboard.py | 1 - .../doctype/training_event/training_event_dashboard.py | 1 - .../hr/doctype/training_result/test_training_result.py | 1 - .../hr/doctype/travel_request/test_travel_request.py | 1 - .../training_feedback/training_feedback.py | 1 - .../training_scheduled/training_scheduled.py | 1 - erpnext/hr/web_form/job_application/job_application.py | 1 - .../doctype/hub_tracked_item/test_hub_tracked_item.py | 1 - .../marketplace_settings/marketplace_settings.py | 1 - .../marketplace_settings/test_marketplace_settings.py | 1 - erpnext/loan_management/doctype/loan/loan_dashboard.py | 1 - erpnext/loan_management/doctype/loan/test_loan.py | 10 +--------- .../loan_application/loan_application_dashboard.py | 1 - .../loan_interest_accrual/loan_interest_accrual.py | 10 +--------- .../test_loan_interest_accrual.py | 9 +-------- .../doctype/loan_repayment/loan_repayment.py | 10 +--------- .../doctype/loan_security/loan_security_dashboard.py | 1 - .../doctype/loan_security_price/loan_security_price.py | 4 +--- .../loan_security_type/loan_security_type_dashboard.py | 1 - .../loan_security_unpledge/loan_security_unpledge.py | 2 -- .../doctype/loan_type/loan_type_dashboard.py | 1 - .../process_loan_interest_accrual_dashboard.py | 1 - .../process_loan_security_shortfall_dashboard.py | 1 - .../maintenance_visit/test_maintenance_visit.py | 1 - .../doctype/blanket_order/blanket_order_dashboard.py | 1 - erpnext/manufacturing/doctype/job_card/job_card.py | 4 ++-- .../manufacturing/doctype/routing/routing_dashboard.py | 1 - .../material_request_receipt_notification.py | 1 - .../manufacturing/report/bom_explorer/bom_explorer.py | 1 - .../test_certification_application.py | 1 - .../certified_consultant/test_certified_consultant.py | 1 - .../certification_application.py | 1 - .../certification_application_usd.py | 1 - erpnext/patches/v11_0/uom_conversion_data.py | 1 - .../v12_0/remove_bank_remittance_custom_fields.py | 1 - erpnext/patches/v12_0/set_multi_uom_in_rfq.py | 1 - .../patches/v12_0/update_ewaybill_field_position.py | 1 - erpnext/patches/v12_0/update_uom_conversion_factor.py | 1 - .../patches/v13_0/print_uom_after_quantity_patch.py | 1 - .../employee_incentive/test_employee_incentive.py | 1 - .../test_employee_tax_exemption_category.py | 1 - .../test_employee_tax_exemption_sub_category.py | 1 - .../doctype/payroll_entry/payroll_entry_dashboard.py | 1 - .../doctype/payroll_period/payroll_period_dashboard.py | 1 - .../doctype/payroll_period/test_payroll_period.py | 1 - .../doctype/retention_bonus/test_retention_bonus.py | 1 - .../salary_structure/salary_structure_dashboard.py | 1 - .../test_salary_structure_assignment.py | 1 - .../notification/retention_bonus/retention_bonus.py | 1 - .../payroll/report/bank_remittance/bank_remittance.py | 1 - .../products_settings/test_products_settings.py | 1 - erpnext/projects/doctype/project/project.py | 10 +--------- .../projects_settings/test_projects_settings.py | 1 - erpnext/projects/doctype/task_type/test_task_type.py | 1 - erpnext/projects/doctype/timesheet/timesheet.py | 6 +----- .../doctype/quality_action/test_quality_action.py | 1 - .../test_quality_feedback_template.py | 1 - .../doctype/quality_goal/test_quality_goal.py | 1 - .../doctype/quality_meeting/test_quality_meeting.py | 1 - .../regional/doctype/gst_hsn_code/test_gst_hsn_code.py | 1 - .../regional/doctype/gst_settings/test_gst_settings.py | 1 - erpnext/regional/france/utils.py | 1 - erpnext/regional/india/utils.py | 9 +-------- erpnext/regional/report/datev/test_datev.py | 4 ++-- erpnext/regional/united_arab_emirates/setup.py | 1 - .../restaurant/doctype/restaurant/test_restaurant.py | 1 - .../test_restaurant_reservation.py | 1 - .../doctype/restaurant_table/test_restaurant_table.py | 1 - erpnext/selling/doctype/customer/customer.py | 5 +---- .../installation_note/test_installation_note.py | 1 - ...ales_partner_target_variance_based_on_item_group.py | 1 - ...sales_person_target_variance_based_on_item_group.py | 1 - .../territory_target_variance_based_on_item_group.py | 1 - .../authorization_rule/test_authorization_rule.py | 1 - .../setup/doctype/email_digest/test_email_digest.py | 1 - .../doctype/global_defaults/test_global_defaults.py | 1 - erpnext/setup/doctype/party_type/test_party_type.py | 1 - erpnext/setup/setup_wizard/operations/company_setup.py | 1 - erpnext/setup/setup_wizard/utils.py | 1 - .../warehouse_wise_stock_value.py | 1 - erpnext/stock/doctype/bin/test_bin.py | 1 - .../test_customs_tariff_number.py | 1 - .../delivery_settings/test_delivery_settings.py | 1 - erpnext/stock/doctype/manufacturer/manufacturer.py | 4 +--- .../stock/doctype/manufacturer/test_manufacturer.py | 1 - .../stock/doctype/material_request/material_request.py | 1 - .../stock/doctype/packing_slip/test_packing_slip.py | 1 - erpnext/stock/doctype/pick_list/pick_list_dashboard.py | 1 - erpnext/stock/doctype/stock_entry/test_stock_entry.py | 4 +--- .../doctype/stock_entry_type/test_stock_entry_type.py | 1 - erpnext/stock/report/bom_search/bom_search.py | 1 - .../warehouse_wise_item_balance_age_and_value.py | 4 ++-- erpnext/support/doctype/issue_type/test_issue_type.py | 1 - erpnext/support/web_form/issues/issues.py | 1 - erpnext/templates/pages/projects.py | 1 - erpnext/utilities/doctype/sms_log/test_sms_log.py | 1 - erpnext/utilities/transaction_base.py | 8 +------- erpnext/utilities/web_form/addresses/addresses.py | 1 - erpnext/www/all-products/index.py | 4 +--- 233 files changed, 31 insertions(+), 330 deletions(-) diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index 979b5a381342..5eb857719a91 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -3,22 +3,14 @@ from __future__ import unicode_literals - import frappe from frappe import _ -from frappe.utils import ( - add_to_date, - formatdate, - get_link_to_form, - getdate, - nowdate -) +from frappe.utils import add_to_date, formatdate, get_link_to_form, getdate, nowdate from frappe.utils.dashboard import cache_source from frappe.utils.dateutils import get_from_date_from_timespan, get_period_ending from frappe.utils.nestedset import get_descendants_of - @frappe.whitelist() @cache_source def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None, diff --git a/erpnext/accounts/doctype/bank/test_bank.py b/erpnext/accounts/doctype/bank/test_bank.py index 13713b516380..62d14d6fc63e 100644 --- a/erpnext/accounts/doctype/bank/test_bank.py +++ b/erpnext/accounts/doctype/bank/test_bank.py @@ -6,6 +6,5 @@ import unittest - class TestBank(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py index 863e1be15bc2..5cd455fd6c6b 100644 --- a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py +++ b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py @@ -6,6 +6,5 @@ import unittest - class TestBankGuarantee(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/c_form/test_c_form.py b/erpnext/accounts/doctype/c_form/test_c_form.py index c84f54ba27fa..e5c561573187 100644 --- a/erpnext/accounts/doctype/c_form/test_c_form.py +++ b/erpnext/accounts/doctype/c_form/test_c_form.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('C-Form') class TestCForm(unittest.TestCase): diff --git a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py index 5d28d17a2735..981093f3d04c 100644 --- a/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py +++ b/erpnext/accounts/doctype/cashier_closing/test_cashier_closing.py @@ -6,6 +6,5 @@ import unittest - class TestCashierClosing(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py index 00a954b811ae..ca9cf699aa7f 100644 --- a/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py +++ b/erpnext/accounts/doctype/chart_of_accounts_importer/test_chart_of_accounts_importer.py @@ -6,6 +6,5 @@ import unittest - class TestChartofAccountsImporter(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py index d6ec72e1d209..8ce8794cfcf9 100644 --- a/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/test_cheque_print_template.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Cheque Print Template') class TestChequePrintTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py index 3e3638a73e56..e725ce4da450 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/test_exchange_rate_revaluation.py @@ -6,6 +6,5 @@ import unittest - class TestExchangeRateRevaluation(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py index 679a54d6663c..46bb300e37da 100644 --- a/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py +++ b/erpnext/accounts/doctype/item_tax_template/test_item_tax_template.py @@ -6,6 +6,5 @@ import unittest - class TestItemTaxTemplate(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py index c4315f93733e..07856cfd5d67 100644 --- a/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py +++ b/erpnext/accounts/doctype/loyalty_point_entry/test_loyalty_point_entry.py @@ -6,6 +6,5 @@ import unittest - class TestLoyaltyPointEntry(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py index 6a3d0fa9738f..267bbbf00b2e 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loyalty_program', diff --git a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py index dc80c6bb9615..299687b067e5 100644 --- a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Mode of Payment') class TestModeofPayment(unittest.TestCase): diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py index 65b743bfd15a..2edc1a1590b5 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py +++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'payment_gateway_account', diff --git a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py index c0cdfcdc84c9..f76aa4a80f8e 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py +++ b/erpnext/accounts/doctype/payment_gateway_account/test_payment_gateway_account.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Payment Gateway Account') class TestPaymentGatewayAccount(unittest.TestCase): diff --git a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py index 893da7455daa..d9262be9b869 100644 --- a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py +++ b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'payment_order', diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index c6cafdc0a713..9de79aee58a2 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -9,10 +9,7 @@ from frappe.utils import flt, getdate, nowdate, today import erpnext -from erpnext.accounts.utils import ( - get_outstanding_invoices, - reconcile_against_document -) +from erpnext.accounts.utils import get_outstanding_invoices, reconcile_against_document from erpnext.controllers.accounts_controller import get_advance_payment_entries diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py index 8093936119f9..896ebdfd5e66 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.utils import flt, get_datetime diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py index 8a04ddea2296..c60c81b7239c 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Purchase Taxes and Charges Template') class TestPurchaseTaxesandChargesTemplate(unittest.TestCase): diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 8bd79eae0483..458a17c43a0a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -24,8 +24,8 @@ import erpnext from erpnext.accounts.deferred_revenue import validate_service_stop_date from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( - get_loyalty_program_details_with_points, - validate_loyalty_points + get_loyalty_program_details_with_points, + validate_loyalty_points, ) from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import ( get_party_tax_withholding_details, diff --git a/erpnext/accounts/doctype/share_type/test_share_type.py b/erpnext/accounts/doctype/share_type/test_share_type.py index f2076fd52fe1..a6f8d611c1b5 100644 --- a/erpnext/accounts/doctype/share_type/test_share_type.py +++ b/erpnext/accounts/doctype/share_type/test_share_type.py @@ -6,6 +6,5 @@ import unittest - class TestShareType(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py index 1373c32824d1..0084f2567ab2 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py +++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'shareholder', diff --git a/erpnext/accounts/doctype/shareholder/test_shareholder.py b/erpnext/accounts/doctype/shareholder/test_shareholder.py index 34feb56418c8..6790fdd2ff71 100644 --- a/erpnext/accounts/doctype/shareholder/test_shareholder.py +++ b/erpnext/accounts/doctype/shareholder/test_shareholder.py @@ -6,6 +6,5 @@ import unittest - class TestShareholder(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 40965d372625..e2cf4d5a4423 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -7,13 +7,13 @@ import frappe from frappe.utils.data import ( - add_days, + add_days, add_months, add_to_date, date_diff, flt, get_date_str, - nowdate + nowdate, ) from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor diff --git a/erpnext/accounts/doctype/tax_category/test_tax_category.py b/erpnext/accounts/doctype/tax_category/test_tax_category.py index f57a6fb6b5b5..90931058f07d 100644 --- a/erpnext/accounts/doctype/tax_category/test_tax_category.py +++ b/erpnext/accounts/doctype/tax_category/test_tax_category.py @@ -6,6 +6,5 @@ import unittest - class TestTaxCategory(unittest.TestCase): pass diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py index 19762350dca1..f937274edf53 100644 --- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py @@ -7,10 +7,7 @@ import frappe -from erpnext.accounts.doctype.tax_rule.tax_rule import ( - ConflictingTaxRule, - get_tax_template -) +from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule, get_tax_template from erpnext.crm.doctype.opportunity.opportunity import make_quotation from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py index ae2ba8505374..152ee4608140 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'tax_withholding_category', diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.py b/erpnext/accounts/report/accounts_payable/accounts_payable.py index 1bd369bdd8db..0de573e45416 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.py +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py index 1fd977d54236..6034ec0d83b4 100644 --- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py +++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import ( AccountsReceivableSummary, ) diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py index c135efe6d470..0fd4ca0f24a1 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py @@ -8,7 +8,6 @@ from frappe.utils import flt - def execute(filters=None): columns, data = get_columns(), get_data(filters) return columns, data diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index c4db3281ce7f..603fbac5aa9f 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -9,7 +9,6 @@ from six import iteritems, itervalues - class PartyLedgerSummaryReport(object): def __init__(self, filters=None): self.filters = frappe._dict(filters or {}) diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 892424868f58..cd25c0500406 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -9,12 +9,12 @@ import erpnext from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import ( - add_sub_total_row, + add_sub_total_row, add_total_row, get_grand_total, get_group_by_and_display_fields, get_group_by_conditions, - get_tax_accounts + get_tax_accounts, ) from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import get_item_details diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py index 63d2f0283f38..b26c733bc7e4 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py index f148c8a49b8e..0ec54c932b81 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.controllers.trends import get_columns, get_data diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py index 65047e1c55f7..00316ba2652b 100644 --- a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py +++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import ( PartyLedgerSummaryReport, ) diff --git a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py index 43384dd791bc..4213e45c078a 100644 --- a/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py +++ b/erpnext/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py @@ -6,6 +6,5 @@ import unittest - class TestAgricultureAnalysisCriteria(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py index b54b46f210f4..2b3c33869720 100644 --- a/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py +++ b/erpnext/agriculture/doctype/agriculture_task/test_agriculture_task.py @@ -6,6 +6,5 @@ import unittest - class TestAgricultureTask(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py index cb48b099d8bb..6b6e84361243 100644 --- a/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py +++ b/erpnext/agriculture/doctype/plant_analysis/test_plant_analysis.py @@ -6,6 +6,5 @@ import unittest - class TestPlantAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py index c2612b8314d3..24fe0748d38c 100644 --- a/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py +++ b/erpnext/agriculture/doctype/soil_analysis/test_soil_analysis.py @@ -6,6 +6,5 @@ import unittest - class TestSoilAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py index 74bbad8b385f..5cddeeb1616a 100644 --- a/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py +++ b/erpnext/agriculture/doctype/water_analysis/test_water_analysis.py @@ -6,6 +6,5 @@ import unittest - class TestWaterAnalysis(unittest.TestCase): pass diff --git a/erpnext/agriculture/doctype/weather/test_weather.py b/erpnext/agriculture/doctype/weather/test_weather.py index e9e77bd77f07..1b4bab9a53ac 100644 --- a/erpnext/agriculture/doctype/weather/test_weather.py +++ b/erpnext/agriculture/doctype/weather/test_weather.py @@ -6,6 +6,5 @@ import unittest - class TestWeather(unittest.TestCase): pass diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py index 8e670e292d84..0708cab30a13 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'docstatus': 1, diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index a66f801cb5d9..2a9f784ec6e3 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -12,10 +12,7 @@ ) from frappe.model.naming import set_name_by_naming_series -from erpnext.accounts.party import ( - get_dashboard_info, - validate_party_accounts -) +from erpnext.accounts.party import get_dashboard_info, validate_party_accounts from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index a6be85022400..feb88ff06e8c 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -7,10 +7,7 @@ import frappe from frappe import _, throw -from frappe.model.workflow import ( - get_workflow_name, - is_transition_condition_satisfied -) +from frappe.model.workflow import get_workflow_name, is_transition_condition_satisfied from frappe.utils import ( add_days, add_months, diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 5388ecd62669..e0b3ad801ec4 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe import _, msgprint from frappe.contacts.doctype.address.address import get_address_display diff --git a/erpnext/controllers/print_settings.py b/erpnext/controllers/print_settings.py index 0ccf24edfd40..f6e061bcdcf5 100644 --- a/erpnext/controllers/print_settings.py +++ b/erpnext/controllers/print_settings.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals - def set_print_templates_for_item_table(doc, settings): doc.print_templates = { "items": "templates/print_formats/includes/items.html", diff --git a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py index a4c44db5c191..82e7ad35c9ed 100644 --- a/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py +++ b/erpnext/crm/doctype/contract_fulfilment_checklist/test_contract_fulfilment_checklist.py @@ -6,6 +6,5 @@ import unittest - class TestContractFulfilmentChecklist(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/contract_template/test_contract_template.py b/erpnext/crm/doctype/contract_template/test_contract_template.py index e07079be86f8..50655054c850 100644 --- a/erpnext/crm/doctype/contract_template/test_contract_template.py +++ b/erpnext/crm/doctype/contract_template/test_contract_template.py @@ -6,6 +6,5 @@ import unittest - class TestContractTemplate(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py index e8c320e7e1fb..fa351c707798 100644 --- a/erpnext/crm/doctype/lead/lead_dashboard.py +++ b/erpnext/crm/doctype/lead/lead_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'lead', diff --git a/erpnext/crm/doctype/market_segment/test_market_segment.py b/erpnext/crm/doctype/market_segment/test_market_segment.py index 83b4849d8f11..b95cc4cde0d9 100644 --- a/erpnext/crm/doctype/market_segment/test_market_segment.py +++ b/erpnext/crm/doctype/market_segment/test_market_segment.py @@ -6,6 +6,5 @@ import unittest - class TestMarketSegment(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py index 05cb30e84beb..693a86cfcdf8 100644 --- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py +++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'opportunity', diff --git a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py index f5f5304211b6..f86a70e8cfae 100644 --- a/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py +++ b/erpnext/crm/doctype/opportunity_type/test_opportunity_type.py @@ -6,6 +6,5 @@ import unittest - class TestOpportunityType(unittest.TestCase): pass diff --git a/erpnext/crm/doctype/sales_stage/test_sales_stage.py b/erpnext/crm/doctype/sales_stage/test_sales_stage.py index 9a176c73c360..83d1f269fd74 100644 --- a/erpnext/crm/doctype/sales_stage/test_sales_stage.py +++ b/erpnext/crm/doctype/sales_stage/test_sales_stage.py @@ -6,6 +6,5 @@ import unittest - class TestSalesStage(unittest.TestCase): pass diff --git a/erpnext/education/doctype/academic_term/test_academic_term.py b/erpnext/education/doctype/academic_term/test_academic_term.py index bf5ca700ae4e..6329103870f3 100644 --- a/erpnext/education/doctype/academic_term/test_academic_term.py +++ b/erpnext/education/doctype/academic_term/test_academic_term.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Academic Term') class TestAcademicTerm(unittest.TestCase): diff --git a/erpnext/education/doctype/academic_year/test_academic_year.py b/erpnext/education/doctype/academic_year/test_academic_year.py index aa9feccf197b..31135c40f383 100644 --- a/erpnext/education/doctype/academic_year/test_academic_year.py +++ b/erpnext/education/doctype/academic_year/test_academic_year.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Academic Year') class TestAcademicYear(unittest.TestCase): diff --git a/erpnext/education/doctype/article/test_article.py b/erpnext/education/doctype/article/test_article.py index 74c71f1c68e1..cda79ad45793 100644 --- a/erpnext/education/doctype/article/test_article.py +++ b/erpnext/education/doctype/article/test_article.py @@ -6,6 +6,5 @@ import unittest - class TestArticle(unittest.TestCase): pass diff --git a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py index a8649d981c99..1098d0369fbd 100644 --- a/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py +++ b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Assessment Criteria') class TestAssessmentCriteria(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py index 5f65356c2d87..d65f1e78d1d3 100644 --- a/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py +++ b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Assessment Criteria Group') class TestAssessmentCriteriaGroup(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_group/test_assessment_group.py b/erpnext/education/doctype/assessment_group/test_assessment_group.py index 6524fd81018b..822d65c9bb71 100644 --- a/erpnext/education/doctype/assessment_group/test_assessment_group.py +++ b/erpnext/education/doctype/assessment_group/test_assessment_group.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Assessment Group') class TestAssessmentGroup(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py index 7278fa2b99ab..9a6b8860358b 100644 --- a/erpnext/education/doctype/assessment_plan/test_assessment_plan.py +++ b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Assessment Plan') class TestAssessmentPlan(unittest.TestCase): diff --git a/erpnext/education/doctype/assessment_result/test_assessment_result.py b/erpnext/education/doctype/assessment_result/test_assessment_result.py index b7911df47a3e..fa0ad1f692c5 100644 --- a/erpnext/education/doctype/assessment_result/test_assessment_result.py +++ b/erpnext/education/doctype/assessment_result/test_assessment_result.py @@ -5,7 +5,6 @@ import unittest - from erpnext.education.api import get_grade # test_records = frappe.get_test_records('Assessment Result') diff --git a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py index 70a271143c8c..bcc57220e78c 100644 --- a/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py +++ b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py @@ -6,6 +6,5 @@ import unittest - class TestAssessmentResultTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/content_question/test_content_question.py b/erpnext/education/doctype/content_question/test_content_question.py index 8de51f0edaba..f6bd49bb8022 100644 --- a/erpnext/education/doctype/content_question/test_content_question.py +++ b/erpnext/education/doctype/content_question/test_content_question.py @@ -6,6 +6,5 @@ import unittest - class TestContentQuestion(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_content/test_course_content.py b/erpnext/education/doctype/course_content/test_course_content.py index 8dfaafa9492d..320fa111f7ec 100644 --- a/erpnext/education/doctype/course_content/test_course_content.py +++ b/erpnext/education/doctype/course_content/test_course_content.py @@ -6,6 +6,5 @@ import unittest - class TestCourseContent(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py index baa40e316bfc..27379b70e1cf 100644 --- a/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py +++ b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py @@ -6,6 +6,5 @@ import unittest - class TestCourseSchedulingTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/course_topic/test_course_topic.py b/erpnext/education/doctype/course_topic/test_course_topic.py index 306957958555..0bba7f54788e 100644 --- a/erpnext/education/doctype/course_topic/test_course_topic.py +++ b/erpnext/education/doctype/course_topic/test_course_topic.py @@ -6,6 +6,5 @@ import unittest - class TestCourseTopic(unittest.TestCase): pass diff --git a/erpnext/education/doctype/education_settings/test_education_settings.py b/erpnext/education/doctype/education_settings/test_education_settings.py index acc82bd6f7fa..3611cbef21a3 100644 --- a/erpnext/education/doctype/education_settings/test_education_settings.py +++ b/erpnext/education/doctype/education_settings/test_education_settings.py @@ -6,6 +6,5 @@ import unittest - class TestEducationSettings(unittest.TestCase): pass diff --git a/erpnext/education/doctype/fee_category/test_fee_category.py b/erpnext/education/doctype/fee_category/test_fee_category.py index 3f859c78e92f..875568416f50 100644 --- a/erpnext/education/doctype/fee_category/test_fee_category.py +++ b/erpnext/education/doctype/fee_category/test_fee_category.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Fee Category') class TestFeeCategory(unittest.TestCase): diff --git a/erpnext/education/doctype/fee_structure/test_fee_structure.py b/erpnext/education/doctype/fee_structure/test_fee_structure.py index 57a0efa42a2e..1311f13997ec 100644 --- a/erpnext/education/doctype/fee_structure/test_fee_structure.py +++ b/erpnext/education/doctype/fee_structure/test_fee_structure.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Fee Structure') class TestFeeStructure(unittest.TestCase): diff --git a/erpnext/education/doctype/grading_scale/test_grading_scale.py b/erpnext/education/doctype/grading_scale/test_grading_scale.py index fc4c9cd997c7..e5d83c20c12c 100644 --- a/erpnext/education/doctype/grading_scale/test_grading_scale.py +++ b/erpnext/education/doctype/grading_scale/test_grading_scale.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Grading Scale') class TestGradingScale(unittest.TestCase): diff --git a/erpnext/education/doctype/guardian/test_guardian.py b/erpnext/education/doctype/guardian/test_guardian.py index 72ea9b494da2..446e26122158 100644 --- a/erpnext/education/doctype/guardian/test_guardian.py +++ b/erpnext/education/doctype/guardian/test_guardian.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Guardian') class TestGuardian(unittest.TestCase): diff --git a/erpnext/education/doctype/instructor/test_instructor.py b/erpnext/education/doctype/instructor/test_instructor.py index 0ab512182d76..b698a20e1111 100644 --- a/erpnext/education/doctype/instructor/test_instructor.py +++ b/erpnext/education/doctype/instructor/test_instructor.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Instructor') class TestInstructor(unittest.TestCase): diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index cc1a8a095026..79c5a14d8c82 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -11,7 +11,6 @@ from frappe.utils import comma_and, get_link_to_form, getdate - class ProgramEnrollment(Document): def validate(self): self.validate_duplication() diff --git a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py index 973174d7f304..55734cbc94bf 100644 --- a/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py +++ b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py @@ -6,6 +6,5 @@ import unittest - class TestProgramEnrollmentTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/question/test_question.py b/erpnext/education/doctype/question/test_question.py index 7d04f23223c0..1ce10c0cb835 100644 --- a/erpnext/education/doctype/question/test_question.py +++ b/erpnext/education/doctype/question/test_question.py @@ -6,6 +6,5 @@ import unittest - class TestQuestion(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz/quiz.py b/erpnext/education/doctype/quiz/quiz.py index a982cbe1d323..474bea111b97 100644 --- a/erpnext/education/doctype/quiz/quiz.py +++ b/erpnext/education/doctype/quiz/quiz.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.model.document import Document diff --git a/erpnext/education/doctype/quiz/test_quiz.py b/erpnext/education/doctype/quiz/test_quiz.py index 4a7307199a83..22eb23d4fdad 100644 --- a/erpnext/education/doctype/quiz/test_quiz.py +++ b/erpnext/education/doctype/quiz/test_quiz.py @@ -6,6 +6,5 @@ import unittest - class TestQuiz(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py index 8b609e910a0e..44e3a3f92baf 100644 --- a/erpnext/education/doctype/quiz_activity/test_quiz_activity.py +++ b/erpnext/education/doctype/quiz_activity/test_quiz_activity.py @@ -6,6 +6,5 @@ import unittest - class TestQuizActivity(unittest.TestCase): pass diff --git a/erpnext/education/doctype/quiz_result/test_quiz_result.py b/erpnext/education/doctype/quiz_result/test_quiz_result.py index 38b23698c652..08ac4811bca0 100644 --- a/erpnext/education/doctype/quiz_result/test_quiz_result.py +++ b/erpnext/education/doctype/quiz_result/test_quiz_result.py @@ -6,6 +6,5 @@ import unittest - class TestQuizResult(unittest.TestCase): pass diff --git a/erpnext/education/doctype/room/test_room.py b/erpnext/education/doctype/room/test_room.py index b11f9999ef1c..5718d51d6589 100644 --- a/erpnext/education/doctype/room/test_room.py +++ b/erpnext/education/doctype/room/test_room.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Room') class TestRoom(unittest.TestCase): diff --git a/erpnext/education/doctype/school_house/test_school_house.py b/erpnext/education/doctype/school_house/test_school_house.py index 4b4f8378ee5b..b58b7d49ce17 100644 --- a/erpnext/education/doctype/school_house/test_school_house.py +++ b/erpnext/education/doctype/school_house/test_school_house.py @@ -6,6 +6,5 @@ import unittest - class TestSchoolHouse(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_admission/test_student_admission.py b/erpnext/education/doctype/student_admission/test_student_admission.py index ed91fcf3d6a5..c9cfbca14a7a 100644 --- a/erpnext/education/doctype/student_admission/test_student_admission.py +++ b/erpnext/education/doctype/student_admission/test_student_admission.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Admission') class TestStudentAdmission(unittest.TestCase): diff --git a/erpnext/education/doctype/student_applicant/test_student_applicant.py b/erpnext/education/doctype/student_applicant/test_student_applicant.py index 9402b7267879..b7258a4ae1d2 100644 --- a/erpnext/education/doctype/student_applicant/test_student_applicant.py +++ b/erpnext/education/doctype/student_applicant/test_student_applicant.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Applicant') class TestStudentApplicant(unittest.TestCase): diff --git a/erpnext/education/doctype/student_attendance/test_student_attendance.py b/erpnext/education/doctype/student_attendance/test_student_attendance.py index 6cf74e6231c3..d453aeda1c6a 100644 --- a/erpnext/education/doctype/student_attendance/test_student_attendance.py +++ b/erpnext/education/doctype/student_attendance/test_student_attendance.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Attendance') class TestStudentAttendance(unittest.TestCase): diff --git a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py index 5052503ab3b3..a94a3f235df6 100644 --- a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py +++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py @@ -6,6 +6,5 @@ import unittest - class TestStudentAttendanceTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py index 3312027b1931..75ebeb29b80f 100644 --- a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py +++ b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Batch Name') class TestStudentBatchName(unittest.TestCase): diff --git a/erpnext/education/doctype/student_category/test_student_category.py b/erpnext/education/doctype/student_category/test_student_category.py index a683d4915688..0893769045eb 100644 --- a/erpnext/education/doctype/student_category/test_student_category.py +++ b/erpnext/education/doctype/student_category/test_student_category.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Category') class TestStudentCategory(unittest.TestCase): diff --git a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py index d77bc2fc98b7..432da0901346 100644 --- a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py +++ b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py @@ -6,6 +6,5 @@ import unittest - class TestStudentGroupCreationTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/student_language/test_student_language.py b/erpnext/education/doctype/student_language/test_student_language.py index add64cb47892..1d7c003ae5e2 100644 --- a/erpnext/education/doctype/student_language/test_student_language.py +++ b/erpnext/education/doctype/student_language/test_student_language.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Language') class TestStudentLanguage(unittest.TestCase): diff --git a/erpnext/education/doctype/student_log/test_student_log.py b/erpnext/education/doctype/student_log/test_student_log.py index 882a2ed53fce..533191f3b478 100644 --- a/erpnext/education/doctype/student_log/test_student_log.py +++ b/erpnext/education/doctype/student_log/test_student_log.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Student Log') class TestStudentLog(unittest.TestCase): diff --git a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py index 4226effca4c2..f6227136d9d1 100644 --- a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py +++ b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py @@ -6,6 +6,5 @@ import unittest - class TestStudentReportGenerationTool(unittest.TestCase): pass diff --git a/erpnext/education/doctype/topic_content/test_topic_content.py b/erpnext/education/doctype/topic_content/test_topic_content.py index 9c58dea65fa7..6fdcbdae7176 100644 --- a/erpnext/education/doctype/topic_content/test_topic_content.py +++ b/erpnext/education/doctype/topic_content/test_topic_content.py @@ -6,6 +6,5 @@ import unittest - class TestTopicContent(unittest.TestCase): pass diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py index 2e4543043b43..f6d9c5a012e1 100644 --- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py +++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.utils import add_days, cstr, date_diff, get_first_day, get_last_day, getdate diff --git a/erpnext/education/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/education/web_form/student_applicant/student_applicant.py +++ b/erpnext/education/web_form/student_applicant/student_applicant.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py index a440f672b382..652fa9200d9c 100755 --- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py +++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py @@ -12,7 +12,6 @@ import re from urllib.parse import quote - from erpnext.erpnext_integrations.doctype.amazon_mws_settings import xml_utils try: diff --git a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py index 4cf66ef2dac3..5604b40d1405 100644 --- a/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py +++ b/erpnext/erpnext_integrations/doctype/quickbooks_migrator/test_quickbooks_migrator.py @@ -6,6 +6,5 @@ import unittest - class TestQuickBooksMigrator(unittest.TestCase): pass diff --git a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py index 2bef90ef6929..53d37224452c 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py +++ b/erpnext/erpnext_integrations/doctype/shopify_log/test_shopify_log.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Shopify Log') class TestShopifyLog(unittest.TestCase): diff --git a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py index 47cc1d5a0e9d..aae8f6d4db03 100644 --- a/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py +++ b/erpnext/erpnext_integrations/doctype/tally_migration/test_tally_migration.py @@ -6,6 +6,5 @@ import unittest - class TestTallyMigration(unittest.TestCase): pass diff --git a/erpnext/healthcare/page/patient_history/patient_history.py b/erpnext/healthcare/page/patient_history/patient_history.py index 96e6fc5fb3b6..77d8846f373a 100644 --- a/erpnext/healthcare/page/patient_history/patient_history.py +++ b/erpnext/healthcare/page/patient_history/patient_history.py @@ -10,7 +10,6 @@ from frappe.utils import cint - @frappe.whitelist() def get_feed(name, document_types=None, date_range=None, start=0, page_length=20): """get feed""" diff --git a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py index 634a5c5a511d..4fedbd42a92f 100644 --- a/erpnext/hotels/doctype/hotel_room/test_hotel_room.py +++ b/erpnext/hotels/doctype/hotel_room/test_hotel_room.py @@ -5,7 +5,6 @@ import unittest - test_dependencies = ["Hotel Room Package"] test_records = [ dict(doctype="Hotel Room", name="1001", diff --git a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py index 0c8593eef020..fe5d79dcc324 100644 --- a/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py +++ b/erpnext/hotels/doctype/hotel_room_package/test_hotel_room_package.py @@ -5,7 +5,6 @@ import unittest - test_records = [ dict(doctype='Item', item_code='Breakfast', item_group='Products', is_stock_item=0), diff --git a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py index 5d2dc18a132b..72030c69397e 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py +++ b/erpnext/hotels/doctype/hotel_room_pricing/test_hotel_room_pricing.py @@ -5,7 +5,6 @@ import unittest - test_dependencies = ["Hotel Room Package"] test_records = [ dict(doctype="Hotel Room Pricing", enabled=1, diff --git a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py index e82c7afa0484..ea258ccb75d8 100644 --- a/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py +++ b/erpnext/hotels/doctype/hotel_room_pricing_package/test_hotel_room_pricing_package.py @@ -6,6 +6,5 @@ import unittest - class TestHotelRoomPricingPackage(unittest.TestCase): pass diff --git a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py index 4d0b7135180b..6dba7b7407b0 100644 --- a/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py +++ b/erpnext/hotels/doctype/hotel_room_type/test_hotel_room_type.py @@ -6,6 +6,5 @@ import unittest - class TestHotelRoomType(unittest.TestCase): pass diff --git a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py index fa782f277755..5cf58b994e1f 100644 --- a/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py +++ b/erpnext/hotels/doctype/hotel_settings/test_hotel_settings.py @@ -6,6 +6,5 @@ import unittest - class TestHotelSettings(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/appraisal/test_appraisal.py b/erpnext/hr/doctype/appraisal/test_appraisal.py index 3c223d22d634..cf2bd7c24272 100644 --- a/erpnext/hr/doctype/appraisal/test_appraisal.py +++ b/erpnext/hr/doctype/appraisal/test_appraisal.py @@ -4,7 +4,6 @@ import unittest - # test_records = frappe.get_test_records('Appraisal') class TestAppraisal(unittest.TestCase): diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py index d55233436fdf..b8d04944edb5 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'kra_template', diff --git a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py index e543a9f6c850..a814ec8d5b2d 100644 --- a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py @@ -4,7 +4,6 @@ import unittest - # test_records = frappe.get_test_records('Appraisal Template') class TestAppraisalTemplate(unittest.TestCase): diff --git a/erpnext/hr/doctype/attendance/attendance_dashboard.py b/erpnext/hr/doctype/attendance/attendance_dashboard.py index e1d793a44a4f..bbe67dfcc8f8 100644 --- a/erpnext/hr/doctype/attendance/attendance_dashboard.py +++ b/erpnext/hr/doctype/attendance/attendance_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'attendance', diff --git a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py index 94a4c0e4d57a..92cf6aac8516 100644 --- a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +++ b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py @@ -12,7 +12,6 @@ from six import string_types - class DailyWorkSummary(Document): def send_mails(self, dws_group, emails): '''Send emails to get daily work summary to all users \ diff --git a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py index 523646671083..17d5bd27a6ef 100644 --- a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py +++ b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'employee_advance', diff --git a/erpnext/hr/doctype/employee_grade/test_employee_grade.py b/erpnext/hr/doctype/employee_grade/test_employee_grade.py index 42536f6e00cc..cd4fcb5aeb43 100644 --- a/erpnext/hr/doctype/employee_grade/test_employee_grade.py +++ b/erpnext/hr/doctype/employee_grade/test_employee_grade.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeGrade(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py index f24d6c34b74d..38e3ee316bb5 100644 --- a/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py +++ b/erpnext/hr/doctype/employee_health_insurance/test_employee_health_insurance.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeHealthInsurance(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py index 621a0499931d..1d2e8ae18db5 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'employee_onboarding_template', diff --git a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py index e9ef548bb1b3..92a328b71ef6 100644 --- a/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py +++ b/erpnext/hr/doctype/employee_onboarding_template/test_employee_onboarding_template.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeOnboardingTemplate(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py index f7ccb9a522c5..970ba26d794a 100644 --- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'employee_separation_template', diff --git a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py index 48496373d1b5..4c91a791038c 100644 --- a/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py +++ b/erpnext/hr/doctype/employee_separation_template/test_employee_separation_template.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeSeparationTemplate(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py index 247db3c91893..287dac66f10c 100644 --- a/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py +++ b/erpnext/hr/doctype/employee_transfer_property/test_employee_transfer_property.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeTransferProperty(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py index 8cf0a3f6ac4e..f0c900e6ef0e 100644 --- a/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py +++ b/erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Expense Claim Type') class TestExpenseClaimType(unittest.TestCase): diff --git a/erpnext/hr/doctype/hr_settings/test_hr_settings.py b/erpnext/hr/doctype/hr_settings/test_hr_settings.py index 5b05e84a5214..69a060a90f9b 100644 --- a/erpnext/hr/doctype/hr_settings/test_hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/test_hr_settings.py @@ -6,7 +6,5 @@ import unittest - - class TestHRSettings(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py index 3fc4bc58186e..87f302450db2 100644 --- a/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py +++ b/erpnext/hr/doctype/identification_document_type/test_identification_document_type.py @@ -6,6 +6,5 @@ import unittest - class TestIdentificationDocumentType(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/interest/test_interest.py b/erpnext/hr/doctype/interest/test_interest.py index 473cc1625d1c..f3727bee0b09 100644 --- a/erpnext/hr/doctype/interest/test_interest.py +++ b/erpnext/hr/doctype/interest/test_interest.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Interest') class TestInterest(unittest.TestCase): diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index b6df665cefc7..c0059431cfc7 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'job_applicant', diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py index f6213405d4be..a13e2a7c23a4 100644 --- a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'job_title', diff --git a/erpnext/hr/doctype/job_opening/test_job_opening.py b/erpnext/hr/doctype/job_opening/test_job_opening.py index fade505aae67..a66975c91ed4 100644 --- a/erpnext/hr/doctype/job_opening/test_job_opening.py +++ b/erpnext/hr/doctype/job_opening/test_job_opening.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Job Opening') class TestJobOpening(unittest.TestCase): diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py index 28d8062db850..84423bd2b451 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'leave_allocation', diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py index a258581e718d..b1850562e3a9 100644 --- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py @@ -6,9 +6,7 @@ from frappe.utils import add_days, add_months, getdate, nowdate import erpnext -from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import ( - process_expired_allocation -) +from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import process_expired_allocation from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type diff --git a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py index baa213ff165f..f64b2334e869 100644 --- a/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.py @@ -6,6 +6,5 @@ import unittest - class TestLeaveControlPanel(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py index 0da34052dfa4..4cf9db26a2d9 100644 --- a/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py +++ b/erpnext/hr/doctype/leave_policy_detail/test_leave_policy_detail.py @@ -6,6 +6,5 @@ import unittest - class TestLeavePolicyDetail(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py index 1c0e41b8675d..195c8587b975 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.py +++ b/erpnext/hr/doctype/leave_type/leave_type.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.model.document import Document diff --git a/erpnext/hr/doctype/offer_term/test_offer_term.py b/erpnext/hr/doctype/offer_term/test_offer_term.py index 9a0ef8f4c237..ec7edd44c6f1 100644 --- a/erpnext/hr/doctype/offer_term/test_offer_term.py +++ b/erpnext/hr/doctype/offer_term/test_offer_term.py @@ -4,7 +4,6 @@ import unittest - # test_records = frappe.get_test_records('Offer Term') class TestOfferTerm(unittest.TestCase): diff --git a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py index 98f38422b285..b33f389a48ba 100644 --- a/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py +++ b/erpnext/hr/doctype/purpose_of_travel/test_purpose_of_travel.py @@ -6,6 +6,5 @@ import unittest - class TestPurposeofTravel(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py index 5decf3991716..3ceafc0cefea 100644 --- a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'shift_request', diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py index 4bf2948e4c99..b78c69a2a1ea 100644 --- a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'shift', diff --git a/erpnext/hr/doctype/shift_type/test_shift_type.py b/erpnext/hr/doctype/shift_type/test_shift_type.py index 55eac7dbd915..699030f21963 100644 --- a/erpnext/hr/doctype/shift_type/test_shift_type.py +++ b/erpnext/hr/doctype/shift_type/test_shift_type.py @@ -6,6 +6,5 @@ import unittest - class TestShiftType(unittest.TestCase): pass diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py index a04e7c83ab7c..24ae1223440e 100644 --- a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'staffing_plan', diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index e0caa14a402c..a917c8744f7d 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'training_event', diff --git a/erpnext/hr/doctype/training_result/test_training_result.py b/erpnext/hr/doctype/training_result/test_training_result.py index f39fefbca675..17ccc4b4eefa 100644 --- a/erpnext/hr/doctype/training_result/test_training_result.py +++ b/erpnext/hr/doctype/training_result/test_training_result.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Training Result') class TestTrainingResult(unittest.TestCase): diff --git a/erpnext/hr/doctype/travel_request/test_travel_request.py b/erpnext/hr/doctype/travel_request/test_travel_request.py index 16bec98bd832..95bf8b9c8bc2 100644 --- a/erpnext/hr/doctype/travel_request/test_travel_request.py +++ b/erpnext/hr/doctype/travel_request/test_travel_request.py @@ -6,6 +6,5 @@ import unittest - class TestTravelRequest(unittest.TestCase): pass diff --git a/erpnext/hr/notification/training_feedback/training_feedback.py b/erpnext/hr/notification/training_feedback/training_feedback.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/hr/notification/training_feedback/training_feedback.py +++ b/erpnext/hr/notification/training_feedback/training_feedback.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/hr/notification/training_scheduled/training_scheduled.py b/erpnext/hr/notification/training_scheduled/training_scheduled.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/hr/notification/training_scheduled/training_scheduled.py +++ b/erpnext/hr/notification/training_scheduled/training_scheduled.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/hr/web_form/job_application/job_application.py b/erpnext/hr/web_form/job_application/job_application.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/hr/web_form/job_application/job_application.py +++ b/erpnext/hr/web_form/job_application/job_application.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py index 1be78390ec5a..c403f902a2c6 100644 --- a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py +++ b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py @@ -6,6 +6,5 @@ import unittest - class TestHubTrackedItem(unittest.TestCase): pass diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index 54f0b60574d3..33d23f6eae49 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -11,7 +11,6 @@ from frappe.utils import cint - class MarketplaceSettings(Document): def register_seller(self, company, company_description): diff --git a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py index 0a18efae7765..7922f45ab59d 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py @@ -6,6 +6,5 @@ import unittest - class TestMarketplaceSettings(unittest.TestCase): pass diff --git a/erpnext/loan_management/doctype/loan/loan_dashboard.py b/erpnext/loan_management/doctype/loan/loan_dashboard.py index 3da999eeea98..28ccc03b684e 100644 --- a/erpnext/loan_management/doctype/loan/loan_dashboard.py +++ b/erpnext/loan_management/doctype/loan/loan_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loan', diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py index d26315930a99..ec0aebbb8a45 100644 --- a/erpnext/loan_management/doctype/loan/test_loan.py +++ b/erpnext/loan_management/doctype/loan/test_loan.py @@ -6,15 +6,7 @@ import unittest import frappe -from frappe.utils import ( - add_days, - add_months, - add_to_date, - date_diff, - flt, - get_datetime, - nowdate -) +from frappe.utils import add_days, add_months, add_to_date, date_diff, flt, get_datetime, nowdate from erpnext.loan_management.doctype.loan.loan import ( make_loan_write_off, diff --git a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py index 08338641db13..992d6699747a 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loan_application', diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index 327a0a309cfb..93513a83e7e3 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -6,15 +6,7 @@ import frappe from frappe import _ -from frappe.utils import ( - add_days, - cint, - date_diff, - flt, - get_datetime, - getdate, - nowdate -) +from frappe.utils import add_days, cint, date_diff, flt, get_datetime, getdate, nowdate import erpnext from erpnext.accounts.general_ledger import make_gl_entries diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index d9fd902d5511..06b801e47c5c 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -6,14 +6,7 @@ import unittest import frappe -from frappe.utils import ( - add_to_date, - date_diff, - flt, - get_datetime, - get_first_day, - nowdate -) +from frappe.utils import add_to_date, date_diff, flt, get_datetime, get_first_day, nowdate from erpnext.loan_management.doctype.loan.test_loan import ( create_demand_loan, diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index be57c539d1c8..13b73573274b 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -4,17 +4,9 @@ from __future__ import unicode_literals - import frappe from frappe import _ -from frappe.utils import ( - add_days, - cint, - date_diff, - flt, - get_datetime, - getdate -) +from frappe.utils import add_days, cint, date_diff, flt, get_datetime, getdate from six import iteritems import erpnext diff --git a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py index 4cf69ca7a188..35f3ba6830fb 100644 --- a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loan_security', diff --git a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py index ad918a763b29..6ede6a2739f7 100644 --- a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py +++ b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.py @@ -7,9 +7,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import ( - get_datetime -) +from frappe.utils import get_datetime class LoanSecurityPrice(Document): diff --git a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py index 9f44eefa61a9..7a2732e31903 100644 --- a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loan_security_type', diff --git a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py index 584d9a29913a..0af0de1a53ae 100644 --- a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py +++ b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.model.document import Document @@ -12,7 +11,6 @@ from six import iteritems - class LoanSecurityUnpledge(Document): def validate(self): self.validate_duplicate_securities() diff --git a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py index 368b0553976c..96b2c4aedcfe 100644 --- a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py +++ b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'loan_type', diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py index 8c7783742fdb..fcd0399c6e91 100644 --- a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'process_loan_interest_accrual', diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py index c4ab9863e3b1..ced3bd7e4fbf 100644 --- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py +++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'process_loan_security_shortfall', diff --git a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py index 8e8db838e0e9..57e728d1b132 100644 --- a/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py +++ b/erpnext/maintenance/doctype/maintenance_visit/test_maintenance_visit.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Maintenance Visit') class TestMaintenanceVisit(unittest.TestCase): diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py index 23d927f6332d..83260ec1b9f2 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'blanket_order', diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 605027096e7a..3bf9de2708c5 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -12,7 +12,7 @@ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import ( - add_days, + add_days, add_to_date, cint, flt, @@ -22,7 +22,7 @@ getdate, time_diff, time_diff_in_hours, - time_diff_in_seconds + time_diff_in_seconds, ) from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import ( diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py index 2d7c0bff9c4f..9ef6ee57523c 100644 --- a/erpnext/manufacturing/doctype/routing/routing_dashboard.py +++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'routing', diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py index d3004efc4409..c122fa9b614c 100644 --- a/erpnext/manufacturing/report/bom_explorer/bom_explorer.py +++ b/erpnext/manufacturing/report/bom_explorer/bom_explorer.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe diff --git a/erpnext/non_profit/doctype/certification_application/test_certification_application.py b/erpnext/non_profit/doctype/certification_application/test_certification_application.py index ec3ab733f5c5..5e1cbf859614 100644 --- a/erpnext/non_profit/doctype/certification_application/test_certification_application.py +++ b/erpnext/non_profit/doctype/certification_application/test_certification_application.py @@ -6,6 +6,5 @@ import unittest - class TestCertificationApplication(unittest.TestCase): pass diff --git a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py index c87611e0de6a..29a73881a58d 100644 --- a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py +++ b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py @@ -6,6 +6,5 @@ import unittest - class TestCertifiedConsultant(unittest.TestCase): pass diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.py b/erpnext/non_profit/web_form/certification_application/certification_application.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/non_profit/web_form/certification_application/certification_application.py +++ b/erpnext/non_profit/web_form/certification_application/certification_application.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py index 8d6632ec6082..a408d86b9a7a 100644 --- a/erpnext/patches/v11_0/uom_conversion_data.py +++ b/erpnext/patches/v11_0/uom_conversion_data.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals - import frappe diff --git a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py index fa5e5799e865..fba411841593 100644 --- a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py +++ b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py @@ -3,7 +3,6 @@ import frappe - def execute(): frappe.reload_doc("accounts", "doctype", "tax_category") frappe.reload_doc("stock", "doctype", "item_manufacturer") diff --git a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py index 6e60228104c3..fada5f08fb09 100644 --- a/erpnext/patches/v12_0/set_multi_uom_in_rfq.py +++ b/erpnext/patches/v12_0/set_multi_uom_in_rfq.py @@ -6,7 +6,6 @@ import frappe - def execute(): frappe.reload_doc('buying', 'doctype', 'request_for_quotation_item') diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py index 59295adc1a0b..520b5d04b4b3 100644 --- a/erpnext/patches/v12_0/update_ewaybill_field_position.py +++ b/erpnext/patches/v12_0/update_ewaybill_field_position.py @@ -3,7 +3,6 @@ import frappe - def execute(): company = frappe.get_all('Company', filters = {'country': 'India'}) diff --git a/erpnext/patches/v12_0/update_uom_conversion_factor.py b/erpnext/patches/v12_0/update_uom_conversion_factor.py index ffeaf6538121..7c7477a67393 100644 --- a/erpnext/patches/v12_0/update_uom_conversion_factor.py +++ b/erpnext/patches/v12_0/update_uom_conversion_factor.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals - import frappe diff --git a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py index b24b34434886..f2022b28b8b4 100644 --- a/erpnext/patches/v13_0/print_uom_after_quantity_patch.py +++ b/erpnext/patches/v13_0/print_uom_after_quantity_patch.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.setup.install import create_print_uom_after_qty_custom_field diff --git a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py index 3dca8d52ec51..3c95fa80ec0e 100644 --- a/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py +++ b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeIncentive(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py index 3abe4a9aebc6..e6bc3abf1277 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeTaxExemptionCategory(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py index e41c652d8bd2..0086086bde60 100644 --- a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py +++ b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py @@ -6,6 +6,5 @@ import unittest - class TestEmployeeTaxExemptionSubCategory(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py index 42101518a3ca..16e44d086846 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'payroll_entry', diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py index d6c3684cc243..4105d8ee928e 100644 --- a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'payroll_period', diff --git a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py index 914cd3092f53..e93c0e524de7 100644 --- a/erpnext/payroll/doctype/payroll_period/test_payroll_period.py +++ b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py @@ -6,6 +6,5 @@ import unittest - class TestPayrollPeriod(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py index 67b5769bb2de..a380d9fb44a6 100644 --- a/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py +++ b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py @@ -6,6 +6,5 @@ import unittest - class TestRetentionBonus(unittest.TestCase): pass diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py index dabf2d8474c5..11d9a9440966 100644 --- a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'salary_structure', diff --git a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py index 64087f4ee4dd..fbb894c43ed3 100644 --- a/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py +++ b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py @@ -6,6 +6,5 @@ import unittest - class TestSalaryStructureAssignment(unittest.TestCase): pass diff --git a/erpnext/payroll/notification/retention_bonus/retention_bonus.py b/erpnext/payroll/notification/retention_bonus/retention_bonus.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/payroll/notification/retention_bonus/retention_bonus.py +++ b/erpnext/payroll/notification/retention_bonus/retention_bonus.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/payroll/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py index dacd2c0f98c3..d55317e71e44 100644 --- a/erpnext/payroll/report/bank_remittance/bank_remittance.py +++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe import _, get_all diff --git a/erpnext/portal/doctype/products_settings/test_products_settings.py b/erpnext/portal/doctype/products_settings/test_products_settings.py index 2b211799858a..5495cc9d9618 100644 --- a/erpnext/portal/doctype/products_settings/test_products_settings.py +++ b/erpnext/portal/doctype/products_settings/test_products_settings.py @@ -6,6 +6,5 @@ import unittest - class TestProductsSettings(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index da1ba055d0d1..59488e601237 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -8,15 +8,7 @@ from frappe import _ from frappe.desk.reportview import get_match_cond from frappe.model.document import Document -from frappe.utils import ( - add_days, - flt, - get_datetime, - get_time, - get_url, - nowtime, - today -) +from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today from erpnext.controllers.queries import get_filters_cond from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list diff --git a/erpnext/projects/doctype/projects_settings/test_projects_settings.py b/erpnext/projects/doctype/projects_settings/test_projects_settings.py index f86c1fb4143a..326624686da2 100644 --- a/erpnext/projects/doctype/projects_settings/test_projects_settings.py +++ b/erpnext/projects/doctype/projects_settings/test_projects_settings.py @@ -6,6 +6,5 @@ import unittest - class TestProjectsSettings(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/task_type/test_task_type.py b/erpnext/projects/doctype/task_type/test_task_type.py index 39188d15acee..7690c3775afc 100644 --- a/erpnext/projects/doctype/task_type/test_task_type.py +++ b/erpnext/projects/doctype/task_type/test_task_type.py @@ -6,6 +6,5 @@ import unittest - class TestTaskType(unittest.TestCase): pass diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index d72a82ac878a..9155f45184fa 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -9,11 +9,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import ( - flt, - getdate, - time_diff_in_hours -) +from frappe.utils import flt, getdate, time_diff_in_hours from erpnext.controllers.queries import get_match_cond from erpnext.hr.utils import validate_active_employee diff --git a/erpnext/quality_management/doctype/quality_action/test_quality_action.py b/erpnext/quality_management/doctype/quality_action/test_quality_action.py index 8ea59e37dd02..33229d4b451c 100644 --- a/erpnext/quality_management/doctype/quality_action/test_quality_action.py +++ b/erpnext/quality_management/doctype/quality_action/test_quality_action.py @@ -6,7 +6,6 @@ import unittest - class TestQualityAction(unittest.TestCase): # quality action has no code pass diff --git a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py index ca2510865dd3..1de58aae3edb 100644 --- a/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py +++ b/erpnext/quality_management/doctype/quality_feedback_template/test_quality_feedback_template.py @@ -6,6 +6,5 @@ import unittest - class TestQualityFeedbackTemplate(unittest.TestCase): pass diff --git a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py index 083397aa8939..84240d227ea7 100644 --- a/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py +++ b/erpnext/quality_management/doctype/quality_goal/test_quality_goal.py @@ -8,7 +8,6 @@ import frappe - class TestQualityGoal(unittest.TestCase): def test_quality_goal(self): # no code, just a basic sanity check diff --git a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py index 353ea58d140f..e57256d28965 100644 --- a/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py +++ b/erpnext/quality_management/doctype/quality_meeting/test_quality_meeting.py @@ -6,7 +6,6 @@ import unittest - class TestQualityMeeting(unittest.TestCase): # nothing to test pass diff --git a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py index f59d95e535f4..1a90e6d711cb 100644 --- a/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py +++ b/erpnext/regional/doctype/gst_hsn_code/test_gst_hsn_code.py @@ -6,6 +6,5 @@ import unittest - class TestGSTHSNCode(unittest.TestCase): pass diff --git a/erpnext/regional/doctype/gst_settings/test_gst_settings.py b/erpnext/regional/doctype/gst_settings/test_gst_settings.py index 3cad9ac02478..836d3a88c339 100644 --- a/erpnext/regional/doctype/gst_settings/test_gst_settings.py +++ b/erpnext/regional/doctype/gst_settings/test_gst_settings.py @@ -6,6 +6,5 @@ import unittest - class TestGSTSettings(unittest.TestCase): pass diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py index d113e4824114..63c5a1f583b6 100644 --- a/erpnext/regional/france/utils.py +++ b/erpnext/regional/france/utils.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals - # don't remove this function it is used in tests def test_method(): '''test function''' diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index c34fc0d4911c..1ced9ea1d8c1 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -6,14 +6,7 @@ import frappe from frappe import _ from frappe.model.utils import get_fetch_values -from frappe.utils import ( - cint, - cstr, - date_diff, - flt, - getdate, - nowdate -) +from frappe.utils import cint, cstr, date_diff, flt, getdate, nowdate from six import string_types from erpnext.controllers.accounts_controller import get_taxes_and_charges diff --git a/erpnext/regional/report/datev/test_datev.py b/erpnext/regional/report/datev/test_datev.py index a8d23eb1ad5b..b53889366f1e 100644 --- a/erpnext/regional/report/datev/test_datev.py +++ b/erpnext/regional/report/datev/test_datev.py @@ -16,11 +16,11 @@ ) from erpnext.regional.germany.utils.datev.datev_csv import get_datev_csv, get_header from erpnext.regional.report.datev.datev import ( - download_datev_csv, + download_datev_csv, get_account_names, get_customers, get_suppliers, - get_transactions + get_transactions, ) diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py index a5971edb3e07..68da887bb721 100644 --- a/erpnext/regional/united_arab_emirates/setup.py +++ b/erpnext/regional/united_arab_emirates/setup.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.permissions import add_permission, update_permission_property diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.py b/erpnext/restaurant/doctype/restaurant/test_restaurant.py index b08cd7b92023..574cd1f9e4a9 100644 --- a/erpnext/restaurant/doctype/restaurant/test_restaurant.py +++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.py @@ -5,7 +5,6 @@ import unittest - test_records = [ dict(doctype='Restaurant', name='Test Restaurant 1', company='_Test Company 1', invoice_series_prefix='Test-Rest-1-Inv-', default_customer='_Test Customer 1'), diff --git a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py index 0cce1a7d4637..885da724aa02 100644 --- a/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py +++ b/erpnext/restaurant/doctype/restaurant_reservation/test_restaurant_reservation.py @@ -6,6 +6,5 @@ import unittest - class TestRestaurantReservation(unittest.TestCase): pass diff --git a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py index ca75a27aefb2..44059aee6075 100644 --- a/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py +++ b/erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.py @@ -5,7 +5,6 @@ import unittest - test_records = [ dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1), dict(restaurant='Test Restaurant 1', no_of_seats=5, minimum_seating=1), diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 062132e290a0..d614963e9f54 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -19,10 +19,7 @@ from frappe.utils import cint, cstr, flt, get_formatted_email, today from frappe.utils.user import get_users_with_role -from erpnext.accounts.party import ( - get_dashboard_info, - validate_party_accounts -) +from erpnext.accounts.party import get_dashboard_info, validate_party_accounts from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/selling/doctype/installation_note/test_installation_note.py b/erpnext/selling/doctype/installation_note/test_installation_note.py index c9fd40dc8929..abfda9cd6b89 100644 --- a/erpnext/selling/doctype/installation_note/test_installation_note.py +++ b/erpnext/selling/doctype/installation_note/test_installation_note.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Installation Note') class TestInstallationNote(unittest.TestCase): diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py index ff3d805edbac..de21c4ad02d8 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, ) diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py index f21c683348a4..83a1c2ce75cd 100644 --- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, ) diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py index 05ae3c1106b6..b340124a0406 100644 --- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py +++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.item_group_wise_sales_target_variance import ( get_data_column, ) diff --git a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py index 2e7400889e6e..8a0f66490784 100644 --- a/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/test_authorization_rule.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Authorization Rule') class TestAuthorizationRule(unittest.TestCase): diff --git a/erpnext/setup/doctype/email_digest/test_email_digest.py b/erpnext/setup/doctype/email_digest/test_email_digest.py index 0e3fd33046c3..b3d0ce325b81 100644 --- a/erpnext/setup/doctype/email_digest/test_email_digest.py +++ b/erpnext/setup/doctype/email_digest/test_email_digest.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Email Digest') class TestEmailDigest(unittest.TestCase): diff --git a/erpnext/setup/doctype/global_defaults/test_global_defaults.py b/erpnext/setup/doctype/global_defaults/test_global_defaults.py index 446f53af9d2a..70a7c08c111d 100644 --- a/erpnext/setup/doctype/global_defaults/test_global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/test_global_defaults.py @@ -6,6 +6,5 @@ import unittest - class TestGlobalDefaults(unittest.TestCase): pass diff --git a/erpnext/setup/doctype/party_type/test_party_type.py b/erpnext/setup/doctype/party_type/test_party_type.py index 675ad3c3cfa4..e5f2908eb46b 100644 --- a/erpnext/setup/doctype/party_type/test_party_type.py +++ b/erpnext/setup/doctype/party_type/test_party_type.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Party Type') class TestPartyType(unittest.TestCase): diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py index da7bacff65e9..9f743e724f31 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -7,7 +7,6 @@ from frappe import _ from frappe.utils import cstr, getdate - from .default_website import website_maker diff --git a/erpnext/setup/setup_wizard/utils.py b/erpnext/setup/setup_wizard/utils.py index 7a973430c6ed..30b88aecbcd9 100644 --- a/erpnext/setup/setup_wizard/utils.py +++ b/erpnext/setup/setup_wizard/utils.py @@ -6,7 +6,6 @@ from frappe.desk.page.setup_wizard.setup_wizard import setup_complete - def complete(): with open(os.path.join(os.path.dirname(__file__), 'data', 'test_mfg.json'), 'r') as f: diff --git a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py index 871af140b8fc..1753002a8195 100644 --- a/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py +++ b/erpnext/stock/dashboard_chart_source/warehouse_wise_stock_value/warehouse_wise_stock_value.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from frappe import _ from frappe.utils.dashboard import cache_source diff --git a/erpnext/stock/doctype/bin/test_bin.py b/erpnext/stock/doctype/bin/test_bin.py index a8a757805fb6..f0dbe8c0dd89 100644 --- a/erpnext/stock/doctype/bin/test_bin.py +++ b/erpnext/stock/doctype/bin/test_bin.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Bin') class TestBin(unittest.TestCase): diff --git a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py index 040fe1785e91..7c9807c762b4 100644 --- a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py @@ -6,6 +6,5 @@ import unittest - class TestCustomsTariffNumber(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py index a3b553b66794..25c9da16aa84 100644 --- a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py @@ -6,6 +6,5 @@ import unittest - class TestDeliverySettings(unittest.TestCase): pass diff --git a/erpnext/stock/doctype/manufacturer/manufacturer.py b/erpnext/stock/doctype/manufacturer/manufacturer.py index 63f9d6e40636..314a28080452 100644 --- a/erpnext/stock/doctype/manufacturer/manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/manufacturer.py @@ -4,9 +4,7 @@ from __future__ import unicode_literals -from frappe.contacts.address_and_contact import ( - load_address_and_contact -) +from frappe.contacts.address_and_contact import load_address_and_contact from frappe.model.document import Document diff --git a/erpnext/stock/doctype/manufacturer/test_manufacturer.py b/erpnext/stock/doctype/manufacturer/test_manufacturer.py index 023c71d0dd68..c0c61b00d0b8 100644 --- a/erpnext/stock/doctype/manufacturer/test_manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/test_manufacturer.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Manufacturer') class TestManufacturer(unittest.TestCase): diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index ce685e89aacf..9eb472162669 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -6,7 +6,6 @@ from __future__ import unicode_literals - import frappe from frappe import _, msgprint from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/stock/doctype/packing_slip/test_packing_slip.py b/erpnext/stock/doctype/packing_slip/test_packing_slip.py index 153d7953e179..193adfcf1cbb 100644 --- a/erpnext/stock/doctype/packing_slip/test_packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/test_packing_slip.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('Packing Slip') class TestPackingSlip(unittest.TestCase): diff --git a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py index 6bd53d38d769..50a767bafa7d 100644 --- a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py +++ b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_data(): return { 'fieldname': 'pick_list', diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index e056d8df8547..46619eb1f356 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -17,9 +17,7 @@ set_item_variant_settings, ) from erpnext.stock.doctype.serial_no.serial_no import * # noqa -from erpnext.stock.doctype.stock_entry.stock_entry import ( - move_sample_to_retention_warehouse -) +from erpnext.stock.doctype.stock_entry.stock_entry import move_sample_to_retention_warehouse from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import StockFreezeError from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import ( diff --git a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py index 6058d1a0dc08..7eea8f5c35c8 100644 --- a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py +++ b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py @@ -6,6 +6,5 @@ import unittest - class TestStockEntryType(unittest.TestCase): pass diff --git a/erpnext/stock/report/bom_search/bom_search.py b/erpnext/stock/report/bom_search/bom_search.py index 68071b598112..8b583f35880e 100644 --- a/erpnext/stock/report/bom_search/bom_search.py +++ b/erpnext/stock/report/bom_search/bom_search.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe from six import iteritems diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py index 354faa01a436..6cb375136661 100644 --- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py +++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py @@ -13,10 +13,10 @@ from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue from erpnext.stock.report.stock_balance.stock_balance import ( - get_item_details, + get_item_details, get_item_warehouse_map, get_items, - get_stock_ledger_entries + get_stock_ledger_entries, ) from erpnext.stock.utils import is_reposting_item_valuation_in_progress diff --git a/erpnext/support/doctype/issue_type/test_issue_type.py b/erpnext/support/doctype/issue_type/test_issue_type.py index c05039b2925b..06a2de283b59 100644 --- a/erpnext/support/doctype/issue_type/test_issue_type.py +++ b/erpnext/support/doctype/issue_type/test_issue_type.py @@ -6,6 +6,5 @@ import unittest - class TestIssueType(unittest.TestCase): pass diff --git a/erpnext/support/web_form/issues/issues.py b/erpnext/support/web_form/issues/issues.py index 7b390ea2e4da..f57de916dd17 100644 --- a/erpnext/support/web_form/issues/issues.py +++ b/erpnext/support/web_form/issues/issues.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here pass diff --git a/erpnext/templates/pages/projects.py b/erpnext/templates/pages/projects.py index 159c58ab34e6..7124a7ed997d 100644 --- a/erpnext/templates/pages/projects.py +++ b/erpnext/templates/pages/projects.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals - import frappe diff --git a/erpnext/utilities/doctype/sms_log/test_sms_log.py b/erpnext/utilities/doctype/sms_log/test_sms_log.py index c58a8e0a8c39..3baeb2557903 100644 --- a/erpnext/utilities/doctype/sms_log/test_sms_log.py +++ b/erpnext/utilities/doctype/sms_log/test_sms_log.py @@ -5,7 +5,6 @@ import unittest - # test_records = frappe.get_test_records('SMS Log') class TestSMSLog(unittest.TestCase): diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 15da1524d393..51536834367c 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -6,13 +6,7 @@ import frappe import frappe.share from frappe import _ -from frappe.utils import ( - cint, - cstr, - flt, - get_time, - now_datetime -) +from frappe.utils import cint, cstr, flt, get_time, now_datetime from six import string_types from erpnext.controllers.status_updater import StatusUpdater diff --git a/erpnext/utilities/web_form/addresses/addresses.py b/erpnext/utilities/web_form/addresses/addresses.py index a2236a352a1a..4a8d3e15949b 100644 --- a/erpnext/utilities/web_form/addresses/addresses.py +++ b/erpnext/utilities/web_form/addresses/addresses.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals - def get_context(context): # do your magic here context.show_sidebar = True diff --git a/erpnext/www/all-products/index.py b/erpnext/www/all-products/index.py index 2de7a779f2f8..335c10443a78 100644 --- a/erpnext/www/all-products/index.py +++ b/erpnext/www/all-products/index.py @@ -1,8 +1,6 @@ import frappe -from erpnext.portal.product_configurator.utils import ( - get_product_settings -) +from erpnext.portal.product_configurator.utils import get_product_settings from erpnext.shopping_cart.filters import ProductFiltersBuilder from erpnext.shopping_cart.product_query import ProductQuery From cf82446abfbac075d146fc3ecafe2f98552b44bf Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:46:04 +0530 Subject: [PATCH 05/10] chore: Fix import issues --- erpnext/accounts/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index d78592c5ab4b..32be3854d189 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -13,6 +13,7 @@ import erpnext # imported to enable erpnext.accounts.utils.get_account_currency +from erpnext.accounts.doctype.account.account import get_account_currency # noqa from erpnext.stock import get_warehouse_account_map from erpnext.stock.utils import get_stock_value_on From 613aa4c7bbf44c564b42e1b2e2a14655ef5247aa Mon Sep 17 00:00:00 2001 From: ChillarAnand Date: Thu, 2 Sep 2021 20:56:33 +0530 Subject: [PATCH 06/10] chore: Fix sider issues --- erpnext/accounts/doctype/budget/budget.py | 2 +- erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py | 1 - erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py | 2 -- erpnext/buying/doctype/purchase_order/test_purchase_order.py | 1 - erpnext/payroll/doctype/salary_slip/test_salary_slip.py | 5 +---- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 64ac9d6df75a..9c20e82f1693 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -1,4 +1,4 @@ - # -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt diff --git a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py index 097438c0c622..e6e0dd238f02 100644 --- a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import copy -import time import unittest import frappe diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index face10e95452..f339b7f064b3 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import copy -import time import unittest import frappe @@ -28,7 +27,6 @@ from erpnext.stock.doctype.item.test_item import create_item from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError -from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_entry.test_stock_entry import ( get_qty_after_transaction, make_stock_entry, diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 313200791fd5..1453b8e7e4d8 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -495,7 +495,6 @@ def test_purchase_order_on_hold(self): def test_make_purchase_invoice_with_terms(self): from erpnext.selling.doctype.sales_order.test_sales_order import ( automatically_fetch_payment_terms, - compare_payment_schedules, ) automatically_fetch_payment_terms() diff --git a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py index e91dae39066d..07b84b27a337 100644 --- a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py @@ -409,10 +409,7 @@ def test_tax_for_payroll_period(self): for doc in delete_docs: frappe.db.sql("delete from `tab%s` where employee='%s'" % (doc, employee)) - from erpnext.payroll.doctype.salary_structure.test_salary_structure import ( - create_salary_structure_assignment, - make_salary_structure, - ) + from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure salary_structure = make_salary_structure("Stucture to test tax", "Monthly", other_details={"max_benefits": 100000}, test_tax=True, From 72896ad807012b5cb95c947cd2e6b6d58d449ee2 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 3 Sep 2021 12:37:11 +0530 Subject: [PATCH 07/10] chore: linting --- erpnext/patches/v13_0/add_custom_field_for_south_africa.py | 2 +- erpnext/selling/doctype/quotation/test_quotation.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v13_0/add_custom_field_for_south_africa.py b/erpnext/patches/v13_0/add_custom_field_for_south_africa.py index d81b647c0c59..96aa5477f015 100644 --- a/erpnext/patches/v13_0/add_custom_field_for_south_africa.py +++ b/erpnext/patches/v13_0/add_custom_field_for_south_africa.py @@ -3,7 +3,7 @@ import frappe -from erpnext.regional.south_africa.setup import make_custom_fields, add_permissions +from erpnext.regional.south_africa.setup import add_permissions, make_custom_fields def execute(): diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 16309c35419c..a44089a9ce4a 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -230,9 +230,9 @@ def test_quotation_expiry(self): self.assertEqual(expired_quotation.status, "Expired") def test_product_bundle_mapping_on_creating_so(self): - from erpnext.stock.doctype.item.test_item import make_item from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle from erpnext.selling.doctype.quotation.quotation import make_sales_order + from erpnext.stock.doctype.item.test_item import make_item make_item("_Test Product Bundle", {"is_stock_item": 0}) make_item("_Test Bundle Item 1", {"is_stock_item": 1}) @@ -261,8 +261,8 @@ def test_product_bundle_mapping_on_creating_so(self): self.assertEqual(quotation_packed_items, so_packed_items) def test_product_bundle_price_calculation_when_calculate_bundle_price_is_unchecked(self): - from erpnext.stock.doctype.item.test_item import make_item from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle + from erpnext.stock.doctype.item.test_item import make_item make_item("_Test Product Bundle", {"is_stock_item": 0}) bundle_item1 = make_item("_Test Bundle Item 1", {"is_stock_item": 1}) @@ -281,8 +281,8 @@ def test_product_bundle_price_calculation_when_calculate_bundle_price_is_uncheck self.assertEqual(quotation.items[0].amount, 200) def test_product_bundle_price_calculation_when_calculate_bundle_price_is_checked(self): - from erpnext.stock.doctype.item.test_item import make_item from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle + from erpnext.stock.doctype.item.test_item import make_item make_item("_Test Product Bundle", {"is_stock_item": 0}) make_item("_Test Bundle Item 1", {"is_stock_item": 1}) From 420f1629e1184088e08f2def105d05605a1e1bed Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 3 Sep 2021 14:41:37 +0530 Subject: [PATCH 08/10] chore: linting / sorting import from ecommerce refactor merge --- erpnext/e_commerce/api.py | 6 +++-- .../e_commerce_settings.py | 11 ++++++--- .../test_e_commerce_settings.py | 5 +++- .../doctype/item_review/item_review.py | 12 +++++++--- .../doctype/item_review/test_item_review.py | 16 +++++++++---- .../recommended_items/recommended_items.py | 1 + .../doctype/website_item/test_website_item.py | 18 ++++++++++----- .../doctype/website_item/website_item.py | 22 ++++++++++-------- .../website_item_tabbed_section.py | 2 ++ .../doctype/website_offer/website_offer.py | 2 ++ .../doctype/wishlist/test_wishlist.py | 5 ++-- .../e_commerce/doctype/wishlist/wishlist.py | 2 ++ .../doctype/wishlist_item/wishlist_item.py | 2 ++ .../e_commerce/product_data_engine/filters.py | 1 + .../e_commerce/product_data_engine/query.py | 4 +++- .../test_item_group_product_data_engine.py | 3 ++- .../test_product_data_engine.py | 23 +++++++++++++------ erpnext/e_commerce/redisearch.py | 2 +- erpnext/e_commerce/shopping_cart/cart.py | 12 ++++++---- .../e_commerce/shopping_cart/product_info.py | 14 ++++++++--- .../shopping_cart/test_shopping_cart.py | 12 ++++++---- erpnext/e_commerce/shopping_cart/utils.py | 2 ++ .../variant_selector/test_variant_selector.py | 1 + erpnext/e_commerce/variant_selector/utils.py | 2 ++ .../marketplace_settings.py | 11 ++++++--- .../v13_0/create_gst_payment_entry_fields.py | 1 + erpnext/patches/v13_0/create_website_items.py | 2 ++ .../make_homepage_products_website_items.py | 2 ++ .../v13_0/populate_e_commerce_settings.py | 2 ++ erpnext/portal/utils.py | 7 ++++-- erpnext/regional/report/gstr_1/gstr_1.py | 4 ++-- .../setup/doctype/item_group/item_group.py | 8 ++++--- erpnext/stock/doctype/item/item.py | 2 +- .../stock/doctype/price_list/price_list.py | 4 +++- erpnext/templates/pages/cart.py | 2 +- erpnext/templates/pages/customer_reviews.py | 6 ++++- erpnext/templates/pages/order.py | 1 + erpnext/templates/pages/product_search.py | 13 +++++------ erpnext/templates/pages/wishlist.py | 8 +++++-- erpnext/www/all-products/index.py | 2 +- 40 files changed, 179 insertions(+), 76 deletions(-) diff --git a/erpnext/e_commerce/api.py b/erpnext/e_commerce/api.py index 01bde2984c1e..9d24d36f3bd4 100644 --- a/erpnext/e_commerce/api.py +++ b/erpnext/e_commerce/api.py @@ -2,14 +2,16 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import frappe import json + +import frappe from frappe.utils import cint -from erpnext.e_commerce.product_data_engine.query import ProductQuery from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder +from erpnext.e_commerce.product_data_engine.query import ProductQuery from erpnext.setup.doctype.item_group.item_group import get_child_groups_for_website + @frappe.whitelist(allow_guest=True) def get_product_filter_data(query_args=None): """ diff --git a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py index a576e9542b23..b707425bd9f3 100644 --- a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py +++ b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py @@ -4,10 +4,15 @@ import frappe from frappe import _, msgprint -from frappe.utils import flt, comma_and from frappe.model.document import Document -from frappe.utils import unique -from erpnext.e_commerce.redisearch import create_website_items_index, get_indexable_web_fields, is_search_module_loaded +from frappe.utils import comma_and, flt, unique + +from erpnext.e_commerce.redisearch import ( + create_website_items_index, + get_indexable_web_fields, + is_search_module_loaded, +) + class ShoppingCartSetupError(frappe.ValidationError): pass diff --git a/erpnext/e_commerce/doctype/e_commerce_settings/test_e_commerce_settings.py b/erpnext/e_commerce/doctype/e_commerce_settings/test_e_commerce_settings.py index c93674ceda9d..e3a1e1a16a45 100644 --- a/erpnext/e_commerce/doctype/e_commerce_settings/test_e_commerce_settings.py +++ b/erpnext/e_commerce/doctype/e_commerce_settings/test_e_commerce_settings.py @@ -6,7 +6,10 @@ import frappe -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ShoppingCartSetupError +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + ShoppingCartSetupError, +) + class TestECommerceSettings(unittest.TestCase): def setUp(self): diff --git a/erpnext/e_commerce/doctype/item_review/item_review.py b/erpnext/e_commerce/doctype/item_review/item_review.py index 3f34c4a124b6..91e98427d431 100644 --- a/erpnext/e_commerce/doctype/item_review/item_review.py +++ b/erpnext/e_commerce/doctype/item_review/item_review.py @@ -3,13 +3,19 @@ # For license information, please see license.txt from __future__ import unicode_literals + from datetime import datetime + import frappe from frappe import _ -from frappe.model.document import Document from frappe.contacts.doctype.contact.contact import get_contact_name -from frappe.utils import flt, cint -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings +from frappe.model.document import Document +from frappe.utils import cint, flt + +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) + class UnverifiedReviewer(frappe.ValidationError): pass diff --git a/erpnext/e_commerce/doctype/item_review/test_item_review.py b/erpnext/e_commerce/doctype/item_review/test_item_review.py index b19f42ada10e..8a4befc800af 100644 --- a/erpnext/e_commerce/doctype/item_review/test_item_review.py +++ b/erpnext/e_commerce/doctype/item_review/test_item_review.py @@ -1,17 +1,23 @@ # -*- coding: utf-8 -*- # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt -import frappe import unittest +import frappe from frappe.core.doctype.user_permission.test_user_permission import create_user -from erpnext.stock.doctype.item.test_item import make_item +from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import ( + setup_e_commerce_settings, +) +from erpnext.e_commerce.doctype.item_review.item_review import ( + UnverifiedReviewer, + add_item_review, + get_item_reviews, +) from erpnext.e_commerce.doctype.website_item.website_item import make_website_item -from erpnext.e_commerce.doctype.item_review.item_review import get_item_reviews, \ - add_item_review, UnverifiedReviewer from erpnext.e_commerce.shopping_cart.cart import get_party -from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import setup_e_commerce_settings +from erpnext.stock.doctype.item.test_item import make_item + class TestItemReview(unittest.TestCase): def setUp(self): diff --git a/erpnext/e_commerce/doctype/recommended_items/recommended_items.py b/erpnext/e_commerce/doctype/recommended_items/recommended_items.py index 9782abdec630..16b6e52047fc 100644 --- a/erpnext/e_commerce/doctype/recommended_items/recommended_items.py +++ b/erpnext/e_commerce/doctype/recommended_items/recommended_items.py @@ -4,5 +4,6 @@ # import frappe from frappe.model.document import Document + class RecommendedItems(Document): pass diff --git a/erpnext/e_commerce/doctype/website_item/test_website_item.py b/erpnext/e_commerce/doctype/website_item/test_website_item.py index 4a8e82002807..48dd16719537 100644 --- a/erpnext/e_commerce/doctype/website_item/test_website_item.py +++ b/erpnext/e_commerce/doctype/website_item/test_website_item.py @@ -3,15 +3,21 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest -from erpnext.stock.doctype.item.item import DataValidationError -from erpnext.stock.doctype.item.test_item import make_item -from erpnext.e_commerce.doctype.website_item.website_item import make_website_item + +import frappe + from erpnext.controllers.item_variant import create_variant -from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import setup_e_commerce_settings -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) +from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import ( + setup_e_commerce_settings, +) +from erpnext.e_commerce.doctype.website_item.website_item import make_website_item from erpnext.e_commerce.shopping_cart.product_info import get_product_info_for_website +from erpnext.stock.doctype.item.item import DataValidationError +from erpnext.stock.doctype.item.test_item import make_item WEBITEM_DESK_TESTS = ("test_website_item_desk_item_sync", "test_publish_variant_and_template") WEBITEM_PRICE_TESTS = ('test_website_item_price_for_logged_in_user', 'test_website_item_price_for_guest_user') diff --git a/erpnext/e_commerce/doctype/website_item/website_item.py b/erpnext/e_commerce/doctype/website_item/website_item.py index 2d71907b2c91..0608486da953 100644 --- a/erpnext/e_commerce/doctype/website_item/website_item.py +++ b/erpnext/e_commerce/doctype/website_item/website_item.py @@ -2,26 +2,30 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import frappe -import json import itertools -from frappe import _ +import json -from frappe.website.website_generator import WebsiteGenerator -from frappe.utils import cstr, random_string, cint, flt +import frappe +from frappe import _ +from frappe.utils import cint, cstr, flt, random_string from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow +from frappe.website.website_generator import WebsiteGenerator -from erpnext.setup.doctype.item_group.item_group import (get_parent_item_groups, invalidate_cache_for) from erpnext.e_commerce.doctype.item_review.item_review import get_item_reviews -from erpnext.e_commerce.shopping_cart.cart import _set_price_list -from erpnext.utilities.product import get_price # SEARCH from erpnext.e_commerce.redisearch import ( + delete_item_from_index, insert_item_to_index, update_index_for_item, - delete_item_from_index ) +from erpnext.e_commerce.shopping_cart.cart import _set_price_list +from erpnext.setup.doctype.item_group.item_group import ( + get_parent_item_groups, + invalidate_cache_for, +) +from erpnext.utilities.product import get_price + class WebsiteItem(WebsiteGenerator): website = frappe._dict( diff --git a/erpnext/e_commerce/doctype/website_item_tabbed_section/website_item_tabbed_section.py b/erpnext/e_commerce/doctype/website_item_tabbed_section/website_item_tabbed_section.py index 8459e625cfd8..6a1bf4d50980 100644 --- a/erpnext/e_commerce/doctype/website_item_tabbed_section/website_item_tabbed_section.py +++ b/erpnext/e_commerce/doctype/website_item_tabbed_section/website_item_tabbed_section.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class WebsiteItemTabbedSection(Document): pass diff --git a/erpnext/e_commerce/doctype/website_offer/website_offer.py b/erpnext/e_commerce/doctype/website_offer/website_offer.py index e446f85d65f7..2e0b84831db1 100644 --- a/erpnext/e_commerce/doctype/website_offer/website_offer.py +++ b/erpnext/e_commerce/doctype/website_offer/website_offer.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class WebsiteOffer(Document): pass diff --git a/erpnext/e_commerce/doctype/wishlist/test_wishlist.py b/erpnext/e_commerce/doctype/wishlist/test_wishlist.py index 42cf8683d994..504bb658113e 100644 --- a/erpnext/e_commerce/doctype/wishlist/test_wishlist.py +++ b/erpnext/e_commerce/doctype/wishlist/test_wishlist.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt -import frappe import unittest +import frappe from frappe.core.doctype.user_permission.test_user_permission import create_user -from erpnext.stock.doctype.item.test_item import make_item from erpnext.e_commerce.doctype.website_item.website_item import make_website_item from erpnext.e_commerce.doctype.wishlist.wishlist import add_to_wishlist, remove_from_wishlist +from erpnext.stock.doctype.item.test_item import make_item + class TestWishlist(unittest.TestCase): def setUp(self): diff --git a/erpnext/e_commerce/doctype/wishlist/wishlist.py b/erpnext/e_commerce/doctype/wishlist/wishlist.py index 276ecae10dbc..0973e1ed5f35 100644 --- a/erpnext/e_commerce/doctype/wishlist/wishlist.py +++ b/erpnext/e_commerce/doctype/wishlist/wishlist.py @@ -3,9 +3,11 @@ # For license information, please see license.txt from __future__ import unicode_literals + import frappe from frappe.model.document import Document + class Wishlist(Document): pass diff --git a/erpnext/e_commerce/doctype/wishlist_item/wishlist_item.py b/erpnext/e_commerce/doctype/wishlist_item/wishlist_item.py index ee08cfea597f..b0455808f5e1 100644 --- a/erpnext/e_commerce/doctype/wishlist_item/wishlist_item.py +++ b/erpnext/e_commerce/doctype/wishlist_item/wishlist_item.py @@ -3,8 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals + # import frappe from frappe.model.document import Document + class WishlistItem(Document): pass diff --git a/erpnext/e_commerce/product_data_engine/filters.py b/erpnext/e_commerce/product_data_engine/filters.py index fc58b44f0eee..f9e3b6ae32e0 100644 --- a/erpnext/e_commerce/product_data_engine/filters.py +++ b/erpnext/e_commerce/product_data_engine/filters.py @@ -4,6 +4,7 @@ from frappe import _dict from frappe.utils import floor + class ProductFiltersBuilder: def __init__(self, item_group=None): if not item_group: diff --git a/erpnext/e_commerce/product_data_engine/query.py b/erpnext/e_commerce/product_data_engine/query.py index 331fd351542d..6fc7bf045415 100644 --- a/erpnext/e_commerce/product_data_engine/query.py +++ b/erpnext/e_commerce/product_data_engine/query.py @@ -3,10 +3,12 @@ import frappe from frappe.utils import flt -from erpnext.e_commerce.shopping_cart.product_info import get_product_info_for_website + from erpnext.e_commerce.doctype.item_review.item_review import get_customer +from erpnext.e_commerce.shopping_cart.product_info import get_product_info_for_website from erpnext.utilities.product import get_non_stock_item_status + class ProductQuery: """Query engine for product listing diff --git a/erpnext/e_commerce/product_data_engine/test_item_group_product_data_engine.py b/erpnext/e_commerce/product_data_engine/test_item_group_product_data_engine.py index 264fbd8bf70c..f0f7918d00ee 100644 --- a/erpnext/e_commerce/product_data_engine/test_item_group_product_data_engine.py +++ b/erpnext/e_commerce/product_data_engine/test_item_group_product_data_engine.py @@ -1,9 +1,10 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import frappe import unittest +import frappe + from erpnext.e_commerce.api import get_product_filter_data from erpnext.e_commerce.doctype.website_item.test_website_item import create_regular_web_item diff --git a/erpnext/e_commerce/product_data_engine/test_product_data_engine.py b/erpnext/e_commerce/product_data_engine/test_product_data_engine.py index 201fa1148e74..066adcce21b8 100644 --- a/erpnext/e_commerce/product_data_engine/test_product_data_engine.py +++ b/erpnext/e_commerce/product_data_engine/test_product_data_engine.py @@ -1,13 +1,16 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt -import frappe import unittest -from erpnext.e_commerce.product_data_engine.query import ProductQuery -from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder +import frappe + +from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import ( + setup_e_commerce_settings, +) from erpnext.e_commerce.doctype.website_item.test_website_item import create_regular_web_item -from erpnext.e_commerce.doctype.e_commerce_settings.test_e_commerce_settings import setup_e_commerce_settings +from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder +from erpnext.e_commerce.product_data_engine.query import ProductQuery test_dependencies = ["Item", "Item Group"] @@ -201,7 +204,10 @@ def test_product_list_with_attribute_filter(self): def test_product_list_discount_filter_builder(self): "Test if discount filters are fetched correctly." - from erpnext.e_commerce.doctype.website_item.test_website_item import make_web_item_price, make_web_pricing_rule + from erpnext.e_commerce.doctype.website_item.test_website_item import ( + make_web_item_price, + make_web_pricing_rule, + ) item_code = "Test 12I Laptop" make_web_item_price(item_code=item_code) @@ -234,7 +240,10 @@ def test_product_list_discount_filter_builder(self): def test_product_list_with_discount_filters(self): "Test if discount filters are applied correctly." - from erpnext.e_commerce.doctype.website_item.test_website_item import make_web_item_price, make_web_pricing_rule + from erpnext.e_commerce.doctype.website_item.test_website_item import ( + make_web_item_price, + make_web_pricing_rule, + ) field_filters = {"discount": [10]} @@ -323,9 +332,9 @@ def test_product_list_with_variants(self): def create_variant_web_item(): "Create Variant and Template Website Items." - from erpnext.stock.doctype.item.test_item import make_item from erpnext.controllers.item_variant import create_variant from erpnext.e_commerce.doctype.website_item.website_item import make_website_item + from erpnext.stock.doctype.item.test_item import make_item make_item("Test Web Item", { "has_variant": 1, diff --git a/erpnext/e_commerce/redisearch.py b/erpnext/e_commerce/redisearch.py index d0626a368272..5cfb5ae29202 100644 --- a/erpnext/e_commerce/redisearch.py +++ b/erpnext/e_commerce/redisearch.py @@ -3,7 +3,7 @@ import frappe from frappe.utils.redis_wrapper import RedisWrapper -from redisearch import (Client, AutoCompleter, Suggestion, IndexDefinition, TextField, TagField) +from redisearch import AutoCompleter, Client, IndexDefinition, Suggestion, TagField, TextField WEBSITE_ITEM_INDEX = 'website_items_index' WEBSITE_ITEM_KEY_PREFIX = 'website_item:' diff --git a/erpnext/e_commerce/shopping_cart/cart.py b/erpnext/e_commerce/shopping_cart/cart.py index b7ba6e50b379..b4295d2105b9 100644 --- a/erpnext/e_commerce/shopping_cart/cart.py +++ b/erpnext/e_commerce/shopping_cart/cart.py @@ -2,16 +2,20 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import frappe -from frappe import throw, _ import frappe.defaults -from frappe.utils import cint, flt, get_fullname, cstr +from frappe import _, throw from frappe.contacts.doctype.address.address import get_address_display -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings +from frappe.contacts.doctype.contact.contact import get_contact_name +from frappe.utils import cint, cstr, flt, get_fullname from frappe.utils.nestedset import get_root_of + from erpnext.accounts.utils import get_account_name +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) from erpnext.utilities.product import get_web_item_qty_in_stock -from frappe.contacts.doctype.contact.contact import get_contact_name class WebsitePriceListMissingError(frappe.ValidationError): diff --git a/erpnext/e_commerce/shopping_cart/product_info.py b/erpnext/e_commerce/shopping_cart/product_info.py index 838449009e43..5e3bdc5c3621 100644 --- a/erpnext/e_commerce/shopping_cart/product_info.py +++ b/erpnext/e_commerce/shopping_cart/product_info.py @@ -4,10 +4,18 @@ from __future__ import unicode_literals import frappe + +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, + show_quantity_in_website, +) from erpnext.e_commerce.shopping_cart.cart import _get_cart_quotation, _set_price_list -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings \ - import get_shopping_cart_settings, show_quantity_in_website -from erpnext.utilities.product import get_price, get_web_item_qty_in_stock, get_non_stock_item_status +from erpnext.utilities.product import ( + get_non_stock_item_status, + get_price, + get_web_item_qty_in_stock, +) + @frappe.whitelist(allow_guest=True) def get_product_info_for_website(item_code, skip_quotation_creation=False): diff --git a/erpnext/e_commerce/shopping_cart/test_shopping_cart.py b/erpnext/e_commerce/shopping_cart/test_shopping_cart.py index bc4ca3fbffe1..96614d0cb642 100644 --- a/erpnext/e_commerce/shopping_cart/test_shopping_cart.py +++ b/erpnext/e_commerce/shopping_cart/test_shopping_cart.py @@ -2,13 +2,17 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals + import unittest + import frappe -from frappe.utils import nowdate, add_months -from erpnext.tests.utils import create_test_contact_and_address +from frappe.utils import add_months, nowdate + +from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule from erpnext.e_commerce.doctype.website_item.website_item import make_website_item -from erpnext.e_commerce.shopping_cart.cart import _get_cart_quotation, update_cart, get_party -from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule +from erpnext.e_commerce.shopping_cart.cart import _get_cart_quotation, get_party, update_cart +from erpnext.tests.utils import create_test_contact_and_address + class TestShoppingCart(unittest.TestCase): """ diff --git a/erpnext/e_commerce/shopping_cart/utils.py b/erpnext/e_commerce/shopping_cart/utils.py index 75a338653a5e..51398596fd8f 100644 --- a/erpnext/e_commerce/shopping_cart/utils.py +++ b/erpnext/e_commerce/shopping_cart/utils.py @@ -5,8 +5,10 @@ import frappe import frappe.defaults + from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import is_cart_enabled + def show_cart_count(): if (is_cart_enabled() and frappe.db.get_value("User", frappe.session.user, "user_type") == "Website User"): diff --git a/erpnext/e_commerce/variant_selector/test_variant_selector.py b/erpnext/e_commerce/variant_selector/test_variant_selector.py index 3eeca173fa3b..c70fee5fff50 100644 --- a/erpnext/e_commerce/variant_selector/test_variant_selector.py +++ b/erpnext/e_commerce/variant_selector/test_variant_selector.py @@ -1,5 +1,6 @@ # import frappe import unittest + # from erpnext.e_commerce.product_data_engine.query import ProductQuery # from erpnext.e_commerce.doctype.website_item.website_item import make_website_item diff --git a/erpnext/e_commerce/variant_selector/utils.py b/erpnext/e_commerce/variant_selector/utils.py index 2e1852c02564..61df3adca582 100644 --- a/erpnext/e_commerce/variant_selector/utils.py +++ b/erpnext/e_commerce/variant_selector/utils.py @@ -1,7 +1,9 @@ import frappe from frappe.utils import cint + from erpnext.e_commerce.variant_selector.item_variants_cache import ItemVariantsCacheManager + def get_item_codes_by_attributes(attribute_filters, template_item_code=None): items = [] diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index c89c876279ad..9714944cec21 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -2,14 +2,19 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe, requests, json, time -from frappe.model.document import Document -from frappe.utils import add_years, now, get_datetime, get_datetime_str, cint +import json +import time + +import frappe +import requests from frappe import _ from frappe.frappeclient import FrappeClient +from frappe.model.document import Document +from frappe.utils import add_years, cint, get_datetime, get_datetime_str, now from six import string_types + class MarketplaceSettings(Document): def register_seller(self, company, company_description): diff --git a/erpnext/patches/v13_0/create_gst_payment_entry_fields.py b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py index 334c9d2b816d..7e6d67ce9316 100644 --- a/erpnext/patches/v13_0/create_gst_payment_entry_fields.py +++ b/erpnext/patches/v13_0/create_gst_payment_entry_fields.py @@ -4,6 +4,7 @@ import frappe from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + def execute(): frappe.reload_doc('accounts', 'doctype', 'advance_taxes_and_charges') frappe.reload_doc('accounts', 'doctype', 'payment_entry') diff --git a/erpnext/patches/v13_0/create_website_items.py b/erpnext/patches/v13_0/create_website_items.py index 79c1418190fb..4a1196839349 100644 --- a/erpnext/patches/v13_0/create_website_items.py +++ b/erpnext/patches/v13_0/create_website_items.py @@ -1,6 +1,8 @@ import frappe + from erpnext.e_commerce.doctype.website_item.website_item import make_website_item + def execute(): frappe.reload_doc("e_commerce", "doctype", "website_item") frappe.reload_doc("e_commerce", "doctype", "website_item_tabbed_section") diff --git a/erpnext/patches/v13_0/make_homepage_products_website_items.py b/erpnext/patches/v13_0/make_homepage_products_website_items.py index 8be5875b78db..d48d54802c46 100644 --- a/erpnext/patches/v13_0/make_homepage_products_website_items.py +++ b/erpnext/patches/v13_0/make_homepage_products_website_items.py @@ -1,6 +1,8 @@ from __future__ import unicode_literals + import frappe + def execute(): homepage = frappe.get_doc("Homepage") diff --git a/erpnext/patches/v13_0/populate_e_commerce_settings.py b/erpnext/patches/v13_0/populate_e_commerce_settings.py index 1565ac2033e9..4466de817a74 100644 --- a/erpnext/patches/v13_0/populate_e_commerce_settings.py +++ b/erpnext/patches/v13_0/populate_e_commerce_settings.py @@ -1,7 +1,9 @@ from __future__ import unicode_literals + import frappe from frappe.utils import cint + def execute(): frappe.reload_doc("e_commerce", "doctype", "e_commerce_settings") frappe.reload_doc("portal", "doctype", "website_filter_field") diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py index 26a0e9b82153..84c862b052aa 100644 --- a/erpnext/portal/utils.py +++ b/erpnext/portal/utils.py @@ -1,10 +1,13 @@ from __future__ import unicode_literals import frappe -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings -from erpnext.e_commerce.shopping_cart.cart import get_debtors_account from frappe.utils.nestedset import get_root_of +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) +from erpnext.e_commerce.shopping_cart.cart import get_debtors_account + def set_default_role(doc, method): '''Set customer, supplier, student, guardian based on email''' diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index e3e09ef8e560..ca0defa648aa 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -54,7 +54,7 @@ def run(self): self.get_invoice_items() self.get_items_based_on_tax_rate() self.invoice_fields = [d["fieldname"] for d in self.invoice_columns] - + self.get_data() return self.columns, self.data @@ -713,7 +713,7 @@ def get_columns(self): "width": 100 } ] - + self.columns = self.invoice_columns + self.tax_columns + self.other_columns @frappe.whitelist() diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 8d2ce43a8b3e..c3306e1c51ee 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -7,14 +7,16 @@ import frappe from frappe import _ -from frappe.utils import nowdate, cint, cstr +from frappe.utils import cint, cstr, nowdate from frappe.utils.nestedset import NestedSet -from frappe.website.website_generator import WebsiteGenerator -from frappe.website.render import clear_cache from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow +from frappe.website.render import clear_cache +from frappe.website.website_generator import WebsiteGenerator from six.moves.urllib.parse import quote + from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder + class ItemGroup(NestedSet, WebsiteGenerator): nsm_parent_field = 'parent_item_group' website = frappe._dict( diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ee5301660fa8..8ef38e73e6ed 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -7,6 +7,7 @@ import frappe from frappe import _ +from frappe.model.document import Document from frappe.utils import ( cint, cstr, @@ -21,7 +22,6 @@ ) from frappe.utils.html_utils import clean_html from frappe.website.render import clear_cache -from frappe.model.document import Document import erpnext from erpnext.controllers.item_variant import ( diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index fc9bc43ce5fa..1a5a7ba23ff8 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -38,7 +38,9 @@ def update_item_price(self): def check_impact_on_shopping_cart(self): "Check if Price List currency change impacts E Commerce Cart." - from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import validate_cart_settings + from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + validate_cart_settings, + ) doc_before_save = self.get_doc_before_save() currency_changed = self.currency != doc_before_save.currency diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py index 77d62d0a3b04..cb018bd7bd0a 100644 --- a/erpnext/templates/pages/cart.py +++ b/erpnext/templates/pages/cart.py @@ -2,8 +2,8 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals - import frappe + from erpnext.e_commerce.shopping_cart.cart import get_cart_quotation no_cache = 1 diff --git a/erpnext/templates/pages/customer_reviews.py b/erpnext/templates/pages/customer_reviews.py index 10cb28af8ef6..c1f0c93f1aab 100644 --- a/erpnext/templates/pages/customer_reviews.py +++ b/erpnext/templates/pages/customer_reviews.py @@ -1,9 +1,13 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe + +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) from erpnext.e_commerce.doctype.item_review.item_review import get_item_reviews from erpnext.e_commerce.doctype.website_item.website_item import check_if_user_is_customer -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings + def get_context(context): context.body_class = "product-page" diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index 59df433804cf..a5e48ac883e6 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -8,6 +8,7 @@ from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import show_attachments + def get_context(context): context.no_cache = 1 context.show_sidebar = True diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py index dad6238185c7..4fccf593b0ed 100644 --- a/erpnext/templates/pages/product_search.py +++ b/erpnext/templates/pages/product_search.py @@ -3,18 +3,17 @@ import frappe from frappe.utils import cint, cstr, nowdate - -from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html -from erpnext.e_commerce.shopping_cart.product_info import set_product_info_for_website - from redisearch import AutoCompleter, Client, Query + from erpnext.e_commerce.redisearch import ( - is_search_module_loaded, + WEBSITE_ITEM_CATEGORY_AUTOCOMPLETE, WEBSITE_ITEM_INDEX, WEBSITE_ITEM_NAME_AUTOCOMPLETE, - WEBSITE_ITEM_CATEGORY_AUTOCOMPLETE, - make_key + is_search_module_loaded, + make_key, ) +from erpnext.e_commerce.shopping_cart.product_info import set_product_info_for_website +from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html no_cache = 1 diff --git a/erpnext/templates/pages/wishlist.py b/erpnext/templates/pages/wishlist.py index 339e51b5a7f8..72ee34e157ed 100644 --- a/erpnext/templates/pages/wishlist.py +++ b/erpnext/templates/pages/wishlist.py @@ -1,9 +1,13 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe -from erpnext.utilities.product import get_price + +from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import ( + get_shopping_cart_settings, +) from erpnext.e_commerce.shopping_cart.cart import _set_price_list -from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings +from erpnext.utilities.product import get_price + def get_context(context): is_guest = frappe.session.user == "Guest" diff --git a/erpnext/www/all-products/index.py b/erpnext/www/all-products/index.py index a5f4a7c9563c..17e0cd86ca76 100644 --- a/erpnext/www/all-products/index.py +++ b/erpnext/www/all-products/index.py @@ -1,6 +1,6 @@ import frappe - from frappe.utils import cint + from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder sitemap = 1 From 2ab57229de966ce6e28557e71495dab64535d76d Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 3 Sep 2021 14:43:32 +0530 Subject: [PATCH 09/10] ci: dont allow unused imports --- .github/helper/.flake8_strict | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/helper/.flake8_strict b/.github/helper/.flake8_strict index c17871dfa94d..4c7f5f82cfb6 100644 --- a/.github/helper/.flake8_strict +++ b/.github/helper/.flake8_strict @@ -44,7 +44,6 @@ ignore = E303, E305, E306, - E401, E402, E501, E502, @@ -52,7 +51,6 @@ ignore = E702, E703, E741, - F401, F403, W191, W291, From 9dda61513b4f8dfb9a5ea5b3c22ad08b1420044f Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 3 Sep 2021 17:21:47 +0530 Subject: [PATCH 10/10] chore: sort / clean ecommerce imports --- .../doctype/e_commerce_settings/e_commerce_settings.py | 2 +- .../doctype/marketplace_settings/marketplace_settings.py | 8 +------- erpnext/setup/doctype/item_group/item_group.py | 3 +-- erpnext/stock/doctype/item/item.py | 8 +------- erpnext/templates/pages/cart.py | 3 --- erpnext/templates/pages/product_search.py | 2 +- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py index b707425bd9f3..6fc5ef9e9584 100644 --- a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py +++ b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py @@ -3,7 +3,7 @@ # For license information, please see license.txt import frappe -from frappe import _, msgprint +from frappe import _ from frappe.model.document import Document from frappe.utils import comma_and, flt, unique diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py index 9714944cec21..af2ff37797ec 100644 --- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py +++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py @@ -1,18 +1,12 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt -from __future__ import unicode_literals - import json -import time import frappe -import requests -from frappe import _ from frappe.frappeclient import FrappeClient from frappe.model.document import Document -from frappe.utils import add_years, cint, get_datetime, get_datetime_str, now -from six import string_types +from frappe.utils import cint class MarketplaceSettings(Document): diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index c3306e1c51ee..0943b22c0282 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -7,9 +7,8 @@ import frappe from frappe import _ -from frappe.utils import cint, cstr, nowdate +from frappe.utils import cint from frappe.utils.nestedset import NestedSet -from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow from frappe.website.render import clear_cache from frappe.website.website_generator import WebsiteGenerator from six.moves.urllib.parse import quote diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 8ef38e73e6ed..50f68665a3af 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -2,7 +2,6 @@ # License: GNU General Public License v3. See license.txt import copy -import itertools import json import frappe @@ -17,11 +16,9 @@ getdate, now_datetime, nowtime, - random_string, strip, ) from frappe.utils.html_utils import clean_html -from frappe.website.render import clear_cache import erpnext from erpnext.controllers.item_variant import ( @@ -31,10 +28,7 @@ make_variant_item_code, validate_item_variant_attributes, ) -from erpnext.setup.doctype.item_group.item_group import ( - get_parent_item_groups, - invalidate_cache_for, -) +from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for class DuplicateReorderRows(frappe.ValidationError): diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py index cb018bd7bd0a..0d0e6ce4f8f0 100644 --- a/erpnext/templates/pages/cart.py +++ b/erpnext/templates/pages/cart.py @@ -1,8 +1,5 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -from __future__ import unicode_literals - -import frappe from erpnext.e_commerce.shopping_cart.cart import get_cart_quotation diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py index 4fccf593b0ed..99ad648e5308 100644 --- a/erpnext/templates/pages/product_search.py +++ b/erpnext/templates/pages/product_search.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt import frappe -from frappe.utils import cint, cstr, nowdate +from frappe.utils import cint, cstr from redisearch import AutoCompleter, Client, Query from erpnext.e_commerce.redisearch import (