mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 15:48:29 +00:00
fix: update received qty in MR on purchase invoice submit with update stock
(cherry picked from commit 13cb53fa89)
# Conflicts:
# erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
This commit is contained in:
@@ -683,6 +683,19 @@ class PurchaseInvoice(BuyingController):
|
|||||||
where name=`tabPurchase Invoice Item`.parent and update_stock = 1)""",
|
where name=`tabPurchase Invoice Item`.parent and update_stock = 1)""",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
self.status_updater.append(
|
||||||
|
{
|
||||||
|
"source_dt": "Purchase Invoice Item",
|
||||||
|
"target_dt": "Material Request Item",
|
||||||
|
"join_field": "material_request_item",
|
||||||
|
"target_field": "received_qty",
|
||||||
|
"target_parent_dt": "Material Request",
|
||||||
|
"target_parent_field": "per_received",
|
||||||
|
"target_ref_field": "stock_qty",
|
||||||
|
"source_field": "stock_qty",
|
||||||
|
"percent_join_field": "material_request",
|
||||||
|
}
|
||||||
|
)
|
||||||
if cint(self.is_return):
|
if cint(self.is_return):
|
||||||
self.status_updater.append(
|
self.status_updater.append(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,6 +105,8 @@
|
|||||||
"purchase_receipt",
|
"purchase_receipt",
|
||||||
"pr_detail",
|
"pr_detail",
|
||||||
"sales_invoice_item",
|
"sales_invoice_item",
|
||||||
|
"material_request",
|
||||||
|
"material_request_item",
|
||||||
"item_weight_details",
|
"item_weight_details",
|
||||||
"weight_per_unit",
|
"weight_per_unit",
|
||||||
"total_weight",
|
"total_weight",
|
||||||
@@ -934,12 +936,38 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "column_break_vbbb",
|
"fieldname": "column_break_vbbb",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "material_request",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Material Request",
|
||||||
|
"no_copy": 1,
|
||||||
|
"options": "Material Request",
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 1,
|
||||||
|
"search_index": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "material_request_item",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Material Request Item",
|
||||||
|
"no_copy": 1,
|
||||||
|
"oldfieldname": "pr_detail",
|
||||||
|
"oldfieldtype": "Data",
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 1,
|
||||||
|
"search_index": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2024-03-19 19:09:47.210965",
|
"modified": "2024-03-19 19:09:47.210965",
|
||||||
|
=======
|
||||||
|
"modified": "2024-06-14 11:57:07.171700",
|
||||||
|
>>>>>>> 13cb53fa89 (fix: update received qty in MR on purchase invoice submit with update stock)
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice Item",
|
"name": "Purchase Invoice Item",
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ class PurchaseInvoiceItem(Document):
|
|||||||
manufacturer_part_no: DF.Data | None
|
manufacturer_part_no: DF.Data | None
|
||||||
margin_rate_or_amount: DF.Float
|
margin_rate_or_amount: DF.Float
|
||||||
margin_type: DF.Literal["", "Percentage", "Amount"]
|
margin_type: DF.Literal["", "Percentage", "Amount"]
|
||||||
|
material_request: DF.Link | None
|
||||||
|
material_request_item: DF.Data | None
|
||||||
net_amount: DF.Currency
|
net_amount: DF.Currency
|
||||||
net_rate: DF.Currency
|
net_rate: DF.Currency
|
||||||
page_break: DF.Check
|
page_break: DF.Check
|
||||||
|
|||||||
@@ -794,6 +794,8 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
|
|||||||
"field_map": {
|
"field_map": {
|
||||||
"name": "po_detail",
|
"name": "po_detail",
|
||||||
"parent": "purchase_order",
|
"parent": "purchase_order",
|
||||||
|
"material_request": "material_request",
|
||||||
|
"material_request_item": "material_request_item",
|
||||||
"wip_composite_asset": "wip_composite_asset",
|
"wip_composite_asset": "wip_composite_asset",
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
|
|||||||
Reference in New Issue
Block a user