Skip to content

Commit

Permalink
[Karthi] | BAH-3549 | Refactor. Menu align has been updated (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyansp91 authored Mar 13, 2024
1 parent dabead7 commit 3ea9efd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bahmni_reports/report/product_reorder_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
class ProductReorderList(models.Model):
_name = 'product.reorder.list'
_order = 'date desc'


name = fields.Char(string="Report Name" , default='Product Reorder List')
date = fields.Date('As On Date',required=True,default=lambda * a: time.strftime('%Y-%m-%d'))
status = fields.Selection([('all','All'),('available','Stock Available'),('reorder','Order To Be Placed'),('nil','No Min Stock & Reorder Rule')],'Status',default="all")
product_id = fields.Many2many('product.product','pro_reorder_reports','reports_id','product_id','Drugs Name',domain=[('active', '=', True),('type','=','product')])
Expand Down Expand Up @@ -103,7 +104,7 @@ def get_xlsx_report(self, data, response):
product_min_qty = reorder_data.product_min_qty
qty_to_order = reorder_data.qty_to_order
supplier_name = reorder_data.supplier_id.partner_id.name if reorder_data.supplier_id else '-'
if reorder_data.qty_on_hand > reorder_data.product_min_qty:
if reorder_data.qty_on_hand >= reorder_data.product_min_qty:
status = 'Stock Available'
elif reorder_data.qty_on_hand < reorder_data.product_min_qty:
status = 'Order To Be Placed'
Expand Down
2 changes: 1 addition & 1 deletion bahmni_reports/report/product_reorder_list_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
<field name="view_mode">form</field>
</record>

<menuitem id="menu_product_reorder_new" name="Product Reorder List" parent="bahmni_reports.menu_stock_report_masters" action="action_product_reorder_report_new" sequence="4"/>
<menuitem id="menu_product_reorder_new" name="Product Reorder List" parent="bahmni_reports.menu_purchase_config" action="action_product_reorder_report_new" sequence="1"/>

</odoo>
36 changes: 35 additions & 1 deletion bahmni_reports/report/reports_menu_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,41 @@
<menuitem id="stock_report_menu_root" name="Reports" web_icon="crm,static/description/icon.svg" sequence="31"/>

<menuitem id="menu_stock_report_masters" name="Custom Reports" parent="bahmni_reports.stock_report_menu_root" sequence="1"/>


<menuitem
id="menu_stock_config"
name="Stock Reports"
parent="bahmni_reports.menu_stock_report_masters"
sequence="1"
/>

<menuitem
id="menu_expiry_config"
name="Expiry Reports"
parent="bahmni_reports.menu_stock_report_masters"
sequence="2"
/>

<menuitem
id="menu_purchase_config"
name="Purchase Reports"
parent="bahmni_reports.menu_stock_report_masters"
sequence="3"
/>

<menuitem
id="menu_sale_config"
name="Sale Reports"
parent="bahmni_reports.menu_stock_report_masters"
sequence="4"
/>

<menuitem
id="menu_purchase_return_config"
name="Product Return Reports"
parent="bahmni_reports.menu_stock_report_masters"
sequence="5"
/>



Expand Down

0 comments on commit 3ea9efd

Please sign in to comment.