fix: Move check from Stock Settings to Company Master

(cherry picked from commit 53d5d16abb52790d60c0ef050a9c7a6685fbc5df)
This commit is contained in:
Deepesh Garg 2020-06-20 11:55:56 +05:30 committed by mergify-bot
parent 6e2ca779c5
commit 12f1f8e111
4 changed files with 130 additions and 378 deletions

View File

@ -587,7 +587,7 @@ class PurchaseInvoice(BuyingController):
else: else:
amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount")) amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount"))
auto_accounting_for_non_stock_items = cint(frappe.db.get_single_value('Stock Settings', 'enable_perpetual_inventory_for_non_stock_items')) auto_accounting_for_non_stock_items = cint(frappe.db.get_value('Company', self.company, 'enable_perpetual_inventory_for_non_stock_items'))
service_received_but_not_billed_account = self.get_company_default("service_received_but_not_billed") service_received_but_not_billed_account = self.get_company_default("service_received_but_not_billed")
if item.purchase_receipt and auto_accounting_for_non_stock_items: if item.purchase_receipt and auto_accounting_for_non_stock_items:

View File

@ -67,6 +67,7 @@
"payment_terms", "payment_terms",
"auto_accounting_for_stock_settings", "auto_accounting_for_stock_settings",
"enable_perpetual_inventory", "enable_perpetual_inventory",
"enable_perpetual_inventory_for_non_stock_items",
"default_inventory_account", "default_inventory_account",
"stock_adjustment_account", "stock_adjustment_account",
"column_break_32", "column_break_32",
@ -107,9 +108,7 @@
{ {
"fieldname": "details", "fieldname": "details",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "company_name", "fieldname": "company_name",
@ -118,8 +117,6 @@
"oldfieldname": "company_name", "oldfieldname": "company_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"reqd": 1, "reqd": 1,
"show_days": 1,
"show_seconds": 1,
"unique": 1 "unique": 1
}, },
{ {
@ -128,48 +125,36 @@
"label": "Abbr", "label": "Abbr",
"oldfieldname": "abbr", "oldfieldname": "abbr",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"reqd": 1, "reqd": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal && in_list(frappe.user_roles, \"System Manager\")", "depends_on": "eval:!doc.__islocal && in_list(frappe.user_roles, \"System Manager\")",
"fieldname": "change_abbr", "fieldname": "change_abbr",
"fieldtype": "Button", "fieldtype": "Button",
"label": "Change Abbreviation", "label": "Change Abbreviation"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"bold": 1, "bold": 1,
"default": "0", "default": "0",
"fieldname": "is_group", "fieldname": "is_group",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Group", "label": "Is Group"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_finance_book", "fieldname": "default_finance_book",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Finance Book", "label": "Default Finance Book",
"options": "Finance Book", "options": "Finance Book"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "cb0", "fieldname": "cb0",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "domain", "fieldname": "domain",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Domain", "label": "Domain",
"options": "Domain", "options": "Domain"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "parent_company", "fieldname": "parent_company",
@ -177,32 +162,24 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Parent Company", "label": "Parent Company",
"options": "Company", "options": "Company"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "company_logo", "fieldname": "company_logo",
"fieldtype": "Attach Image", "fieldtype": "Attach Image",
"hidden": 1, "hidden": 1,
"label": "Company Logo", "label": "Company Logo"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "company_description", "fieldname": "company_description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"label": "Company Description", "label": "Company Description"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"collapsible": 1, "collapsible": 1,
"fieldname": "sales_settings", "fieldname": "sales_settings",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Sales Settings", "label": "Sales Settings"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "sales_monthly_history", "fieldname": "sales_monthly_history",
@ -210,9 +187,7 @@
"hidden": 1, "hidden": 1,
"label": "Sales Monthly History", "label": "Sales Monthly History",
"no_copy": 1, "no_copy": 1,
"read_only": 1, "read_only": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "transactions_annual_history", "fieldname": "transactions_annual_history",
@ -220,23 +195,17 @@
"hidden": 1, "hidden": 1,
"label": "Transactions Annual History", "label": "Transactions Annual History",
"no_copy": 1, "no_copy": 1,
"read_only": 1, "read_only": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "monthly_sales_target", "fieldname": "monthly_sales_target",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Monthly Sales Target", "label": "Monthly Sales Target",
"options": "default_currency", "options": "default_currency"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_goals", "fieldname": "column_break_goals",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "total_monthly_sales", "fieldname": "total_monthly_sales",
@ -244,16 +213,12 @@
"label": "Total Monthly Sales", "label": "Total Monthly Sales",
"no_copy": 1, "no_copy": 1,
"options": "default_currency", "options": "default_currency",
"read_only": 1, "read_only": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "charts_section", "fieldname": "charts_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Default Values", "label": "Default Values"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_currency", "fieldname": "default_currency",
@ -261,46 +226,34 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Currency", "label": "Default Currency",
"options": "Currency", "options": "Currency",
"reqd": 1, "reqd": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_letter_head", "fieldname": "default_letter_head",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Letter Head", "label": "Default Letter Head",
"options": "Letter Head", "options": "Letter Head"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_holiday_list", "fieldname": "default_holiday_list",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Holiday List", "label": "Default Holiday List",
"options": "Holiday List", "options": "Holiday List"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "standard_working_hours", "fieldname": "standard_working_hours",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Standard Working Hours", "label": "Standard Working Hours"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_warehouse_for_sales_return", "fieldname": "default_warehouse_for_sales_return",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default warehouse for Sales Return", "label": "Default warehouse for Sales Return",
"options": "Warehouse", "options": "Warehouse"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_10", "fieldname": "column_break_10",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "country", "fieldname": "country",
@ -308,26 +261,20 @@
"in_list_view": 1, "in_list_view": 1,
"label": "Country", "label": "Country",
"options": "Country", "options": "Country",
"reqd": 1, "reqd": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "create_chart_of_accounts_based_on", "fieldname": "create_chart_of_accounts_based_on",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Create Chart Of Accounts Based On", "label": "Create Chart Of Accounts Based On",
"options": "\nStandard Template\nExisting Company", "options": "\nStandard Template\nExisting Company"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Standard Template\"", "depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Standard Template\"",
"fieldname": "chart_of_accounts", "fieldname": "chart_of_accounts",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Chart Of Accounts Template", "label": "Chart Of Accounts Template",
"no_copy": 1, "no_copy": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Existing Company\"", "depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Existing Company\"",
@ -336,31 +283,23 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Existing Company ", "label": "Existing Company ",
"no_copy": 1, "no_copy": 1,
"options": "Company", "options": "Company"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "tax_id", "fieldname": "tax_id",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Tax ID", "label": "Tax ID"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "date_of_establishment", "fieldname": "date_of_establishment",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Date of Establishment", "label": "Date of Establishment"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_settings", "fieldname": "default_settings",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Accounts Settings", "label": "Accounts Settings",
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -371,9 +310,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "default_bank_account", "oldfieldname": "default_bank_account",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -382,9 +319,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Cash Account", "label": "Default Cash Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -395,72 +330,54 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "receivables_group", "oldfieldname": "receivables_group",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "round_off_account", "fieldname": "round_off_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Round Off Account", "label": "Round Off Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "round_off_cost_center", "fieldname": "round_off_cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Round Off Cost Center", "label": "Round Off Cost Center",
"options": "Cost Center", "options": "Cost Center"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "write_off_account", "fieldname": "write_off_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Write Off Account", "label": "Write Off Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "discount_allowed_account", "fieldname": "discount_allowed_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Discount Allowed Account", "label": "Discount Allowed Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "discount_received_account", "fieldname": "discount_received_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Discount Received Account", "label": "Discount Received Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "exchange_gain_loss_account", "fieldname": "exchange_gain_loss_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Exchange Gain / Loss Account", "label": "Exchange Gain / Loss Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "unrealized_exchange_gain_loss_account", "fieldname": "unrealized_exchange_gain_loss_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Unrealized Exchange Gain/Loss Account", "label": "Unrealized Exchange Gain/Loss Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break0", "fieldname": "column_break0",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"oldfieldtype": "Column Break", "oldfieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
"width": "50%" "width": "50%"
}, },
{ {
@ -468,9 +385,7 @@
"depends_on": "eval:doc.parent_company", "depends_on": "eval:doc.parent_company",
"fieldname": "allow_account_creation_against_child_company", "fieldname": "allow_account_creation_against_child_company",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Account Creation Against Child Company", "label": "Allow Account Creation Against Child Company"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -481,18 +396,14 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "payables_group", "oldfieldname": "payables_group",
"oldfieldtype": "Link", "oldfieldtype": "Link",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_employee_advance_account", "fieldname": "default_employee_advance_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Employee Advance Account", "label": "Default Employee Advance Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -501,9 +412,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Cost of Goods Sold Account", "label": "Default Cost of Goods Sold Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -512,9 +421,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Income Account", "label": "Default Income Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -523,9 +430,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Deferred Revenue Account", "label": "Default Deferred Revenue Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -534,9 +439,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Deferred Expense Account", "label": "Default Deferred Expense Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -545,9 +448,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Payroll Payable Account", "label": "Default Payroll Payable Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -556,15 +457,11 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Expense Claim Payable Account", "label": "Default Expense Claim Payable Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "section_break_22", "fieldname": "section_break_22",
"fieldtype": "Section Break", "fieldtype": "Section Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -573,15 +470,11 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Default Cost Center", "label": "Default Cost Center",
"no_copy": 1, "no_copy": 1,
"options": "Cost Center", "options": "Cost Center"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_26", "fieldname": "column_break_26",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
@ -590,41 +483,31 @@
"label": "Credit Limit", "label": "Credit Limit",
"oldfieldname": "credit_limit", "oldfieldname": "credit_limit",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"options": "default_currency", "options": "default_currency"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "payment_terms", "fieldname": "payment_terms",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Payment Terms Template", "label": "Default Payment Terms Template",
"options": "Payment Terms Template", "options": "Payment Terms Template"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"depends_on": "eval:!doc.__islocal", "depends_on": "eval:!doc.__islocal",
"fieldname": "auto_accounting_for_stock_settings", "fieldname": "auto_accounting_for_stock_settings",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Stock Settings", "label": "Stock Settings"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "1", "default": "1",
"fieldname": "enable_perpetual_inventory", "fieldname": "enable_perpetual_inventory",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Enable Perpetual Inventory", "label": "Enable Perpetual Inventory"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_inventory_account", "fieldname": "default_inventory_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Inventory Account", "label": "Default Inventory Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_adjustment_account", "fieldname": "stock_adjustment_account",
@ -632,15 +515,11 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Stock Adjustment Account", "label": "Stock Adjustment Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_32", "fieldname": "column_break_32",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_received_but_not_billed", "fieldname": "stock_received_but_not_billed",
@ -648,9 +527,7 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Stock Received But Not Billed", "label": "Stock Received But Not Billed",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "expenses_included_in_valuation", "fieldname": "expenses_included_in_valuation",
@ -658,144 +535,108 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Expenses Included In Valuation", "label": "Expenses Included In Valuation",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"collapsible": 1, "collapsible": 1,
"fieldname": "fixed_asset_depreciation_settings", "fieldname": "fixed_asset_depreciation_settings",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Fixed Asset Depreciation Settings", "label": "Fixed Asset Depreciation Settings"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "accumulated_depreciation_account", "fieldname": "accumulated_depreciation_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Accumulated Depreciation Account", "label": "Accumulated Depreciation Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "depreciation_expense_account", "fieldname": "depreciation_expense_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Depreciation Expense Account", "label": "Depreciation Expense Account",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "series_for_depreciation_entry", "fieldname": "series_for_depreciation_entry",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Series for Asset Depreciation Entry (Journal Entry)", "label": "Series for Asset Depreciation Entry (Journal Entry)"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "expenses_included_in_asset_valuation", "fieldname": "expenses_included_in_asset_valuation",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Expenses Included In Asset Valuation", "label": "Expenses Included In Asset Valuation",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_40", "fieldname": "column_break_40",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "disposal_account", "fieldname": "disposal_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Gain/Loss Account on Asset Disposal", "label": "Gain/Loss Account on Asset Disposal",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "depreciation_cost_center", "fieldname": "depreciation_cost_center",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Asset Depreciation Cost Center", "label": "Asset Depreciation Cost Center",
"no_copy": 1, "no_copy": 1,
"options": "Cost Center", "options": "Cost Center"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "capital_work_in_progress_account", "fieldname": "capital_work_in_progress_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Capital Work In Progress Account", "label": "Capital Work In Progress Account",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "asset_received_but_not_billed", "fieldname": "asset_received_but_not_billed",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Asset Received But Not Billed", "label": "Asset Received But Not Billed",
"options": "Account", "options": "Account"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"collapsible": 1, "collapsible": 1,
"fieldname": "budget_detail", "fieldname": "budget_detail",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Budget Detail", "label": "Budget Detail"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "exception_budget_approver_role", "fieldname": "exception_budget_approver_role",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Exception Budget Approver Role", "label": "Exception Budget Approver Role",
"options": "Role", "options": "Role"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"collapsible": 1, "collapsible": 1,
"description": "For reference only.", "description": "For reference only.",
"fieldname": "company_info", "fieldname": "company_info",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Company Info", "label": "Company Info"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "date_of_incorporation", "fieldname": "date_of_incorporation",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Date of Incorporation", "label": "Date of Incorporation"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "address_html", "fieldname": "address_html",
"fieldtype": "HTML", "fieldtype": "HTML"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break1", "fieldname": "column_break1",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"oldfieldtype": "Column Break", "oldfieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
"width": "50%" "width": "50%"
}, },
{ {
"depends_on": "eval:doc.date_of_incorporation", "depends_on": "eval:doc.date_of_incorporation",
"fieldname": "date_of_commencement", "fieldname": "date_of_commencement",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Date of Commencement", "label": "Date of Commencement"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "phone_no", "fieldname": "phone_no",
@ -803,9 +644,7 @@
"label": "Phone No", "label": "Phone No",
"oldfieldname": "phone_no", "oldfieldname": "phone_no",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Phone", "options": "Phone"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "fax", "fieldname": "fax",
@ -813,9 +652,7 @@
"label": "Fax", "label": "Fax",
"oldfieldname": "fax", "oldfieldname": "fax",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Phone", "options": "Phone"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "email", "fieldname": "email",
@ -823,25 +660,19 @@
"label": "Email", "label": "Email",
"oldfieldname": "email", "oldfieldname": "email",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Email", "options": "Email"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "website", "fieldname": "website",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Website", "label": "Website",
"oldfieldname": "website", "oldfieldname": "website",
"oldfieldtype": "Data", "oldfieldtype": "Data"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "registration_info", "fieldname": "registration_info",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"oldfieldtype": "Section Break", "oldfieldtype": "Section Break",
"show_days": 1,
"show_seconds": 1,
"width": "50%" "width": "50%"
}, },
{ {
@ -850,16 +681,12 @@
"fieldtype": "Code", "fieldtype": "Code",
"label": "Registration Details", "label": "Registration Details",
"oldfieldname": "registration_details", "oldfieldname": "registration_details",
"oldfieldtype": "Code", "oldfieldtype": "Code"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "delete_company_transactions", "fieldname": "delete_company_transactions",
"fieldtype": "Button", "fieldtype": "Button",
"label": "Delete Company Transactions", "label": "Delete Company Transactions"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "lft", "fieldname": "lft",
@ -868,9 +695,7 @@
"label": "Lft", "label": "Lft",
"print_hide": 1, "print_hide": 1,
"read_only": 1, "read_only": 1,
"search_index": 1, "search_index": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "rgt", "fieldname": "rgt",
@ -879,9 +704,7 @@
"label": "Rgt", "label": "Rgt",
"print_hide": 1, "print_hide": 1,
"read_only": 1, "read_only": 1,
"search_index": 1, "search_index": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "old_parent", "fieldname": "old_parent",
@ -889,25 +712,19 @@
"hidden": 1, "hidden": 1,
"label": "old_parent", "label": "old_parent",
"print_hide": 1, "print_hide": 1,
"read_only": 1, "read_only": 1
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_selling_terms", "fieldname": "default_selling_terms",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Selling Terms", "label": "Default Selling Terms",
"options": "Terms and Conditions", "options": "Terms and Conditions"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_buying_terms", "fieldname": "default_buying_terms",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Buying Terms", "label": "Default Buying Terms",
"options": "Terms and Conditions", "options": "Terms and Conditions"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "service_received_but_not_billed", "fieldname": "service_received_but_not_billed",
@ -915,9 +732,13 @@
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"label": "Service Received But Not Billed", "label": "Service Received But Not Billed",
"no_copy": 1, "no_copy": 1,
"options": "Account", "options": "Account"
"show_days": 1, },
"show_seconds": 1 {
"default": "0",
"fieldname": "enable_perpetual_inventory_for_non_stock_items",
"fieldtype": "Check",
"label": "Enable Perpetual Inventory For Non Stock Items"
} }
], ],
"icon": "fa fa-building", "icon": "fa fa-building",
@ -925,7 +746,7 @@
"image_field": "company_logo", "image_field": "company_logo",
"is_tree": 1, "is_tree": 1,
"links": [], "links": [],
"modified": "2020-06-11 15:32:59.147735", "modified": "2020-06-20 11:38:43.178970",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Company", "name": "Company",

