Skip to content

Commit

Permalink
Fix:Fixed issues with smith assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakkiyathLulu committed Jun 6, 2024
1 parent 90358a9 commit bd20141
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def create_jewellery_job_card(self, stage_row_id):

if not jewellery_job_card_exists:
smith_email = frappe.db.get_value('Employee', stage.smith, 'user_id')
print("smith_email", smith_email)
new_jewellery_job_card = frappe.new_doc('Jewellery Job Card')
new_jewellery_job_card.manufacturing_request = self.name
new_jewellery_job_card.smith = stage.smith
Expand All @@ -144,10 +145,11 @@ def create_jewellery_job_card(self, stage_row_id):
frappe.db.set_value('Jewellery Job Card', self.manufacturing_request, 'product',self.product)
frappe.db.set_value(stage.doctype, stage.name, 'job_card_created', 1)
if smith_email:
print("first if")
add_assignment({
"doctype": "Jewellery Job Card",
"doctype": new_jewellery_job_card.doctype,
"name": new_jewellery_job_card.name,
"smith": [smith_email]
"assign_to": [smith_email]
})
frappe.msgprint("Jewellery Job Card Created.", indicator="green", alert=1)
else:
Expand Down

0 comments on commit bd20141

Please sign in to comment.