[IMP] add printing option for outgoing docs

printing option is breaking for picking type, make it available only
for outgoing docs
This commit is contained in:
Iryna Vyshnevska
2022-05-30 11:26:34 +03:00
parent 4fa05cacfe
commit c34780eac8

View File

@@ -6,17 +6,24 @@
expr="//table[@t-if="o.move_line_ids and o.state=='done'"]/thead/tr"
position="inside"
>
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<t t-if="o.state != 'done'">
<th class="text-right"><strong>Qty Reserved</strong></th>
<t t-if="o.picking_type_id.code == 'outgoing'">
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<t t-if="o.state != 'done'">
<th class="text-right"><strong>Qty Reserved</strong></th>
</t>
<th class="text-right" name="unit_price"><strong
>Unit Price</strong></th>
<th
class="text-right"
name="discount"
groups="product.group_discount_per_so_line"
>
<strong>Discount</strong>
</th>
<th class="text-right" name="subtotal"><strong
>Subtotal</strong></th>
<th class="text-right" name="taxes"><strong>Taxes</strong></th>
</t>
<th class="text-right" name="unit_price"><strong>Unit Price</strong></th>
<th class="text-right" name="discount" groups="product.group_discount_per_so_line">
<strong>Discount</strong>
</th>
<th class="text-right" name="subtotal" ><strong>Subtotal</strong></th>
<th class="text-right" name="taxes" ><strong>Taxes</strong></th>
</t>
</t>
</xpath>
<xpath
@@ -53,29 +60,34 @@
expr="//table[@t-if=&quot;o.move_line_ids and o.state==&apos;done&apos;&quot;]"
position="after"
>
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<table class="table table-sm mt32" name="totals">
<thead>
<tr>
<th class="text-right" name="am_untaxed"><strong>Untaxed Amount</strong></th>
<th class="text-right" name="taxes" ><strong>Taxes</strong></th>
<th class="text-right" name="subtotal" ><strong>Total</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right" name="am_untaxed">
<span t-field="o.amount_untaxed" />
</td>
<td class="text-right" name="taxes" >
<span t-field="o.amount_tax" />
</td>
<td class="text-right" name="subtotal" >
<span t-field="o.amount_total" />
</td>
</tr>
</tbody>
</table>
<t t-if="o.picking_type_id.code == 'outgoing'">
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<table class="table table-sm mt32" name="totals">
<thead>
<tr>
<th class="text-right" name="am_untaxed"><strong
>Untaxed Amount</strong></th>
<th class="text-right" name="taxes"><strong
>Taxes</strong></th>
<th class="text-right" name="subtotal"><strong
>Total</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-right" name="am_untaxed">
<span t-field="o.amount_untaxed" />
</td>
<td class="text-right" name="taxes">
<span t-field="o.amount_tax" />
</td>
<td class="text-right" name="subtotal">
<span t-field="o.amount_total" />
</td>
</tr>
</tbody>
</table>
</t>
</t>
</xpath>
</template>
@@ -85,22 +97,30 @@
inherit_id="stock.stock_report_delivery_has_serial_move_line"
>
<xpath expr="//span[@t-field='move_line.qty_done']/.." position="after">
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<t t-if="move_line.picking_id.state != 'done'">
<td class="text-right">
<span t-field="move_line.product_uom_qty" />
<span t-field="move_line.product_uom_id" /></td>
<t t-if="o.picking_type_id.code == 'outgoing'">
<t t-if="o.valued and o.sale_id and o.move_line_ids">
<t t-if="move_line.picking_id.state != 'done'">
<td class="text-right">
<span t-field="move_line.product_uom_qty" />
<span t-field="move_line.product_uom_id" /></td>
</t>
<td class="text-right" name="unit_price"><span
t-field="move_line.sale_price_unit"
/></td>
<td
class="text-right"
name="discount"
groups="product.group_discount_per_so_line"
>
<span t-field="move_line.sale_discount" />
</td>
<td class="text-right" name="subtotal"><span
t-field="move_line.sale_price_subtotal"
/></td>
<td class="text-right" name="taxes"><span
t-field="move_line.sale_tax_description"
/></td>
</t>
<td class="text-right" name="unit_price"><span t-field="move_line.sale_price_unit" /></td>
<td class="text-right" name="discount" groups="product.group_discount_per_so_line">
<span t-field="move_line.sale_discount" />
</td>
<td class="text-right" name="subtotal"><span
t-field="move_line.sale_price_subtotal"
/></td>
<td class="text-right" name="taxes"><span
t-field="move_line.sale_tax_description"
/></td>
</t>
</xpath>
</template>