[FIX] sale_purchase: show purchase description in RfQ autogeneration
1. Install [Manufacturing], [Sales], [Purchase] on Apps (ordered) 2. [Settings]>[Manufacturing]>[Subcontracting]: set 3. [Sales] - [CREATE] product type [Service] - On the tab 'Purchase' add a vendor, select [Subcontract Service] - On the same tab add `Purchase description` then save - [Orders]>[Quotations] - CREATE, add the subcontract service product and set customer - CONFIRM 4. [Purchase] - [Requests for Quotation] - should show on the top of the list if vendor was new. click - [Description] column does not show `Purchase description` Desired: show relevant data Impacted versions: 15 - master opw-3152072 closes odoo/odoo#113407 X-original-commit: fa33657e5e134a9f412a17da4082467ec847e395 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
This commit is contained in:
@@ -177,8 +177,13 @@ class SaleOrderLine(models.Model):
|
||||
else:
|
||||
product_ctx.update({'partner_id': purchase_order.partner_id.id})
|
||||
|
||||
product = self.product_id.with_context(**product_ctx)
|
||||
name = product.display_name
|
||||
if product.description_purchase:
|
||||
name += '\n' + product.description_purchase
|
||||
|
||||
return {
|
||||
'name': self.product_id.with_context(**product_ctx).display_name,
|
||||
'name': name,
|
||||
'product_qty': purchase_qty_uom,
|
||||
'product_id': self.product_id.id,
|
||||
'product_uom': self.product_id.uom_po_id.id,
|
||||
|
||||
@@ -227,6 +227,9 @@ class TestSalePurchase(TestCommonSalePurchaseNoChart):
|
||||
self.assertEqual(purchase_line2.product_qty, delta, "The quantity of the new PO line is the quantity added on the Sale Line, after first PO confirmation")
|
||||
|
||||
def test_pol_description(self):
|
||||
"""
|
||||
test cases when product names are different from how the vendor refers to, which is allowed
|
||||
"""
|
||||
service = self.env['product.product'].create({
|
||||
'name': 'Super Product',
|
||||
'type': 'service',
|
||||
|
||||
Reference in New Issue
Block a user