Skip to content
Extraits de code Groupes Projets
Valider dc49c439 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

Modifs libellé Prix HT/TTC + change nom dans devis

parent 4de56ae8
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
from . import res_partner
from . import sale
from . import account_invoice
from . import product
\ No newline at end of file
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class AutrementProductProduct(models.Model):
_inherit = "product.product"
def get_product_multiline_description_sale(self):
res = super(AutrementProductProduct, self).get_product_multiline_description_sale()
name = self.name
if self.description_sale:
name += '\n' + self.description_sale
return name
\ No newline at end of file
......@@ -10,6 +10,128 @@
</t>
</xpath>
<xpath expr="//table[@name='invoice_line_table']" position="replace">
<table class="table table-sm o_main_table" name="invoice_line_table">
<thead>
<tr>
<t t-set="colspan" t-value="6"/>
<th class="text-left"><span>Description</span></th>
<th class="d-none text-left"><span>Document source</span></th>
<th class="text-right"><span>Quantité</span></th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Prix unitaire HT</span></th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Réduc.(%)</span>
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th>
<th class="text-right">
<span groups="account.group_show_line_subtotals_tax_excluded">Montant HT</span>
<span groups="account.group_show_line_subtotals_tax_included">Total TTC</span>
</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="o.invoice_line_ids" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type" name="account_invoice_line_accountable">
<td name="account_invoice_line_name"><span t-field="line.name"/></td>
<td class="d-none"><span t-field="line.origin"/></td>
<td class="text-right">
<span t-field="line.quantity"/>
<span t-field="line.uom_id" groups="uom.group_uom"/>
</td>
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-field="line.discount"/>
</td>
<td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.invoice_line_tax_ids))"/>
</td>
<td class="text-right o_price_total">
<span t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td t-att-colspan="colspan">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td t-att-colspan="colspan">
<span t-field="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or o.invoice_line_ids[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right">
<td t-att-colspan="colspan">
<strong class="mr16">Sous-total HT</strong>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
</xpath>
<xpath expr="//div[@id='total']" position="replace">
<div id="total" class="row">
<div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto">
<table class="table table-sm">
<tr class="border-black o_subtotal" style="">
<td><strong>Sous-total HT</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"/>
</td>
</tr>
<t t-foreach="o.amount_by_group" t-as="amount_by_group">
<tr style="">
<t t-if="len(o.tax_line_ids) == 1 and o.amount_untaxed == amount_by_group[2]">
<td><span t-esc="amount_by_group[0]"/></td>
<td class="text-right o_price_total">
<span t-esc="amount_by_group[3]" />
</td>
</t>
<t t-else="">
<td>
<span t-esc="amount_by_group[0]"/>
<span>&amp;nbsp;<span>on</span>
<t t-esc="amount_by_group[4]"/>
</span>
</td>
<td class="text-right o_price_total">
<span t-esc="amount_by_group[3]"/>
</td>
</t>
</tr>
</t>
<tr class="border-black o_total">
<td><strong>Total TTC</strong></td>
<td class="text-right">
<span t-field="o.amount_total"/>
</td>
</tr>
</table>
</div>
</div>
</xpath>
</template>
......
......@@ -57,15 +57,15 @@
<t t-set="colspan" t-value="5"/>
<th class="text-left">Description</th>
<th class="text-right">Quantité</th>
<th class="text-right">Prix unitaire</th>
<th class="text-right">Prix unitaire HT</th>
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
<span>Réduc.(%)</span>
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th class="text-right">Taxes</th>
<th class="text-right">
<t groups="account.group_show_line_subtotals_tax_excluded">Montant</t>
<t groups="account.group_show_line_subtotals_tax_included">Sous-total</t>
<t groups="account.group_show_line_subtotals_tax_excluded">Montant HT</t>
<t groups="account.group_show_line_subtotals_tax_included">Sous-total HT</t>
</th>
</tr>
</thead>
......@@ -116,7 +116,7 @@
<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right">
<td t-att-colspan="colspan">
<strong class="mr16">Sous-total</strong>
<strong class="mr16">Sous-total HT</strong>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'
......@@ -133,7 +133,7 @@
<div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto">
<table class="table table-sm">
<tr class="border-black o_subtotal" style="">
<td><strong>Sous-total</strong></td>
<td><strong>Sous-total HT</strong></td>
<td class="text-right">
<span t-field="doc.amount_untaxed"/>
</td>
......@@ -162,7 +162,7 @@
</tr>
</t>
<tr class="border-black o_total">
<td><strong>Total</strong></td>
<td><strong>Total TTC</strong></td>
<td class="text-right">
<span t-field="doc.amount_total"/>
</td>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter