Skip to content

Commit

Permalink
[16.0][IMP] ddmrp: add RFQ total qty
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPForgeFlow committed Nov 18, 2024
1 parent b747a1b commit 2a3f8e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ddmrp/models/stock_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,11 @@ def _compute_product_vendor_code(self):
help="Request for Quotation total quantity that is planned inside of "
"the DLT horizon.",
)
rfq_total_qty = fields.Float(
string="RFQ Total Qty",
readonly=True,
help="Request for Quotation total quantity that is planned",
)
net_flow_position = fields.Float(
digits="Product Unit of Measure",
readonly=True,
Expand Down Expand Up @@ -1682,9 +1687,11 @@ def _calc_incoming_dlt_qty(self):
rec.rfq_outside_dlt_qty = sum(pols_outside_dlt.mapped("product_qty"))
pols_inside_dlt = rec._get_rfq_dlt(dlt_interval="inside")
rec.rfq_inside_dlt_qty = sum(pols_inside_dlt.mapped("product_qty"))
rec.rfq_total_qty = rec.rfq_inside_dlt_qty + rec.rfq_outside_dlt_qty
else:
rec.rfq_outside_dlt_qty = 0.0
rec.rfq_inside_dlt_qty = 0.0
rec.rfq_total_qty = 0.0
rec.incoming_total_qty = rec.incoming_dlt_qty + rec.incoming_outside_dlt_qty
return True

Expand Down
1 change: 1 addition & 0 deletions ddmrp/views/stock_buffer_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
type="object"
attrs="{'invisible':[('incoming_outside_dlt_qty', '=', 0)]}"
/>
<field name="rfq_total_qty" optional="hide" />
<field name="rfq_outside_dlt_qty" invisible="1" />
<button
title="Some RFQ quantities are outside of the DLT Horizon and may require rescheduling.
Expand Down

0 comments on commit 2a3f8e3

Please sign in to comment.