View File

@ -212,7 +212,7 @@ class PurchaseReceipt(BuyingController):
landed_cost_entries = get_item_account_wise_additional_cost(self.name) landed_cost_entries = get_item_account_wise_additional_cost(self.name)
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation") expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
service_received_but_not_billed_account = self.get_company_default("service_received_but_not_billed") service_received_but_not_billed_account = self.get_company_default("service_received_but_not_billed")
auto_accounting_for_non_stock_items = cint(frappe.db.get_single_value('Stock Settings', 'enable_perpetual_inventory_for_non_stock_items')) auto_accounting_for_non_stock_items = cint(frappe.db.get_value('Company', self.company, 'enable_perpetual_inventory_for_non_stock_items'))
gl_entries = [] gl_entries = []
warehouse_with_no_account = [] warehouse_with_no_account = []

View File

@ -16,7 +16,6 @@
"action_if_quality_inspection_is_not_submitted", "action_if_quality_inspection_is_not_submitted",
"show_barcode_field", "show_barcode_field",
"clean_description_html", "clean_description_html",
"enable_perpetual_inventory_for_non_stock_items",
"section_break_7", "section_break_7",
"auto_insert_price_list_rate_if_missing", "auto_insert_price_list_rate_if_missing",
"allow_negative_stock", "allow_negative_stock",
@ -44,248 +43,180 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Item Naming By", "label": "Item Naming By",
"options": "Item Code\nNaming Series", "options": "Item Code\nNaming Series"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "item_group", "fieldname": "item_group",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Default Item Group", "label": "Default Item Group",
"options": "Item Group", "options": "Item Group"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_uom", "fieldname": "stock_uom",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Default Stock UOM", "label": "Default Stock UOM",
"options": "UOM", "options": "UOM"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "default_warehouse", "fieldname": "default_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Default Warehouse", "label": "Default Warehouse",
"options": "Warehouse", "options": "Warehouse"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "sample_retention_warehouse", "fieldname": "sample_retention_warehouse",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Sample Retention Warehouse", "label": "Sample Retention Warehouse",
"options": "Warehouse", "options": "Warehouse"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_4", "fieldname": "column_break_4",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "valuation_method", "fieldname": "valuation_method",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Default Valuation Method", "label": "Default Valuation Method",
"options": "FIFO\nMoving Average", "options": "FIFO\nMoving Average"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.", "description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.",
"fieldname": "over_delivery_receipt_allowance", "fieldname": "over_delivery_receipt_allowance",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Over Delivery/Receipt Allowance (%)", "label": "Over Delivery/Receipt Allowance (%)"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "Stop", "default": "Stop",
"fieldname": "action_if_quality_inspection_is_not_submitted", "fieldname": "action_if_quality_inspection_is_not_submitted",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Action if Quality inspection is not submitted", "label": "Action if Quality inspection is not submitted",
"options": "Stop\nWarn", "options": "Stop\nWarn"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "1", "default": "1",
"fieldname": "show_barcode_field", "fieldname": "show_barcode_field",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Show Barcode Field", "label": "Show Barcode Field"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "1", "default": "1",
"fieldname": "clean_description_html", "fieldname": "clean_description_html",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Convert Item Description to Clean HTML", "label": "Convert Item Description to Clean HTML"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "section_break_7", "fieldname": "section_break_7",
"fieldtype": "Section Break", "fieldtype": "Section Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "auto_insert_price_list_rate_if_missing", "fieldname": "auto_insert_price_list_rate_if_missing",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Auto insert Price List rate if missing", "label": "Auto insert Price List rate if missing"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "allow_negative_stock", "fieldname": "allow_negative_stock",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Negative Stock", "label": "Allow Negative Stock"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "column_break_10", "fieldname": "column_break_10",
"fieldtype": "Column Break", "fieldtype": "Column Break"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "1", "default": "1",
"fieldname": "automatically_set_serial_nos_based_on_fifo", "fieldname": "automatically_set_serial_nos_based_on_fifo",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Automatically Set Serial Nos based on FIFO", "label": "Automatically Set Serial Nos based on FIFO"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "1", "default": "1",
"fieldname": "set_qty_in_transactions_based_on_serial_no_input", "fieldname": "set_qty_in_transactions_based_on_serial_no_input",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Set Qty in Transactions based on Serial No Input", "label": "Set Qty in Transactions based on Serial No Input"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "auto_material_request", "fieldname": "auto_material_request",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Auto Material Request", "label": "Auto Material Request"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "auto_indent", "fieldname": "auto_indent",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Raise Material Request when stock reaches re-order level", "label": "Raise Material Request when stock reaches re-order level"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "reorder_email_notify", "fieldname": "reorder_email_notify",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Notify by Email on creation of automatic Material Request", "label": "Notify by Email on creation of automatic Material Request"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "freeze_stock_entries", "fieldname": "freeze_stock_entries",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Freeze Stock Entries", "label": "Freeze Stock Entries"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_frozen_upto", "fieldname": "stock_frozen_upto",
"fieldtype": "Date", "fieldtype": "Date",
"label": "Stock Frozen Upto", "label": "Stock Frozen Upto"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_frozen_upto_days", "fieldname": "stock_frozen_upto_days",
"fieldtype": "Int", "fieldtype": "Int",
"label": "Freeze Stocks Older Than [Days]", "label": "Freeze Stocks Older Than [Days]"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "stock_auth_role", "fieldname": "stock_auth_role",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Role Allowed to edit frozen stock", "label": "Role Allowed to edit frozen stock",
"options": "Role", "options": "Role"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "batch_id_sb", "fieldname": "batch_id_sb",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Batch Identification", "label": "Batch Identification"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "use_naming_series", "fieldname": "use_naming_series",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Use Naming Series", "label": "Use Naming Series"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "BATCH-", "default": "BATCH-",
"depends_on": "eval:doc.use_naming_series==1", "depends_on": "eval:doc.use_naming_series==1",
"fieldname": "naming_series_prefix", "fieldname": "naming_series_prefix",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Naming Series Prefix", "label": "Naming Series Prefix"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"fieldname": "inter_warehouse_transfer_settings_section", "fieldname": "inter_warehouse_transfer_settings_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Inter Warehouse Transfer Settings", "label": "Inter Warehouse Transfer Settings"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "allow_from_dn", "fieldname": "allow_from_dn",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Material Transfer From Delivery Note and Sales Invoice", "label": "Allow Material Transfer From Delivery Note and Sales Invoice"
"show_days": 1,
"show_seconds": 1
}, },
{ {
"default": "0", "default": "0",
"fieldname": "allow_from_pr", "fieldname": "allow_from_pr",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Material Transfer From Purchase Receipt and Purchase Invoice", "label": "Allow Material Transfer From Purchase Receipt and Purchase Invoice"
"show_days": 1,
"show_seconds": 1
},
{
"default": "0",
"fieldname": "enable_perpetual_inventory_for_non_stock_items",
"fieldtype": "Check",
"label": "Enable Perpetual Inventory For Non Stock Items",
"show_days": 1,
"show_seconds": 1
} }
], ],
"icon": "icon-cog", "icon": "icon-cog",
"idx": 1, "idx": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2020-06-11 15:10:41.211638", "modified": "2020-06-20 11:39:15.344112",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Stock Settings", "name": "Stock Settings",