[ADD] Patches purchase_requisition to match variant name
This commit is contained in:
parent
52dc0ef51e
commit
cc81425f79
@ -31,6 +31,14 @@ pt_core ()
|
|||||||
OPTIONS="--directory=$DEST --strip=1"
|
OPTIONS="--directory=$DEST --strip=1"
|
||||||
|
|
||||||
patch $OPTIONS < patches/20210603_auth-oauth_redirect-to-root.patch
|
patch $OPTIONS < patches/20210603_auth-oauth_redirect-to-root.patch
|
||||||
|
|
||||||
|
SRC=$PWD
|
||||||
|
DEST=$DESTDIR/core/
|
||||||
|
OPTIONS="-p1 --verbose"
|
||||||
|
|
||||||
|
pushd $DEST
|
||||||
|
git apply $OPTIONS $SRC/patches/20220131_purchase-requisition_match-variant.patch
|
||||||
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
pt_vendor ()
|
pt_vendor ()
|
||||||
|
|||||||
16
patches/20220131_purchase-requisition_match-variant.patch
Normal file
16
patches/20220131_purchase-requisition_match-variant.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py
|
||||||
|
index c412d9f0..5c32c4a3 100644
|
||||||
|
--- a/addons/purchase_requisition/models/purchase_requisition.py
|
||||||
|
+++ b/addons/purchase_requisition/models/purchase_requisition.py
|
||||||
|
@@ -229,7 +229,9 @@ class PurchaseRequisitionLine(models.Model):
|
||||||
|
total = 0.0
|
||||||
|
for po in line.requisition_id.purchase_ids.filtered(lambda purchase_order: purchase_order.state in ['purchase', 'done']):
|
||||||
|
for po_line in po.order_line.filtered(lambda order_line: order_line.product_id == line.product_id):
|
||||||
|
- if po_line.product_uom != line.product_uom_id:
|
||||||
|
+ if line.product_description_variants != po_line.name:
|
||||||
|
+ continue
|
||||||
|
+ elif po_line.product_uom != line.product_uom_id:
|
||||||
|
total += po_line.product_uom._compute_quantity(po_line.product_qty, line.product_uom_id)
|
||||||
|
else:
|
||||||
|
total += po_line.product_qty
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user