Merge pull request #23805 from pateljannat/production-planning-status-filter

feat: sales order status filter added for production plan
This commit is contained in:
Rucha Mahabal 2020-11-11 23:18:22 +05:30 committed by GitHub
commit 2baf45496a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -19,6 +19,7 @@
"column_break2",
"from_date",
"to_date",
"sales_order_status",
"sales_orders_detail",
"get_sales_orders",
"sales_orders",
@ -301,13 +302,20 @@
"label": "Warehouses",
"options": "Production Plan Material Request Warehouse",
"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",
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-10-26 13:00:54.335319",
"modified": "2020-11-10 18:01:54.991970",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Plan",

View File

@ -571,6 +571,8 @@ def get_sales_orders(self):
so_filter += " and so.customer = %(customer)s"
if self.project:
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:
item_filter += " and so_item.item_code = %(item)s"
@ -594,8 +596,8 @@ def get_sales_orders(self):
"customer": self.customer,
"project": self.project,
"item": self.item_code,
"company": self.company
"company": self.company,
"sales_order_status": self.sales_order_status
}, as_dict=1)
return open_so

View File

@ -137,7 +137,8 @@ class TestProductionPlan(unittest.TestCase):
'from_date': so.transaction_date,
'to_date': so.transaction_date,
'customer': so.customer,
'item_code': item
'item_code': item,
'sales_order_status': so.status
})
sales_orders = get_sales_orders(pln) or {}
sales_orders = [d.get('name') for d in sales_orders if d.get('name') == sales_order]