Merge pull request #23805 from pateljannat/production-planning-status-filter
feat: sales order status filter added for production plan
This commit is contained in:
commit
2baf45496a
@ -19,6 +19,7 @@
|
|||||||
"column_break2",
|
"column_break2",
|
||||||
"from_date",
|
"from_date",
|
||||||
"to_date",
|
"to_date",
|
||||||
|
"sales_order_status",
|
||||||
"sales_orders_detail",
|
"sales_orders_detail",
|
||||||
"get_sales_orders",
|
"get_sales_orders",
|
||||||
"sales_orders",
|
"sales_orders",
|
||||||
@ -301,13 +302,20 @@
|
|||||||
"label": "Warehouses",
|
"label": "Warehouses",
|
||||||
"options": "Production Plan Material Request Warehouse",
|
"options": "Production Plan Material Request Warehouse",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval: doc.get_items_from == \"Sales Order\"",
|
||||||
|
"fieldname": "sales_order_status",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Sales Order Status",
|
||||||
|
"options": "\nTo Deliver and Bill\nTo Bill\nTo Deliver"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-calendar",
|
"icon": "fa fa-calendar",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-10-26 13:00:54.335319",
|
"modified": "2020-11-10 18:01:54.991970",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Production Plan",
|
"name": "Production Plan",
|
||||||
|
@ -571,6 +571,8 @@ def get_sales_orders(self):
|
|||||||
so_filter += " and so.customer = %(customer)s"
|
so_filter += " and so.customer = %(customer)s"
|
||||||
if self.project:
|
if self.project:
|
||||||
so_filter += " and so.project = %(project)s"
|
so_filter += " and so.project = %(project)s"
|
||||||
|
if self.sales_order_status:
|
||||||
|
so_filter += "and so.status = %(sales_order_status)s"
|
||||||
|
|
||||||
if self.item_code:
|
if self.item_code:
|
||||||
item_filter += " and so_item.item_code = %(item)s"
|
item_filter += " and so_item.item_code = %(item)s"
|
||||||
@ -594,8 +596,8 @@ def get_sales_orders(self):
|
|||||||
"customer": self.customer,
|
"customer": self.customer,
|
||||||
"project": self.project,
|
"project": self.project,
|
||||||
"item": self.item_code,
|
"item": self.item_code,
|
||||||
"company": self.company
|
"company": self.company,
|
||||||
|
"sales_order_status": self.sales_order_status
|
||||||
}, as_dict=1)
|
}, as_dict=1)
|
||||||
return open_so
|
return open_so
|
||||||
|
|
||||||
|
@ -137,7 +137,8 @@ class TestProductionPlan(unittest.TestCase):
|
|||||||
'from_date': so.transaction_date,
|
'from_date': so.transaction_date,
|
||||||
'to_date': so.transaction_date,
|
'to_date': so.transaction_date,
|
||||||
'customer': so.customer,
|
'customer': so.customer,
|
||||||
'item_code': item
|
'item_code': item,
|
||||||
|
'sales_order_status': so.status
|
||||||
})
|
})
|
||||||
sales_orders = get_sales_orders(pln) or {}
|
sales_orders = get_sales_orders(pln) or {}
|
||||||
sales_orders = [d.get('name') for d in sales_orders if d.get('name') == sales_order]
|
sales_orders = [d.get('name') for d in sales_orders if d.get('name') == sales_order]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user