rpa-erpnext 1.0.6__py3-none-any.whl → 1.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- RPA/ERPNext.py +32 -8
- {rpa_erpnext-1.0.6.dist-info → rpa_erpnext-1.0.8.dist-info}/METADATA +1 -1
- rpa_erpnext-1.0.8.dist-info/RECORD +7 -0
- rpa_erpnext-1.0.6.dist-info/RECORD +0 -7
- {rpa_erpnext-1.0.6.dist-info → rpa_erpnext-1.0.8.dist-info}/WHEEL +0 -0
- {rpa_erpnext-1.0.6.dist-info → rpa_erpnext-1.0.8.dist-info}/licenses/LICENSE +0 -0
- {rpa_erpnext-1.0.6.dist-info → rpa_erpnext-1.0.8.dist-info}/top_level.txt +0 -0
RPA/ERPNext.py
CHANGED
|
@@ -661,12 +661,21 @@ class ERPNextLibrary:
|
|
|
661
661
|
if isinstance(mr_name, dict):
|
|
662
662
|
mr_name = mr_name.get("name")
|
|
663
663
|
|
|
664
|
+
# Normalize suppliers to list of strings
|
|
664
665
|
if isinstance(suppliers, str):
|
|
665
666
|
try:
|
|
666
667
|
suppliers = json.loads(suppliers)
|
|
667
668
|
except ValueError:
|
|
668
669
|
# Nếu không phải JSON list, coi như là 1 supplier duy nhất
|
|
669
670
|
suppliers = [suppliers]
|
|
671
|
+
|
|
672
|
+
# Ensure suppliers is a list
|
|
673
|
+
if not isinstance(suppliers, list):
|
|
674
|
+
suppliers = [suppliers]
|
|
675
|
+
|
|
676
|
+
# Flatten if nested list (e.g., [['Supplier A']] -> ['Supplier A'])
|
|
677
|
+
if suppliers and isinstance(suppliers[0], list):
|
|
678
|
+
suppliers = suppliers[0]
|
|
670
679
|
|
|
671
680
|
mr_doc = self.get_doc("Material Request", mr_name)
|
|
672
681
|
company = mr_doc["company"]
|
|
@@ -674,25 +683,40 @@ class ERPNextLibrary:
|
|
|
674
683
|
for s in suppliers:
|
|
675
684
|
self.ensure_supplier_exist(s)
|
|
676
685
|
|
|
686
|
+
|
|
677
687
|
items = []
|
|
678
688
|
for d in mr_doc["items"]:
|
|
689
|
+
# Ensure all fields are proper types (not lists)
|
|
690
|
+
item_code = d["item_code"]
|
|
691
|
+
if isinstance(item_code, list):
|
|
692
|
+
item_code = item_code[0] if item_code else ""
|
|
693
|
+
|
|
694
|
+
warehouse = d.get("warehouse", "")
|
|
695
|
+
if isinstance(warehouse, list):
|
|
696
|
+
warehouse = warehouse[0] if warehouse else ""
|
|
697
|
+
|
|
679
698
|
items.append({
|
|
680
|
-
"item_code":
|
|
681
|
-
"qty": d["qty"],
|
|
682
|
-
"uom": d.get("uom", "Nos"),
|
|
683
|
-
"stock_uom": d.get("stock_uom", "Nos"),
|
|
699
|
+
"item_code": str(item_code),
|
|
700
|
+
"qty": float(d["qty"]),
|
|
701
|
+
"uom": str(d.get("uom", "Nos")),
|
|
702
|
+
"stock_uom": str(d.get("stock_uom", "Nos")),
|
|
684
703
|
"conversion_factor": 1.0,
|
|
685
|
-
"warehouse":
|
|
704
|
+
"warehouse": str(warehouse),
|
|
686
705
|
})
|
|
687
706
|
|
|
688
707
|
rfq_data = {
|
|
689
708
|
"doctype": "Request for Quotation",
|
|
690
|
-
"company": company,
|
|
691
|
-
"transaction_date": mr_doc["schedule_date"],
|
|
692
|
-
"suppliers": [{"supplier": s} for s in suppliers],
|
|
709
|
+
"company": str(company),
|
|
710
|
+
"transaction_date": str(mr_doc["schedule_date"]),
|
|
711
|
+
"suppliers": [{"supplier": str(s)} for s in suppliers],
|
|
693
712
|
"items": items,
|
|
694
713
|
"message_for_supplier": "Xin vui lòng gửi báo giá."
|
|
695
714
|
}
|
|
715
|
+
|
|
716
|
+
# Debug logging
|
|
717
|
+
import logging
|
|
718
|
+
logging.info(f"RFQ Data: {rfq_data}")
|
|
719
|
+
|
|
696
720
|
return self.create_resource("Request for Quotation", rfq_data)
|
|
697
721
|
|
|
698
722
|
# ===========================================================
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
RPA/ERPNext.py,sha256=0Uxzdl2mh51dZ-WKJfJcYUQsAz9TmzEjAdFJC9RnI4E,29856
|
|
2
|
+
RPA/__init__.py,sha256=doHeY54VPWzBDnkSMGvGGSYfkpxt4dFXAV8YOi-Ebig,110
|
|
3
|
+
rpa_erpnext-1.0.8.dist-info/licenses/LICENSE,sha256=sexHbU6pNlqsmC_TQZJLdZ59qC_Bym7mQ0HrNeHHQ3Y,1063
|
|
4
|
+
rpa_erpnext-1.0.8.dist-info/METADATA,sha256=NQJ8PrfnCegYUHFheDLLwtwtIa8--vAV3KONuoL8VFI,800
|
|
5
|
+
rpa_erpnext-1.0.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
+
rpa_erpnext-1.0.8.dist-info/top_level.txt,sha256=s4yaEXbcdPUcIyAxSvrLKKIMD62cqoNPsOGmdx94U5k,4
|
|
7
|
+
rpa_erpnext-1.0.8.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
RPA/ERPNext.py,sha256=Lm3jSiU2RnGLhJw9rWtfIZmmkZgrEqHNXmwb-S7BZ0E,28973
|
|
2
|
-
RPA/__init__.py,sha256=doHeY54VPWzBDnkSMGvGGSYfkpxt4dFXAV8YOi-Ebig,110
|
|
3
|
-
rpa_erpnext-1.0.6.dist-info/licenses/LICENSE,sha256=sexHbU6pNlqsmC_TQZJLdZ59qC_Bym7mQ0HrNeHHQ3Y,1063
|
|
4
|
-
rpa_erpnext-1.0.6.dist-info/METADATA,sha256=Lgy_cDMyCzBLuMdlkPR_1zofCd6GOfY5rOj2fols0p8,800
|
|
5
|
-
rpa_erpnext-1.0.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
-
rpa_erpnext-1.0.6.dist-info/top_level.txt,sha256=s4yaEXbcdPUcIyAxSvrLKKIMD62cqoNPsOGmdx94U5k,4
|
|
7
|
-
rpa_erpnext-1.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|