Revert "[IMP] sale,purchase,website: Harmonize the product name/description in reports and views"
This reverts commit cbc760acb8.
The reasons we put the product name and description is in the SO line:
- users want to be able to change the description in the printed quotation
- product is in user lang, description+product_name is in customer lang
That commit breaks what was a good behaviour
This commit is contained in:
@@ -85,7 +85,7 @@ class SaleOrder(models.Model):
|
||||
# Create the sale order line
|
||||
values = {
|
||||
'order_id': self.id,
|
||||
'name': carrier.description_sale or carrier.name,
|
||||
'name': carrier.name,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': carrier.product_id.uom_id.id,
|
||||
'product_id': carrier.product_id.id,
|
||||
|
||||
@@ -701,7 +701,9 @@ class PurchaseOrderLine(models.Model):
|
||||
'lang': self.partner_id.lang,
|
||||
'partner_id': self.partner_id.id,
|
||||
})
|
||||
self.name = product_lang.description_purchase or product_lang.display_name
|
||||
self.name = product_lang.display_name
|
||||
if product_lang.description_purchase:
|
||||
self.name += '\n' + product_lang.description_purchase
|
||||
|
||||
fpos = self.order_id.fiscal_position_id
|
||||
if self.env.uid == SUPERUSER_ID:
|
||||
|
||||
@@ -58,8 +58,7 @@
|
||||
<tbody>
|
||||
<tr t-foreach="o.order_line" t-as="line">
|
||||
<td>
|
||||
<span t-field="line.product_id"/><br/>
|
||||
<span t-if="line.name != line.product_id.display_name" t-field="line.name"/>
|
||||
<span t-field="line.name"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
<tbody>
|
||||
<tr t-foreach="o.order_line" t-as="order_line">
|
||||
<td>
|
||||
<span t-field="order_line.product_id"/><br/>
|
||||
<span t-if="order_line.name != order_line.product_id.display_name" t-field="order_line.name"/>
|
||||
<span t-field="order_line.name"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="order_line.date_planned"/>
|
||||
|
||||
@@ -848,7 +848,10 @@ class SaleOrderLine(models.Model):
|
||||
uom=self.product_uom.id
|
||||
)
|
||||
|
||||
vals['name'] = product.description_sale or product.name
|
||||
name = product.name_get()[0][1]
|
||||
if product.description_sale:
|
||||
name += '\n' + product.description_sale
|
||||
vals['name'] = name
|
||||
|
||||
self._compute_tax_id()
|
||||
|
||||
|
||||
@@ -81,10 +81,7 @@
|
||||
<!-- Lines associated -->
|
||||
<t t-foreach="layout_category['lines']" t-as="l">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="l.product_id"/><br/>
|
||||
<span t-if="l.name != l.product_id.name" t-field="l.name"/>
|
||||
</td>
|
||||
<td><span t-field="l.name"/></td>
|
||||
<td class="text-right">
|
||||
<span t-field="l.product_uom_qty"/>
|
||||
<span t-field="l.product_uom" groups="product.group_uom"/>
|
||||
|
||||
@@ -41,8 +41,7 @@
|
||||
<t t-foreach="layout_category['lines']" t-as="line">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="line.product_id"/><br/>
|
||||
<span t-if="line.name != line.product_id.name" t-field="line.name"/>
|
||||
<span t-field="line.name"/>
|
||||
</td>
|
||||
<td>
|
||||
<div id="quote_qty">
|
||||
|
||||
@@ -86,7 +86,7 @@ class SaleOrder(models.Model):
|
||||
product_context.setdefault('lang', order.partner_id.lang)
|
||||
product = self.env['product.product'].with_context(product_context).browse(product_id)
|
||||
|
||||
name = product.description_sale or product.display_name
|
||||
name = product.display_name
|
||||
|
||||
# add untracked attributes in the name
|
||||
untracked_attributes = []
|
||||
@@ -98,6 +98,9 @@ class SaleOrder(models.Model):
|
||||
if untracked_attributes:
|
||||
name += '\n%s' % (', '.join(untracked_attributes))
|
||||
|
||||
if product.description_sale:
|
||||
name += '\n%s' % (product.description_sale)
|
||||
|
||||
return name
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -859,8 +859,8 @@
|
||||
<strong t-esc="line.product_id.with_context(display_default_code=False).display_name" />
|
||||
</a>
|
||||
</div>
|
||||
<div t-if="line.name != line.product_id.name" t-attf-class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()" t-as="name_line">
|
||||
<div class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()[1:]" t-as="name_line">
|
||||
<span><t t-esc="name_line"/></span><br/>
|
||||
</t>
|
||||
</div>
|
||||
@@ -1318,8 +1318,8 @@
|
||||
<div>
|
||||
<strong t-field="line.product_id.with_context(display_default_code=False).display_name" />
|
||||
</div>
|
||||
<div t-if="line.name != line.product_id.name" t-attf-class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()" t-as="name_line">
|
||||
<div class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()[1:]" t-as="name_line">
|
||||
<span><t t-esc="name_line"/></span><br/>
|
||||
</t>
|
||||
</div>
|
||||
@@ -1474,8 +1474,8 @@
|
||||
<strong t-esc="line.product_id.with_context(display_default_code=False).display_name"/>
|
||||
</a>
|
||||
</div>
|
||||
<div t-if="line.name != line.product_id.name" t-attf-class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()" t-as="name_line">
|
||||
<div class="text-muted">
|
||||
<t t-foreach="line.name.splitlines()[1:]" t-as="name_line">
|
||||
<span><t t-esc="name_line"/></span><br/>
|
||||
</t>
|
||||
</div>
|
||||
@@ -1760,12 +1760,10 @@
|
||||
<template id="orders_followup_products_links" name="Orders Followup Products Links" inherit_id="website_portal_sale.orders_followup">
|
||||
<xpath expr="//div[@id='product_name']/*" position="replace">
|
||||
<a t-if="ol.product_id.website_published" t-att-href="ol.product_id.website_url">
|
||||
<span t-field="ol.product_id"/>
|
||||
<span t-if="ol.name != ol.product_id.name" t-esc="ol.name"/>
|
||||
<span t-esc="ol.name" />
|
||||
</a>
|
||||
<t t-if="not ol.product_id.website_published">
|
||||
<span t-field="ol.product_id"/>
|
||||
<span t-if="ol.name != ol.product_id.name" t-esc="ol.name"/>
|
||||
<span t-esc="ol.name" />
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user