İçereği Atla
Menü
Bu soru işaretlendi
15 Cevaplar
8568 Görünümler

Current Delivery Slip Printout:

Product                                                Ordered Quantity

[LAP-E5] Laptop E5023                       3.000 Unit(s)

I want to rearrange it to:

Qty      UOM     Product

3.000 Unit(s)   Laptop E5023

Done so far:

1. i have created a new xml file call DR_view.xml with inherit_id="stock.report_delivery_document".

    am i right?  

2. i have inserted this code below to replace it. I got this search element from report_deliveryslip.xml

     <xpath expr="//table[@class='table table-condensed mt48']//thead//tr" position="replace">

         <table class="table table-condensed mt48" t-if="not o.pack_operation_ids">

            <thead>

                <tr>

                    <th><strong>Quantity</strong></th>

                    <th><strong>Unit</strong></th>

                    <th><strong>Product</strong></th>

                </tr>

        </thead>

        <tbody>

            <tr t-foreach="o.move_lines" t-as="move">

                <td>

                    <span t-field="move.ordered_qty"/>

                    <span t-field="move.product_uom"/>

                </td>

                <td><span t-field="move.product_id"/></td>

             </tr>

        </tbody>

    </table>

</xpath>


After I updated the database, I still got the original arrangement displayed. Its seem the xpath is not able to locate and replace it. or am in the wrong template file. 

Thank you for you kindness to help in advance,

Gain Charlie

 

Avatar
Vazgeç
HI,

Thank you for your reply.
Unfortunately, the problem still persist.
It does not override it. It seems not able to search the element.
or maybe am in the work template which i doubted coz the thing below works
<xpath expr="//div[@name='customer_address']" position="replace"> </xpath>  
<xpath expr="//div[@class='col-xs-4 pull-right']" position="replace"> </xpath>  
<xpath expr="//h2" position="replace">

Thank you for your time in advance.

Rgds,
Gain            


On Saturday, January 6, 2018 8:51 AM, Mayank Gosai <mayankgosai91@gmail.com> wrote:


A new answer on How to rearrange the columns of order line item in delivery slip in odoo10 ? has been posted. Click here to access the post :
--
Mayank Gosai

Sent by Odoo S.A. using Odoo.


Üretici En İyi Yanıt


Hi Mayank,

Thank you for your advice. The following works:

1. Set position BEFORE to put your own arrangement of columns

<xpath expr="//table[@class='table table-condensed mt48']" position="before">

2. Then suppress the orignal columns by:

<xpath expr="//table[@t-if='o.pack_operation_ids']" position="replace"/>

<xpath expr="//table[@t-if='not o.pack_operation_ids']" position="replace"/>

Avatar
Vazgeç
En İyi Yanıt

Hi Charlie,

haven't tested it, please try this code:.

<xpath expr="//div[@class='page']/table[@class='table table-condensed mt48']/thead/tr" position="replace">

     <table class="table table-condensed mt48" t-if="not o.pack_operation_ids">

         <thead>

             <tr>

                 <th><strong>Quantity</strong></th>

                 <th><strong>Unit</strong></th>

                 <th><strong>Product</strong></th>

             </tr>

         </thead>

     <tbody>

     <tr t-foreach="o.move_lines" t-as="move">

         <td>

             <span t-field="move.ordered_qty"/>

             <span t-field="move.product_uom"/>

         </td>

         <td><span t-field="move.product_id"/></td>

     </tr>

    </tbody>

</table>

</xpath>


Hope it helps you,
Regards,

Mayank Gosai

Avatar
Vazgeç
Üretici

It still does not override it.

Üretici

Thank you for your reply.

Unfortunately, the problem still persist.

It does not override it. It seems not able to search the element.

or maybe am in the work template?

Üretici

But below xpath works.

1. the customer address and the <xpath expr="//div[@name='customer_address']" position="replace"> </xpath>

2. other refers <xpath expr="//div[@class='col-xs-4 pull-right']" position="replace"> </xpath>

How come?

Hi Charlie,

Can you provide more information as now I am getting confused.

Do you want to replace 'tr' tag or 'table' ?

Thanks

Üretici

Hi Mayank,

Thank you for you time and kindness to reply to my question.

I want to replace all document header and alter the order item detail. As well as to add signatories in a fixed position below (just like the doc footer. but cannot be done in the doc footer, because it will be applicable only here.)

