This question has been flagged

Hi everyone, 

I'm working with Odoo 11.0 on Windows 7.

My aim is to add a comment line on my sale order reports.

To do it i want to:

1) Create a product (in catalog)  for the title of the comment and an other for the text of the comment (it will allow me to create CSS for each type)

2) For each product (TITLE and TEXT) i will use the description of the product (what appear on the report and what i can change for each sale order) to set what i want.

3) In the Qweb views i want to hide the "QUANTITY", "UNIT PRICE", "TAXES and "AMOUNT" from the table when the " l.product_id" == 'TITLE' or 'TEXT' ".

At the moment i've tried all i've seen on the web, i think the problem is coming from the value i want to compare ('TITLE' or 'TEXT') because for each lines the "l.product_id" is correctly get. I'm only trying to comparing value on the unit price for the moment cause i am unable to do it.

Here is a list of what i've tried:

  • <t t-if="l.product_id != 'TITLE'> SHOW PRICE UNIT </t> (no need to precise else so it doesn't show anything)

  • Make an "attrs" for the span to be invisible if "l.produc_id == "TITLE"

  • I've tried with the &quot; and the "like" comparator 

CODE:

<!-- Lines associated -->

<t t-foreach="layout_category['lines']" t-as="l">

<t t-set="TITRE" t-value="TITRE" />

<tr>

<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"/>

</td>

<td class="text-right">

<span t-if="l.product_id == TITRE" t-field="l.price_unit"/>

</td>

<td t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">

<span t-field="l.discount"/>

</td>

<td class="text-right" groups="sale.group_show_price_subtotal">

<span t-field="l.price_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.pricelist_id.currency_id}"/>

</td>

<td class="text-right" groups="sale.group_show_price_total">

<span t-field="l.price_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: doc.pricelist_id.currency_id}"/>

</td>

</tr>

</t>

[url=https://www.noelshack.com/2018-09-1-1519651693-saleorderremove.png][img]https://image.noelshack.com/minis/2018/09/1/1519651693-saleorderremove.png[/img][/url]

Avatar
Discard
Author

SOrry for picture of what i want, here is the good link: https://www.noelshack.com/2018-09-1-1519651693-saleorderremove.png