summaryrefslogtreecommitdiff
path: root/addons/purchase_stock/tests
diff options
context:
space:
mode:
authorNicolas Galler <ngl@odoo.com>2020-12-29 16:06:02 +0000
committerNicolas Galler <ngl@odoo.com>2020-12-29 16:43:11 +0000
commit5db67fb2931517ae94fe0396ef80e9ad997e59cd (patch)
tree1441e47045dd13c5f96f24351ae2e9e9b38d50f0 /addons/purchase_stock/tests
parent58bd6a51041d1c0c011810823caf540995428c2a (diff)
[FIX] purchase_stock: do not include internal notes in generated PO
Behavior prior to this commit: When a PO is generated (via reordering rule, mto rule, or manual replenish), the description on the PO line includes the internal notes. Behavior after this commit: The description on the PO line does not include the internal notes. opw-24222438 closes odoo/odoo#63892 Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
Diffstat (limited to 'addons/purchase_stock/tests')
-rw-r--r--addons/purchase_stock/tests/test_purchase_lead_time.py10
-rw-r--r--addons/purchase_stock/tests/test_reordering_rule.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/addons/purchase_stock/tests/test_purchase_lead_time.py b/addons/purchase_stock/tests/test_purchase_lead_time.py
index 01b936ef179..5bda4425fea 100644
--- a/addons/purchase_stock/tests/test_purchase_lead_time.py
+++ b/addons/purchase_stock/tests/test_purchase_lead_time.py
@@ -244,7 +244,7 @@ class TestPurchaseLeadTime(PurchaseTestCommon):
purchase_order = self.env['purchase.order.line'].search([('product_id', '=', self.t_shirt.id)], limit=1).order_id
order_line_description = purchase_order.order_line.product_id._get_description(purchase_order.picking_type_id)
self.assertEqual(len(purchase_order.order_line), 1, 'wrong number of order line is created')
- self.assertEqual(purchase_order.order_line.name, t_shirt.display_name + "\n" + order_line_description + "Color (Red)", 'wrong description in po lines')
+ self.assertEqual(purchase_order.order_line.name, t_shirt.display_name + "\n" + "Color (Red)", 'wrong description in po lines')
procurement_values['product_description_variants'] = 'Color (Red)'
order_2_values = procurement_values
@@ -264,12 +264,12 @@ class TestPurchaseLeadTime(PurchaseTestCommon):
self.t_shirt.name, '/', self.env.company, order_3_values)
])
self.assertEqual(len(purchase_order.order_line), 2, 'line with different custom value should not be merged')
- self.assertEqual(purchase_order.order_line.filtered(lambda x: x.product_qty == 15).name, t_shirt.display_name + "\n" + order_line_description + "Color (Red)", 'wrong description in po lines')
- self.assertEqual(purchase_order.order_line.filtered(lambda x: x.product_qty == 10).name, t_shirt.display_name + "\n" + order_line_description + "Color (Green)", 'wrong description in po lines')
+ self.assertEqual(purchase_order.order_line.filtered(lambda x: x.product_qty == 15).name, t_shirt.display_name + "\n" + "Color (Red)", 'wrong description in po lines')
+ self.assertEqual(purchase_order.order_line.filtered(lambda x: x.product_qty == 10).name, t_shirt.display_name + "\n" + "Color (Green)", 'wrong description in po lines')
purchase_order.button_confirm()
- self.assertEqual(purchase_order.picking_ids[0].move_ids_without_package.filtered(lambda x: x.product_uom_qty == 15).description_picking, order_line_description + "Color (Red)", 'wrong description in picking')
- self.assertEqual(purchase_order.picking_ids[0].move_ids_without_package.filtered(lambda x: x.product_uom_qty == 10).description_picking, order_line_description + "Color (Green)", 'wrong description in picking')
+ self.assertEqual(purchase_order.picking_ids[0].move_ids_without_package.filtered(lambda x: x.product_uom_qty == 15).description_picking, order_line_description + "\nColor (Red)", 'wrong description in picking')
+ self.assertEqual(purchase_order.picking_ids[0].move_ids_without_package.filtered(lambda x: x.product_uom_qty == 10).description_picking, order_line_description + "\nColor (Green)", 'wrong description in picking')
def test_reordering_days_to_purchase(self):
company = self.env.ref('base.main_company')
diff --git a/addons/purchase_stock/tests/test_reordering_rule.py b/addons/purchase_stock/tests/test_reordering_rule.py
index 74406ea8deb..bcb2f48a553 100644
--- a/addons/purchase_stock/tests/test_reordering_rule.py
+++ b/addons/purchase_stock/tests/test_reordering_rule.py
@@ -21,6 +21,7 @@ class TestReorderingRule(SavepointCase):
product_form = Form(cls.env['product.product'])
product_form.name = 'Product A'
product_form.type = 'product'
+ product_form.description = 'Internal Notes'
with product_form.seller_ids.new() as seller:
seller.name = cls.partner
product_form.route_ids.add(cls.env.ref('purchase_stock.route_warehouse0_buy'))
@@ -66,6 +67,7 @@ class TestReorderingRule(SavepointCase):
# On the po generated, the source document should be the name of the reordering rule
self.assertEqual(order_point.name, purchase_order.origin, 'Source document on purchase order should be the name of the reordering rule.')
self.assertEqual(purchase_order.order_line.product_qty, 10)
+ self.assertEqual(purchase_order.order_line.name, 'Product A')
# Increase the quantity on the RFQ before confirming it
purchase_order.order_line.product_qty = 12