mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-23 03:10:04 +00:00
Merge branch 'develop' into e-commerce-refactor-develop
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:company_name",
|
||||
"creation": "2013-04-10 08:35:39",
|
||||
"creation": "2022-01-25 10:29:55.938239",
|
||||
"description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Setup",
|
||||
@@ -77,13 +77,13 @@
|
||||
"default_finance_book",
|
||||
"auto_accounting_for_stock_settings",
|
||||
"enable_perpetual_inventory",
|
||||
"enable_perpetual_inventory_for_non_stock_items",
|
||||
"enable_provisional_accounting_for_non_stock_items",
|
||||
"default_inventory_account",
|
||||
"stock_adjustment_account",
|
||||
"default_in_transit_warehouse",
|
||||
"column_break_32",
|
||||
"stock_received_but_not_billed",
|
||||
"service_received_but_not_billed",
|
||||
"default_provisional_account",
|
||||
"expenses_included_in_valuation",
|
||||
"fixed_asset_defaults",
|
||||
"accumulated_depreciation_account",
|
||||
@@ -684,20 +684,6 @@
|
||||
"label": "Default Buying Terms",
|
||||
"options": "Terms and Conditions"
|
||||
},
|
||||
{
|
||||
"fieldname": "service_received_but_not_billed",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Service Received But Not Billed",
|
||||
"no_copy": 1,
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enable_perpetual_inventory_for_non_stock_items",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Perpetual Inventory For Non Stock Items"
|
||||
},
|
||||
{
|
||||
"fieldname": "default_in_transit_warehouse",
|
||||
"fieldtype": "Link",
|
||||
@@ -741,6 +727,20 @@
|
||||
"fieldname": "section_break_28",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Chart of Accounts"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enable_provisional_accounting_for_non_stock_items",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable Provisional Accounting For Non Stock Items"
|
||||
},
|
||||
{
|
||||
"fieldname": "default_provisional_account",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Default Provisional Account",
|
||||
"no_copy": 1,
|
||||
"options": "Account"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-building",
|
||||
@@ -748,7 +748,7 @@
|
||||
"image_field": "company_logo",
|
||||
"is_tree": 1,
|
||||
"links": [],
|
||||
"modified": "2021-10-04 12:09:25.833133",
|
||||
"modified": "2022-01-25 10:33:16.826067",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Company",
|
||||
@@ -809,5 +809,6 @@
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import frappe.defaults
|
||||
from frappe import _
|
||||
from frappe.cache_manager import clear_defaults_cache
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
from frappe.utils import cint, formatdate, get_timestamp, today
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
|
||||
@@ -45,7 +46,7 @@ class Company(NestedSet):
|
||||
self.validate_currency()
|
||||
self.validate_coa_input()
|
||||
self.validate_perpetual_inventory()
|
||||
self.validate_perpetual_inventory_for_non_stock_items()
|
||||
self.validate_provisional_account_for_non_stock_items()
|
||||
self.check_country_change()
|
||||
self.check_parent_changed()
|
||||
self.set_chart_of_accounts()
|
||||
@@ -187,11 +188,14 @@ class Company(NestedSet):
|
||||
frappe.msgprint(_("Set default inventory account for perpetual inventory"),
|
||||
alert=True, indicator='orange')
|
||||
|
||||
def validate_perpetual_inventory_for_non_stock_items(self):
|
||||
def validate_provisional_account_for_non_stock_items(self):
|
||||
if not self.get("__islocal"):
|
||||
if cint(self.enable_perpetual_inventory_for_non_stock_items) == 1 and not self.service_received_but_not_billed:
|
||||
frappe.throw(_("Set default {0} account for perpetual inventory for non stock items").format(
|
||||
frappe.bold('Service Received But Not Billed')))
|
||||
if cint(self.enable_provisional_accounting_for_non_stock_items) == 1 and not self.default_provisional_account:
|
||||
frappe.throw(_("Set default {0} account for non stock items").format(
|
||||
frappe.bold('Provisional Account')))
|
||||
|
||||
make_property_setter("Purchase Receipt", "provisional_expense_account", "hidden",
|
||||
not self.enable_provisional_accounting_for_non_stock_items, "Check", validate_fields_for_doctype=False)
|
||||
|
||||
def check_country_change(self):
|
||||
frappe.flags.country_change = False
|
||||
|
||||
Reference in New Issue
Block a user