Skip to content

Commit

Permalink
wip: version-15
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory committed May 13, 2024
1 parent f168079 commit ffb173d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions inventory_tools/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
from unittest.mock import MagicMock
import json

import frappe
import pytest
Expand Down Expand Up @@ -32,10 +33,11 @@ def db_instance():

currentsite = "test_site"
sites = Path(get_bench_path()) / "sites"
if (sites / "currentsite.txt").is_file():
currentsite = (sites / "currentsite.txt").read_text()
if (sites / "common_site_config.json").is_file():
currentsite = json.loads((sites / "common_site_config.json").read_text()).get("default_site")

frappe.init(site=currentsite, sites_path=sites)
frappe.connect()
frappe.db.commit = MagicMock()
yield frappe.db

12 changes: 6 additions & 6 deletions inventory_tools/tests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,12 @@ def create_production_plan(settings, prod_plan_from_doc):
wo.wip_warehouse = "Kitchen - APC"
wo.save()
wo.submit()
job_cards = frappe.get_all("Job Card", {"work_order": wo.name})
for job_card in job_cards:
job_card = frappe.get_doc("Job Card", job_card)
job_card.time_logs[0].completed_qty = wo.qty
job_card.save()
job_card.submit()
# job_cards = frappe.get_all("Job Card", {"work_order": wo.name})
# for job_card in job_cards:
# job_card = frappe.get_doc("Job Card", job_card)
# job_card.time_logs[0].completed_qty = wo.qty
# job_card.save()
# job_card.submit()


def create_fruit_material_request(settings):
Expand Down

0 comments on commit ffb173d

Please sign in to comment.