跳至内容
菜单
此问题已终结
2 回复
1996 查看

Hi, 
we want to change the width of the product name/descripton column a little bit, as this looks not really good right now. Do you have any advice where i can change this? Tried it with studio and didn't find anything. 


v18 online


thank you!



形象
丢弃
编写者

Dear Emad, 

whatever i try there doesn't effect the layout. looking forward to your assist. 

here is my source html code of the report: 

<data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[11]" meta-class="oe_structure"/>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]">
      <div class="oe_structure">
        <br/>
      </div>
    </xpath>
  </data>
  <data>
    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div" meta-class="oe_structure">
      <span class="o_small-fs">
        <strong>
          </strong>
      </span>
      <strong>
        <font style="color: rgb(189, 148, 0);">
          </font>
        <font style="color: rgb(0, 0, 0);">
          <span class="o_small-fs">Kunden-Nr:</span>
        </font>
        <font style="color: rgb(189, 148, 0);">
        </font>
      </strong>
      <span class="o_small-fs">
        <strong>
        </strong>
      </span>
      <span t-field="doc.partner_id.id" class="o_small-fs"/>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//t[@t-set='layout_document_title']/span[2]" meta-t-elif="doc.state in ['draft','sent']"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//t[@t-set='layout_document_title']/span[2]" meta-t-else=""/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//t[@t-set='layout_document_title']/span" meta-t-if="is_proforma"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//t[@t-set='layout_document_title']/span[@t-field='doc.name']" meta-t-field="doc.name">
      <span t-if="is_proforma">
        <span class="o_small-fs">Pro-Forma Rechnung # </span>
      </span>
      <span t-elif="doc.state in ['draft','sent']">
        <span class="o_small-fs">Angebot # </span>
      </span>
      <span t-else="">
        <span class="o_small-fs">Auftrag # </span>
      </span>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//t[@t-set='layout_document_title']//span[@t-field='doc.name']" meta-t-field="doc.name">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_reference']/strong"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_reference']/div[@t-field='doc.client_order_ref']" meta-t-field="doc.client_order_ref">
      <strong>
        <span class="o_small-fs">Referenz</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[@name='informations_reference']/div[@t-field='doc.client_order_ref']" meta-t-field="doc.client_order_ref">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_date']/strong" meta-t-if="is_proforma"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_date']/strong[2]" meta-t-else=""/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_date']/strong" meta-t-elif="doc.state in ['draft', 'sent']"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='informations_date']/div[@t-field='doc.date_order']" meta-t-field="doc.date_order" meta-t-options="{&quot;widget&quot;: &quot;date&quot;}">
      <strong t-if="is_proforma">
        <span class="o_small-fs">​Auftragsdatum</span>
      </strong>
      <strong t-elif="doc.state in ['draft', 'sent']">
        <span class="o_small-fs">Auftragsdatum</span>
      </strong>
      <strong t-else="">
        <span class="o_small-fs">Auftragsdatum</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[@name='informations_date']/div[@t-field='doc.date_order']" meta-t-field="doc.date_order" meta-t-options="{&quot;widget&quot;: &quot;date&quot;}">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='expiration_date']/strong"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@name='expiration_date']/div[@t-field='doc.validity_date']" meta-t-field="doc.validity_date">
      <strong>
        <span class="o_small-fs">Gültig bis</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[@name='expiration_date']/div[@t-field='doc.validity_date']" meta-t-field="doc.validity_date">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[4]/strong"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[4]/div" meta-t-if="doc.incoterm_location">
      <strong>
        <span class="o_small-fs">Incoterm</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[4]/div/br"/>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[4]/div/span[@t-field='doc.incoterm.code']" meta-t-field="doc.incoterm.code">
      <span class="o_small-fs">
        <br/>
      </span>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//span[@t-field='doc.incoterm.code']" meta-t-field="doc.incoterm.code">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//span[@t-field='doc.incoterm_location']" meta-t-field="doc.incoterm_location">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[4]/div[@t-field='doc.incoterm.code']" meta-t-else="" meta-t-field="doc.incoterm.code">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[5]/strong"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[@id='informations']/div[5]/div[@t-field='doc.user_id']" meta-t-field="doc.user_id">
      <strong>
        <span class="o_small-fs">Ihr Kontakt</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//div[@t-field='doc.user_id']" meta-t-field="doc.user_id">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[3]" meta-class="oe_structure">
      <br/>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_quantity']" meta-name="th_quantity" meta-class="text-end text-nowrap"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_priceunit']" meta-name="th_priceunit" meta-class="text-end text-nowrap"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_description']" meta-name="th_description" meta-class="text-start"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_taxes']" meta-name="th_taxes" meta-class="text-end"/>
    <xpath position="before" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_discount']" meta-name="th_discount" meta-t-if="display_discount" meta-class="text-end">
      <th name="th_description" class="text-start">
        <span class="o_small-fs">Produkt</span>
      </th>
      <th>
        <p>
          <span class="o_small-fs">HS-Code</span>
        </p>
      </th>
      <th>
        <p>
          <span class="o_small-fs">CO</span>
        </p>
      </th>
      <th name="th_quantity" class="text-end text-nowrap">
        <span class="o_small-fs">Menge</span>
      </th>
      <th name="th_priceunit" class="text-end text-nowrap">
        <span class="o_small-fs">Preis</span>
      </th>
    </xpath>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_discount']" meta-name="th_discount" meta-t-if="display_discount" meta-class="text-end">
      <th name="th_taxes" class="text-end">
        <span class="o_small-fs">Steuer</span>
      </th>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//th[@name='th_discount']/span"/>
    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//th[@name='th_discount']" meta-name="th_discount" meta-t-if="display_discount" meta-class="text-end">
      <span class="o_small-fs"> Rabatt</span>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_subtotal']/span">
      <attribute name="class">o_small-fs</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_name']" meta-name="td_name">
      <td>
        <p>
          <span t-field="line.product_id.hs_code"/>
          <br/>
        </p>
      </td>
      <td>
        <p>
          <span t-field="line.product_id.country_of_origin.code"/>
          <br/>
        </p>
      </td>
    </xpath>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_priceunit']" meta-name="td_priceunit" meta-class="text-end text-nowrap">
      <td t-if="display_discount" class="text-end">
        <o-diff-hole for="150"/>
      </td>
    </xpath>
    <xpath expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t//o-diff-hole[@for='150']" position="replace">
      <xpath position="move" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//span[@t-field='line.discount']" meta-t-field="line.discount"/>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//td[@name='td_section_line']" meta-name="td_section_line" meta-colspan="99">
      <attribute name="colspan">101</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//td[@name='td_note_line']" meta-name="td_note_line" meta-colspan="99">
      <attribute name="colspan">101</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//td[@name='td_section_subtotal']" meta-name="td_section_subtotal" meta-colspan="99">
      <attribute name="colspan">101</attribute>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]/p[@id='fiscal_position_remark']" meta-t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" meta-id="fiscal_position_remark"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]/span[@name='order_note']" meta-t-field="doc.note" meta-t-attf-style="#{'text-align:justify;text-justify:inter-word;' if doc.company_id.terms_type != 'html' else ''}" meta-name="order_note"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]/p[2]" meta-t-if="not is_html_empty(doc.payment_term_id.note)"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]/div" meta-class="oe_structure"/>
    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/div[10]/p[@id='carrier_description']" meta-t-if="doc.carrier_id.carrier_description" meta-id="carrier_description">
      <div t-out="doc.carrier_id.carrier_description" class="o_small-fs"/>
      <p/>
      <span t-field="doc.note" t-attf-style="#{'text-align:justify;text-justify:inter-word;' if doc.company_id.terms_type != 'html' else ''}" name="order_note" class="o_small-fs"/>
      <p t-if="not is_html_empty(doc.payment_term_id.note)">
        <span t-field="doc.payment_term_id.note" class="o_small-fs">The payment should also be transmitted with love</span>
      </p>
      <div class="oe_structure"/>
      <p t-if="doc.fiscal_position_id and not is_html_empty(doc.fiscal_position_id.sudo().note)" id="fiscal_position_remark">
        <strong>
          <span class="o_small-fs">Fiscal Position Remark:
        </span>
        </strong>
        <span class="o_small-fs">
                    </span>
        <span t-field="doc.fiscal_position_id.sudo().note" class="o_small-fs">No further requirements for this payment</span>
      </p>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//p[@id='carrier_description']/strong"/>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//p[@id='carrier_description']/div" meta-t-out="doc.carrier_id.carrier_description"/>
    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']//p[@id='carrier_description']" meta-t-if="doc.carrier_id.carrier_description" meta-id="carrier_description">
      <strong>
        <span class="o_small-fs">Versandinformation</span>
      </strong>
    </xpath>
  </data>
  <data>
    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[7]" meta-t-if="display_discount" meta-class="text-end"/>
  </data>
