Skip to content
Extraits de code Groupes Projets
Valider bbd54e56 rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[update] invoice template

parent e92ec76f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -9,9 +9,12 @@ ...@@ -9,9 +9,12 @@
'account', 'account',
], ],
'data': [ 'data': [
# templates
'templates/report_invoice_document.xml',
# views # views
'views/account_move.xml', 'views/account_move.xml',
'views/account_journal.xml', 'views/account_journal.xml',
'views/res_company.xml',
], ],
'qweb': [], 'qweb': [],
'installable': True, 'installable': True,
......
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
from . import account_journal from . import account_journal
from . import account_move from . import account_move
from . import res_company
# Copyright 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
is_tax = fields.Boolean(
'TVA Applicable',
default=True
)
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<template id="afac_report_invoice_document" inherit_id="account.report_invoice_document">
<!-- Gestion de l'affichage de la TVA : tableau & total -->
<xpath expr="//th[@name='th_taxes']" position="attributes">
<attribute name="t-if">o.company_id.is_tax</attribute>
</xpath>
<xpath expr="//t[@name='account_invoice_line_accountable']/td[5]" position="attributes">
<attribute name="t-if">o.company_id.is_tax</attribute>
</xpath>
<xpath expr="//tr[hasclass('o_subtotal')]" position="attributes">
<attribute name="t-if">o.company_id.is_tax</attribute>
</xpath>
<xpath expr="//t[@t-foreach='o.amount_by_group']/tr" position="attributes">
<attribute name="t-if">o.company_id.is_tax</attribute>
</xpath>
<!-- Suppression affichage communication -->
<xpath expr="//p[@name='payment_communication']" position="attributes">
<attribute name="t-if">o.company_id.is_tax</attribute>
</xpath>
</template>
</data>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2021 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<!-- Form View -->
<record model="ir.ui.view" id="res_company_afac_form">
<field name="name">res.company.afac.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='vat']" position="before">
<field name="is_tax" />
</xpath>
</field>
</record>
</data>
</odoo>
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