Skip to content

Commit

Permalink
fix: short close item not saving bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AshishBarvaliya committed Aug 20, 2024
1 parent eaf9e86 commit 6666534
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
2 changes: 2 additions & 0 deletions d2h/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def short_close_purchase_order(purchase_order):
if item.qty > item.received_qty:
item.custom_short_close_qty = item.qty - item.received_qty - item.custom_good_in_transit_qty

purchase_order.save(ignore_permissions=True)
return "OK"

def set_missing_values(source, target):
Expand Down Expand Up @@ -128,6 +129,7 @@ def short_close_sales_order(sales_order):
if item.qty > item.delivered_qty:
item.custom_short_close_qty = item.qty - item.delivered_qty

sales_order.save(ignore_permissions=True)
return "OK"

@frappe.whitelist()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@ def get_columns():
"width": 120,
"convertible": "qty",
},
{
"label": _("Pending Qty"),
"fieldname": "pending_qty",
"fieldtype": "Float",
"width": 100,
"convertible": "qty",
},
{
"label": _("Good In Transit Qty"),
"fieldname": "custom_good_in_transit_qty",
Expand All @@ -181,20 +174,6 @@ def get_columns():
"width": 140,
"convertible": "qty",
},
{
"label": _("Billed Qty"),
"fieldname": "billed_qty",
"fieldtype": "Float",
"width": 100,
"convertible": "qty",
},
{
"label": _("Qty to Bill"),
"fieldname": "qty_to_bill",
"fieldtype": "Float",
"width": 100,
"convertible": "qty",
},
{
"label": _("Amount"),
"fieldname": "amount",
Expand All @@ -219,14 +198,6 @@ def get_columns():
"options": "Company:company:default_currency",
"convertible": "rate",
},
{
"label": _("Received Qty Amount"),
"fieldname": "received_qty_amount",
"fieldtype": "Currency",
"width": 130,
"options": "Company:company:default_currency",
"convertible": "rate",
},
{
"label": _("Warehouse"),
"fieldname": "warehouse",
Expand Down

0 comments on commit 6666534

Please sign in to comment.