mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 01:43:10 +00:00
refactor: hook validate_allowed_companies instead of calling per master
Item, Customer and Supplier each imported and called it in their validate; register it once in doc_events instead.
This commit is contained in:
@@ -400,6 +400,9 @@ doc_events = {
|
||||
tuple(company_restricted_transaction_doctypes): {
|
||||
"validate": "erpnext.stock.doctype.company_restriction.company_restriction.validate_transaction_company",
|
||||
},
|
||||
("Item", "Customer", "Supplier"): {
|
||||
"validate": "erpnext.stock.doctype.company_restriction.company_restriction.validate_allowed_companies",
|
||||
},
|
||||
"Stock Entry": {
|
||||
"on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
|
||||
"on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
|
||||
|
||||
Reference in New Issue
Block a user