I have done the following:( but can't alter the item detail and add a fixed position for signatories.)

1. To replace the CUSTOMER ADDRESS section

<xpath expr="//div[@name='customer_address']" position="replace"> </xpath>

2. To replacing the REFERENCE section (which is the next section after the customer address section.

<xpath expr="//div[@class='col-xs-4 pull-right']" position="replace"> </xpath>

Hope this help clears thing out.

Thank you in advance.

Üretici

Hi Mayank,

Please help.

Try with:

<xpath expr="//div[@class='page']/table[@class='table table-condensed mt48']" position="replace">

Thanks,

Üretici

Hi Mayank,

Thank you but unfortunately it wont work either.

Below is my view.xml file. Hope this is help. Thank you in Advance.

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<data>

<!-- QWeb Reports -->

<report

id="stock_picking_action_report_amcdeliveryslip"

model="stock.picking"

string="Amc Delivery Receipt"

report_type="qweb-pdf"

name="stock.stock_picking_report_amcdeliveryreceipt_main"

file="stock.report_deliveryslip_amcdeliveryreceipt"

attachment_use="False"

/>

<template id="stock.stock_picking_report_amcdeliveryreceipt" inherit_id="stock.report_delivery_document" primary="True">

<xpath expr="//div[@name='customer_address']" position="replace"> </xpath>

<xpath expr="//div[@class='col-xs-4 pull-right']" position="replace"> </xpath>

<xpath expr="//tbody//tr//td[2]" position="replace"></xpath>

<xpath expr="//h2" position="replace">

<t t-if="o.origin">

<p align="right"><span t-field="o.origin"/></p>

</t>

<p align="right"><span t-field="o.name"/></p>

</xpath>

<xpath expr="//table[@class='table table-condensed']" position="replace" >

<table >

<tr HEIGHT='30'>

<td width='800'><span t-field="o.partner_id"/></td>

<t t-if="o.state == 'done'">

<td ><span t-field="o.date_done" t-options ='{"format": "MM/dd/yyyy"}'/></td>

</t>

<t t-if="o.state != 'done'">

<td ><span t-field="o.min_date" t-options ='{"format": "MM/dd/yyyy"}' /></td>

</t>

<!--<td align="right"><span t-field="o.min_date"/></td>-->

</tr>

<tr HEIGHT='80'>

<td>

<span t-field="o.partner_id.street" />

<t t-if="o.partner_id.street2">

<span t-field="o.partner_id.street2"/>

</t>

<span t-field="o.partner_id.city"/>

</td>

<td ><span t-field="o.partner_id.ref"/></td>

</tr>

</table>

<table >

<tr>

<td width='400'><span t-field="o.sale_id.client_order_ref"/> </td>

<td width='400'><span t-field="o.sale_id.payment_term_id"/> </td>

<td width='400'><span t-field="o.sale_id.user_id"/> </td>

</tr>

</table>

</xpath>

<!-- THIS IS THE AREA WHERE I WANT IT ALTER -->

<!--<xpath expr="//div[@class='page']/table[@class='table table-condensed mt48']/thead/tr" position="replace"> -->

<xpath expr="//div[@class='page']/table[@class='table table-condensed mt48']" position="replace">

<table class="table table-condensed mt48" t-if="not o.pack_operation_ids">

<thead>

<tr>

<th><strong>Quantity</strong></th>

<th><strong>Unit</strong></th>

<th><strong>Product</strong></th>

</tr>

</thead>

<tbody>

<tr t-foreach="o.move_lines" t-as="move">

<td>

<span t-field="move.ordered_qty"/>

<span t-field="move.product_uom"/>

</td>

<td><span t-field="move.product_id"/></td>

</tr>

</tbody>

</table>

</xpath>

</template>

<template id="stock.stock_picking_report_amcdeliveryreceipt_main">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="o">

<t t-call="stock.stock_picking_report_amcdeliveryreceipt" t-lang="o.partner_id.lang"/>

</t>

</t>

</template>

</data>

</odoo>

<xpath expr="//table[@class='table table-condensed']//thead//tr"position="replace">

Üretici

This code is not valid:

<xpath expr="//table[@class='table table-condensed']//thead//tr"position="replace">

but this validates it.

<xpath expr="//table[@class='table table-condensed mt48']//thead//tr" position="replace">

BUT THE PROBLEM STILL PERSIST.

please help.

Üretici

Hi Mayank,

Problem still cant override using (xpath) the item detail!

Please help!

Üretici

Hi Mayank,

Thank you for your advice. The following works:

1. Set position BEFORE to put your own arrangement of columns

<xpath expr="//table[@class='table table-condensed mt48']" position="before">

2. Then suppress the orignal columns by:

<xpath expr="//table[@t-if='o.pack_operation_ids']" position="replace"/>

<xpath expr="//table[@t-if='not o.pack_operation_ids']" position="replace"/>

Thank you,

Glad to help.

İlgili Gönderiler Cevaplar Görünümler Aktivite
4
Tem 25
2266
0
Ağu 24
1334
1
Haz 24
1918
0
Mar 24
1389
1
Mar 23
5116