</data>

can you share with me the name of the report please

编写者

it's the sale.report_saleorder_raw


I belive that this report is customized and these are customiozed fields

Try to add the colspan attribute here is the usage of it colspan="number"

for example

<td name="product_id" colspan="12">

<th>
<p>
<span class="o_small-fs">HS-Code</span>
</p>
</th>

will become

<th colspan="12">
<span class="o_small-fs">HS-Code</span>
</th>

=======================================
and

<td>
<p>
<span t-field="line.product_id.hs_code"/>
<br/>
</p>
</td>

will become

<td colspan="12">
<span t-field="line.product_id.hs_code"/>
</td>

编写者

@Emad

not really a good result...

we need the product + product descripton to be bigger

you will have to select the report => report_saleorder_document (sale.report_saleorder_document)
after that go to line 71 and edit the <th name="th_description" class="text-start">Description</th>
add the column size to the class you want try to test col-4 , col-6 , col-8 and see what works fine for you

it should look like this => <th name="th_description" class="text-start col-8">Description</th>

after that add the same class to the line 92
this is the line
<td name="td_name"><span t-field="line.name">Bacon Burger</span></td>

make it look like this by adding the class class="col-8"

<td name="td_name" class="col-8"><span t-field="line.name">Bacon Burger</span></td>

最佳答案

Hello,

You can change the width using the studio by going to reports then selecting the wanted report then edit the source code by pressing the "</> EDIT SOURCES"  button.

After that you can manipulate the HTML to print the report the way you like for example add a colspan attribute.

You can share with us the exact report for more help.

I hope this helps

形象
丢弃
编写者

it's the sale.report_saleorder_raw

编写者 最佳答案

nothing changed with this codes at line 72 + 92

形象
丢弃

you have to save it to for it to work

编写者

I did - nothing changed

相关帖文 回复 查看 活动
1
7月 25
931
2
3月 25
1280
0
2月 25
984
0
2月 25
1115
0
2月 25
1127