fix: customer group and territory not mandatory (#37050)

* fix: customer group and territory not mandatory

* fix: supplier group not required

* test: added test case for customer and supplier without group

* test: Customer without customer group and territory

* chore: remove unwanted changes

* test: Supplier without supplier group

* test: code cleanup

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
RitvikSardana
2023-10-09 20:21:25 +05:30
committed by GitHub
parent c9dfb909a5
commit 2c899dd13a
7 changed files with 55 additions and 21 deletions

View File

@@ -167,8 +167,7 @@
"label": "Supplier Group",
"oldfieldname": "supplier_type",
"oldfieldtype": "Link",
"options": "Supplier Group",
"reqd": 1
"options": "Supplier Group"
},
{
"default": "Company",
@@ -486,7 +485,7 @@
"link_fieldname": "party"
}
],
"modified": "2023-09-21 12:24:20.398889",
"modified": "2023-09-25 12:48:21.869563",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",

View File

@@ -207,11 +207,14 @@ def create_supplier(**args):
"doctype": "Supplier",
"supplier_name": args.supplier_name,
"default_currency": args.default_currency,
"supplier_group": args.supplier_group or "Services",
"supplier_type": args.supplier_type or "Company",
"tax_withholding_category": args.tax_withholding_category,
}
).insert()
)
if not args.without_supplier_group:
doc.supplier_group = args.supplier_group or "Services"
doc.insert()
return doc