Skip to content

Commit

Permalink
Merge pull request OCA#139 from TelmoSenseFly/BSSFL-248
Browse files Browse the repository at this point in the history
[BSSFL-248] Add section on quotation and invoice reports
  • Loading branch information
jcoux committed Sep 28, 2017
2 parents 51d4c5f + d9cf891 commit 83c5c29
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 40 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ latest (unreleased)

**Features and Improvements**

* Add section on quotation and invoice reports
* Add product validated field
* Add sensefly invoice report
* Add Delivery note / invoice report
Expand Down
108 changes: 68 additions & 40 deletions odoo/local-src/sf_account/report/sf_report_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,46 +92,74 @@
<!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any([l.discount for l in o.invoice_line_ids])"/>

<table class="table table-condensed">
<thead>
<tr style="background: #ccc;">
<th>Description</th>
<th class="text-right">Origin</th>
<th class="hidden">Source Document</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right">Disc.(%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Tax Excluded Price</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<tr t-foreach="o.invoice_line_ids" t-as="l">
<td><span t-field="l.name"/></td>
<td class="text-right">
<span t-field="l.product_id.origin_id.code"/>
</td>
<td class="hidden"><span t-field="l.origin"/></td>
<td class="text-right">
<span t-field="l.quantity"/>
<span t-field="l.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-right">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</tbody>
</table>
<t groups="sale.group_sale_layout" t-foreach="o.order_lines_layouted()" t-as="page">
<table class="table table-condensed">
<thead>
<tr style="background: #ccc;">
<th>Description</th>
<th class="text-right">Origin</th>
<th class="hidden">Source Document</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right">Disc.(%)</th>
<th class="text-right">Taxes</th>
<th class="text-right">Tax Excluded Price</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-foreach="page" t-as="layout_category">
<t t-if="layout_category_size > 1 or page_size > 1" groups="sale.group_sale_layout">
<tr class="active">
<td colspan="7" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
<t t-esc="layout_category['name']"/>
</td>
</tr>
</t>
<!-- Lines associated -->
<t t-foreach="layout_category['lines']" t-as="l">
<tr>
<td><span t-field="l.name"/></td>
<td class="text-right">
<span t-field="l.product_id.origin_id.code"/>
</td>
<td class="hidden"><span t-field="l.origin"/></td>
<td class="text-right">
<span t-field="l.quantity"/>
<span t-field="l.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td t-if="display_discount" class="text-right">
<span t-field="l.discount"/>
</td>
<td class="text-right">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/>
</td>
<td class="text-right">
<span t-field="l.price_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</t>

<t t-if="(layout_category_size > 1 or page_size > 1) and layout_category['subtotal']" groups="sale.group_sale_layout">
<tr class="text-right">
<td colspan="6">
<strong>Subtotal: </strong>
<t t-set="subtotal" t-value="sum(line.price_subtotal for line in layout_category['lines'])"/>
<span t-esc="subtotal" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
</td>
</tr>
</t>
</t>
</tbody>
</table>

<t t-if="page_index &lt; page_size - 1" groups="sale.group_sale_layout">
<p style="page-break-before:always;"> </p>
</t>
</t>

<div class="row">
<div class="col-xs-4 pull-right">
Expand Down
1 change: 1 addition & 0 deletions odoo/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ migration:
- sf_rma
- sf_rma_mrp_repair
- sf_rma_sale_order
- sf_sale
- sf_sale_order_delivery_info
- sf_sales_forecast
- sf_stock
Expand Down

0 comments on commit 83c5c29

Please sign in to comment.