From f5eace283f3b5748997386d91472466263ee5b81 Mon Sep 17 00:00:00 2001 From: Remi <remi@le-filament.com> Date: Fri, 19 Apr 2019 13:35:59 +0200 Subject: [PATCH] Update code according to standards --- LICENSE | 29 +- README.rst | 2 +- __init__.py | 4 +- __manifest__.py | 40 +- models/__init__.py | 12 +- models/account_config_settings.py | 93 +++-- models/account_invoice.py | 57 +-- models/res_company.py | 15 +- models/sale_config_settings.py | 90 +++-- models/sale_order.py | 66 ++-- static/src/less/account_lefilament.less | 4 +- templates/report_devis_lefilament.xml | 447 ++++++++++------------ templates/report_facture_lefilament.xml | 475 ++++++++++++------------ templates/report_layout_footer.xml | 12 +- templates/report_layout_header.xml | 2 +- views/account_config_settings.xml | 56 +-- views/lefilament_company_view.xml | 37 +- views/lefilament_facture_view.xml | 92 ++--- views/sale_config_settings.xml | 56 +-- 19 files changed, 771 insertions(+), 818 deletions(-) diff --git a/LICENSE b/LICENSE index 7e5dad2..fb0e255 100644 --- a/LICENSE +++ b/LICENSE @@ -200,31 +200,4 @@ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY C If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. -Also add information on how to contact you by electronic and paper mail. - -If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. - -You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <https://www.gnu.org/licenses/>. \ No newline at end of file +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.rst b/README.rst index dc1a432..4a9454f 100644 --- a/README.rst +++ b/README.rst @@ -66,7 +66,7 @@ Contributors Maintainer ---------- -.. image:: https://le-filament.com/images/logo-lefilament.png +.. image:: https://le-filament.com/img/logo-lefilament.png :alt: Le Filament :target: https://le-filament.com diff --git a/__init__.py b/__init__.py index 0e9be03..f73d4f9 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -import models \ No newline at end of file +from . import models diff --git a/__manifest__.py b/__manifest__.py index 975faeb..58bc5bc 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,24 +1,20 @@ -# -*- coding: utf-8 -*- - -# © 2017 Le Filament (<http://www.le-filament.com>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - { - 'name': 'Templates Devis/Factures - Le Filament', - 'license': 'AGPL-3', - 'author': 'LE FILAMENT', - 'website': 'https://le-filament.com', - 'depends': [ - 'sale', - ], - 'data': [ - 'views/lefilament_facture_view.xml', - 'views/lefilament_company_view.xml', - 'views/account_config_settings.xml', - 'views/sale_config_settings.xml', - 'templates/report_facture_lefilament.xml', - 'templates/report_devis_lefilament.xml', - 'templates/report_layout_header.xml', - 'templates/report_layout_footer.xml', - ], + 'name': 'Templates Devis/Factures - Le Filament', + 'license': 'AGPL-3', + 'author': 'LE FILAMENT', + 'version': '10.0.1.0.0', + 'website': 'https://le-filament.com', + 'depends': [ + 'sale', + ], + 'data': [ + 'views/lefilament_facture_view.xml', + 'views/lefilament_company_view.xml', + 'views/account_config_settings.xml', + 'views/sale_config_settings.xml', + 'templates/report_facture_lefilament.xml', + 'templates/report_devis_lefilament.xml', + 'templates/report_layout_header.xml', + 'templates/report_layout_footer.xml', + ], } diff --git a/models/__init__.py b/models/__init__.py index edc4361..3d51fcf 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -import account_invoice -import sale_order -import res_company -import account_config_settings -import sale_config_settings \ No newline at end of file +from . import account_invoice +from . import sale_order +from . import res_company +from . import account_config_settings +from . import sale_config_settings diff --git a/models/account_config_settings.py b/models/account_config_settings.py index d6fcad3..3513772 100644 --- a/models/account_config_settings.py +++ b/models/account_config_settings.py @@ -1,48 +1,61 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class LeFilamentAccountConfiguration(models.TransientModel): - _inherit = 'account.config.settings' - - body_font = fields.Text('Body Font', default="font-family: 'DejaVu Sans';") - num_facture = fields.Text('Invoice Num CSS', default="background-color: #00B495;\ncolor: #fff;") - num_facture_font = fields.Text('Invoice Num Font', default="font-family: 'Helvetica';") - nom_client = fields.Text('Customer Name CSS', default="color: #00B495;\nfont-weight: 700;") - tab_font = fields.Text('Tab Font', default="font-family: 'Helvetica';") - total_css = fields.Text('Total CSS', default="background-color: #00B495;\ncolor: #fff;") - footer_font = fields.Text('Footer Font', default="font-family: 'Lato';") - - - @api.multi - def set_body_font(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'body_font', self.body_font) - - @api.multi - def set_num_facture(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'num_facture', self.num_facture) - - @api.multi - def set_num_facture_font(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'num_facture_font', self.num_facture_font) - - @api.multi - def set_nom_client(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'nom_client', self.nom_client) - - @api.multi - def set_tab_font(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'tab_font', self.tab_font) - - @api.multi - def set_total_css(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'total_css', self.total_css) - - @api.multi - def set_body_font(self): - return self.env['ir.values'].sudo().set_default('account.config.settings', 'footer_font', self.footer_font) - + _inherit = 'account.config.settings' + + body_font = fields.Text('Body Font', default="font-family: 'DejaVu Sans';") + num_facture = fields.Text( + 'Invoice Num CSS', + default="background-color: #00B495;\ncolor: #fff;") + num_facture_font = fields.Text('Invoice Num Font', + default="font-family: 'Helvetica';") + nom_client = fields.Text( + 'Customer Name CSS', + default="color: #00B495;\nfont-weight: 700;") + tab_font = fields.Text('Tab Font', default="font-family: 'Helvetica';") + total_css = fields.Text('Total CSS', + default="background-color: #00B495;\ncolor: #fff;") + footer_font = fields.Text('Footer Font', default="font-family: 'Lato';") + + @api.multi + def set_body_font(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'body_font', self.body_font) + + @api.multi + def set_num_facture(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'num_facture', self.num_facture) + + @api.multi + def set_num_facture_font(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', + 'num_facture_font', + self.num_facture_font) + + @api.multi + def set_nom_client(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'nom_client', self.nom_client) + + @api.multi + def set_tab_font(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'tab_font', self.tab_font) + + @api.multi + def set_total_css(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'total_css', self.total_css) + + @api.multi + def set_footer_font(self): + return self.env['ir.values'].sudo().set_default( + 'account.config.settings', 'footer_font', self.footer_font) diff --git a/models/account_invoice.py b/models/account_invoice.py index b3d9498..297aff4 100644 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -1,32 +1,39 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api + +from odoo import models, fields + class LeFilamentFacture(models.Model): - _inherit = 'account.invoice' - - lf_note_ref_facture = fields.Text('Note/Reference') - - - def get_report_variables(self): - body_font = self.env['ir.values'].get_default('account.config.settings', 'body_font') - num_facture = self.env['ir.values'].get_default('account.config.settings', 'num_facture') - num_facture_font = self.env['ir.values'].get_default('account.config.settings', 'num_facture_font') - nom_client = self.env['ir.values'].get_default('account.config.settings', 'nom_client') - tab_font = self.env['ir.values'].get_default('account.config.settings', 'tab_font') - total_css = self.env['ir.values'].get_default('account.config.settings', 'total_css') - footer_font = self.env['ir.values'].get_default('account.config.settings', 'footer_font') - - return { - 'body_font': body_font, - 'num_facture': num_facture, - 'num_facture_font': num_facture_font, - 'nom_client': nom_client, - 'tab_font': tab_font, - 'total_css': total_css, - 'footer_font': footer_font, - } + _inherit = 'account.invoice' + + lf_note_ref_facture = fields.Text('Note/Reference') + + def get_report_variables(self): + body_font = self.env['ir.values'].get_default( + 'account.config.settings', 'body_font') + num_facture = self.env['ir.values'].get_default( + 'account.config.settings', 'num_facture') + num_facture_font = self.env['ir.values'].get_default( + 'account.config.settings', 'num_facture_font') + nom_client = self.env['ir.values'].get_default( + 'account.config.settings', 'nom_client') + tab_font = self.env['ir.values'].get_default( + 'account.config.settings', 'tab_font') + total_css = self.env['ir.values'].get_default( + 'account.config.settings', 'total_css') + footer_font = self.env['ir.values'].get_default( + 'account.config.settings', 'footer_font') + return { + 'body_font': body_font, + 'num_facture': num_facture, + 'num_facture_font': num_facture_font, + 'nom_client': nom_client, + 'tab_font': tab_font, + 'total_css': total_css, + 'footer_font': footer_font, + } diff --git a/models/res_company.py b/models/res_company.py index 093ae20..62a7637 100644 --- a/models/res_company.py +++ b/models/res_company.py @@ -1,20 +1,23 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api + class LeFilamentCompany(models.Model): _inherit = 'res.company' - + formation = fields.Char('N° Organisme de formation') company_type = fields.Char('Type de société') - + @api.multi def edit_external_header(self): - return self._prepare_report_view_action('lefilament_generic_reports.report_layout_header') - + return self._prepare_report_view_action( + 'lefilament_generic_reports.report_layout_header') + @api.multi def edit_external_footer(self): - return self._prepare_report_view_action('lefilament_generic_reports.report_layout_header') \ No newline at end of file + return self._prepare_report_view_action( + 'lefilament_generic_reports.report_layout_header') diff --git a/models/sale_config_settings.py b/models/sale_config_settings.py index 20b5122..05ed49e 100644 --- a/models/sale_config_settings.py +++ b/models/sale_config_settings.py @@ -1,48 +1,58 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models class LeFilamentSaleConfiguration(models.TransientModel): - _inherit = 'sale.config.settings' - - body_font = fields.Text('Body Font', default="font-family: 'DejaVu Sans';") - num_facture = fields.Text('Invoice Num CSS', default="background-color: #00B495;\ncolor: #fff;") - num_facture_font = fields.Text('Invoice Num Font', default="font-family: 'Helvetica';") - nom_client = fields.Text('Customer Name CSS', default="color: #00B495;\nfont-weight: 700;") - tab_font = fields.Text('Tab Font', default="font-family: 'Helvetica';") - total_css = fields.Text('Total CSS', default="background-color: #00B495;\ncolor: #fff;") - footer_font = fields.Text('Footer Font', default="font-family: 'Lato';") - - - @api.multi - def set_body_font(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'body_font', self.body_font) - - @api.multi - def set_num_facture(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'num_facture', self.num_facture) - - @api.multi - def set_num_facture_font(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'num_facture_font', self.num_facture_font) - - @api.multi - def set_nom_client(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'nom_client', self.nom_client) - - @api.multi - def set_tab_font(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'tab_font', self.tab_font) - - @api.multi - def set_total_css(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'total_css', self.total_css) - - @api.multi - def set_body_font(self): - return self.env['ir.values'].sudo().set_default('sale.config.settings', 'footer_font', self.footer_font) - + _inherit = 'sale.config.settings' + + body_font = fields.Text('Body Font', default="font-family: 'DejaVu Sans';") + num_facture = fields.Text( + 'Invoice Num CSS', + default="background-color: #00B495;\ncolor: #fff;") + num_facture_font = fields.Text('Invoice Num Font', + default="font-family: 'Helvetica';") + nom_client = fields.Text('Customer Name CSS', + default="color: #00B495;\nfont-weight: 700;") + tab_font = fields.Text('Tab Font', default="font-family: 'Helvetica';") + total_css = fields.Text('Total CSS', + default="background-color: #00B495;\ncolor: #fff;") + footer_font = fields.Text('Footer Font', default="font-family: 'Lato';") + + @api.multi + def set_body_font(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'body_font', self.body_font) + + @api.multi + def set_num_facture(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'num_facture', self.num_facture) + + @api.multi + def set_num_facture_font(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'num_facture_font', self.num_facture_font) + + @api.multi + def set_nom_client(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'nom_client', self.nom_client) + + @api.multi + def set_tab_font(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'tab_font', self.tab_font) + + @api.multi + def set_total_css(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'total_css', self.total_css) + + @api.multi + def set_footer_font(self): + return self.env['ir.values'].sudo().set_default( + 'sale.config.settings', 'footer_font', self.footer_font) diff --git a/models/sale_order.py b/models/sale_order.py index ad037d5..53a2210 100644 --- a/models/sale_order.py +++ b/models/sale_order.py @@ -1,36 +1,44 @@ # -*- coding: utf-8 -*- -# © 2018 Le Filament (<http://www.le-filament.com>) +# © 2018 Le Filament (<https://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api + class LeFilamentDevis(models.Model): - _inherit = 'sale.order' - - lf_note_ref_facture = fields.Text('Note/Reference') - - @api.multi - def _prepare_invoice(self): - values = super(LeFilamentDevis, self)._prepare_invoice() - values.update({'lf_note_ref_facture': self.lf_note_ref_facture}) - return values - - def get_report_variables(self): - body_font = self.env['ir.values'].get_default('sale.config.settings', 'body_font') - num_facture = self.env['ir.values'].get_default('sale.config.settings', 'num_facture') - num_facture_font = self.env['ir.values'].get_default('sale.config.settings', 'num_facture_font') - nom_client = self.env['ir.values'].get_default('sale.config.settings', 'nom_client') - tab_font = self.env['ir.values'].get_default('sale.config.settings', 'tab_font') - total_css = self.env['ir.values'].get_default('sale.config.settings', 'total_css') - footer_font = self.env['ir.values'].get_default('sale.config.settings', 'footer_font') - - return { - 'body_font': body_font, - 'num_facture': num_facture, - 'num_facture_font': num_facture_font, - 'nom_client': nom_client, - 'tab_font': tab_font, - 'total_css': total_css, - 'footer_font': footer_font, - } \ No newline at end of file + _inherit = 'sale.order' + + lf_note_ref_facture = fields.Text('Note/Reference') + + @api.multi + def _prepare_invoice(self): + values = super(LeFilamentDevis, self)._prepare_invoice() + values.update({'lf_note_ref_facture': self.lf_note_ref_facture}) + return values + + def get_report_variables(self): + body_font = self.env['ir.values'].get_default( + 'sale.config.settings', 'body_font') + num_facture = self.env['ir.values'].get_default( + 'sale.config.settings', 'num_facture') + num_facture_font = self.env['ir.values'].get_default( + 'sale.config.settings', 'num_facture_font') + nom_client = self.env['ir.values'].get_default( + 'sale.config.settings', 'nom_client') + tab_font = self.env['ir.values'].get_default( + 'sale.config.settings', 'tab_font') + total_css = self.env['ir.values'].get_default( + 'sale.config.settings', 'total_css') + footer_font = self.env['ir.values'].get_default( + 'sale.config.settings', 'footer_font') + + return { + 'body_font': body_font, + 'num_facture': num_facture, + 'num_facture_font': num_facture_font, + 'nom_client': nom_client, + 'tab_font': tab_font, + 'total_css': total_css, + 'footer_font': footer_font, + } diff --git a/static/src/less/account_lefilament.less b/static/src/less/account_lefilament.less index 087c310..f0d1f1c 100644 --- a/static/src/less/account_lefilament.less +++ b/static/src/less/account_lefilament.less @@ -1,5 +1,7 @@ -/* LARGEUR = 870px */ +/* Copyright 2019 Le Filament (<https://www.le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ +/* LARGEUR = 870px */ @bg_tabheader: #444; @text_tabheader: #fff; diff --git a/templates/report_devis_lefilament.xml b/templates/report_devis_lefilament.xml index 0039af8..39f6a8a 100644 --- a/templates/report_devis_lefilament.xml +++ b/templates/report_devis_lefilament.xml @@ -1,234 +1,202 @@ <?xml version="1.0" encoding="utf-8"?> - <!--Custom report.--> <odoo> - <data> - <template id="report_devis_lefilament" inherit_id="sale.report_saleorder_document"> - <xpath expr="//div[@class='page']" position="replace"> - <div class="page"> - <t t-set="r" t-value="doc.get_report_variables()" /> - - <style type="text/css" > - body, table, td, span, div, p { - <t t-esc="r['body_font']" /> - } - .header-num { - <t t-esc="r['num_facture']" /> - } - .header-num span { - <t t-esc="r['num_facture_font']" /> - } - .header-client-nom { - <t t-esc="r['nom_client']" /> - } - .table-lefilament th, .table-lefilament td span, .table-lefilament-total td span { - <t t-esc="r['tab_font']" /> - } - .table-lefilament-total .total-line { - <t t-esc="r['total_css']" /> - } - .footer { - <t t-esc="r['footer_font']" /> - } - - </style> - - <div class="row header-content"> - <div class="col-xs-6"> - <div class="col-xs-12 header-num bg-color"> - <h3> - <span t-if="doc.state not in ['draft','sent']">COMMANDE </span> - <span t-if="doc.state in ['draft','sent']">DEVIS </span> - <span t-field="doc.name"/> - </h3> - </div> - <div class="col-xs-12 header-date"> - <div class="col-xs-5 date-invoice"> - <t t-if="doc.date_order">Date du devis<br /></t> - <t t-if="doc.date_order"><span t-field="doc.date_order"/></t> - </div> - <div class="col-xs-5 date-invoice"> - <t t-if="doc.validity_date">Date de validité<br /></t> - <t t-if="doc.validity_date"><span t-field="doc.validity_date"/></t> - </div> - </div> - </div> - <div class="col-xs-6"> - <div class="header-address"> - <t t-if="doc.partner_id.parent_id.name"> - <span class="header-client-nom" t-field="doc.partner_id.parent_id.name" /><br/> - </t> - <t t-if="not doc.partner_id.parent_id.name"> - <span class="header-client-nom" t-field="doc.partner_id.name" /><br/> - </t> - <p> - <span t-field="doc.partner_id.street" /> <br/> - <t t-if="doc.partner_id.street2"> - <span t-field="doc.partner_id.street2" /> <br/> - </t> - <span t-field="doc.partner_id.zip" /> <span t-field="doc.partner_id.city" /> - </p> - <p> - <t t-if="doc.partner_id.email"> - <span t-field="doc.partner_id.email" /><br/> - </t> - <t t-if="doc.partner_id.phone"> - <span t-field="doc.partner_id.phone" /><br/> - </t> - <t t-if="doc.partner_id.mobile"> - <span t-field="doc.partner_id.mobile" /> - </t> - </p> - </div> - </div> - </div> - - <hr class="separation-client"/> - - <div class="row"> - <div class="col-xs-6 header-ref"> - <t t-if="doc.lf_note_ref_facture"> - <p class="header-reference">Référence</p> - <p t-field="doc.lf_note_ref_facture"/> - </t> - <t t-if="not doc.lf_note_ref_facture"> - &nbsp; - </t> - </div> - </div> - - <t t-if="doc.lf_note_ref_facture"> - <hr class="separation-client"/> - </t> - - <!-- Is there a discount on at least one line? --> - <t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/> - - <div class="invoice-lines"> - <table class="table table-lefilament"> - <thead> - <tr> - <th class="table-designation">DÉSIGNATION</th> - <th class="text-right">PU HT</th> - <th class="text-right">Qté</th> - <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">REMISE (%)</th> - <th class="prix-total text-right">MONTANT HT</th> - </tr> - </thead> - <tbody class="sale_tbody"> - <tr t-foreach="doc.order_line" t-as="l"> - <td class="table-designation"><span t-field="l.name"/></td> - <td class="text-right text-middle prix-u"> - <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - <td class="text-right text-middle quantite"> - <span t-field="l.product_uom_qty"/> - <span groups="product.group_uom" t-field="l.product_uom"/> - </td> - <td t-if="display_discount" class="text-right text-middle" groups="sale.group_discount_per_so_line"> - <span t-field="l.discount"/> - </td> - <td class="text-right text-middle prix-total"> - <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - </tr> - </tbody> - </table> - </div> - - - - <div class="row"> - <div class="col-xs-12"> - <div class="bpa"> - <t t-if="doc.payment_term_id"> - <strong><u>Conditions de paiement</u></strong><br/> - <span t-field="doc.payment_term_id.note"/> - </t> - <p> - BON POUR ACCORD - CACHET | DATE | SIGNATURE - </p> - </div> - - <div class="total pull-right"> - <table class="table table-lefilament-total"> - <tr> - <td class="total-title prix-u">TOTAL H.T</td> - <td></td> - <td class="total-total text-right"> - <span t-field="doc.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - </tr> - <tr> - <td class="total-title prix-u">TVA</td> - <td></td> - <td class="total-total text-right"> - <span t-field="doc.amount_tax" - t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> - </td> - </tr> - - <tr class="total-line"> - <td class="total-title prix-u">TOTAL</td> - <td></td> - <td class="total-total text-right"> - <span t-field="doc.amount_total" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - </tr> - </table> - </div> - - </div> - </div> - - <p t-if="doc.note" class="commentaire"> - <strong>Commentaire :</strong> <br/><span t-field="doc.note"/> - </p> - - </div> - </xpath> - </template> - - - - <template id="report_devis_layouted_lefilament" inherit_id="sale.report_saleorder_document"> - <xpath expr="//t[@t-foreach='page']" position="replace"> - - <t t-foreach="page" t-as="p"> - <!-- Name of the category --> - <!-- <t t-call="sale.category_template"/> --> - + <data> + <template id="report_devis_lefilament" inherit_id="sale.report_saleorder_document"> + <xpath expr="//div[@class='page']" position="replace"> + <div class="page"> + <t t-set="r" t-value="doc.get_report_variables()" /> + <style type="text/css" > + body, table, td, span, div, p { + <t t-esc="r['body_font']" /> + } + .header-num { + <t t-esc="r['num_facture']" /> + } + .header-num span { + <t t-esc="r['num_facture_font']" /> + } + .header-client-nom { + <t t-esc="r['nom_client']" /> + } + .table-lefilament th, .table-lefilament td span, .table-lefilament-total td span { + <t t-esc="r['tab_font']" /> + } + .table-lefilament-total .total-line { + <t t-esc="r['total_css']" /> + } + .footer { + <t t-esc="r['footer_font']" /> + } + + </style> + <div class="row header-content"> + <div class="col-xs-6"> + <div class="col-xs-12 header-num bg-color"> + <h3> + <span t-if="doc.state not in ['draft','sent']">COMMANDE </span> + <span t-if="doc.state in ['draft','sent']">DEVIS </span> + <span t-field="doc.name"/> + </h3> + </div> + <div class="col-xs-12 header-date"> + <div class="col-xs-5 date-invoice"> + <t t-if="doc.date_order">Date du devis<br /></t> + <t t-if="doc.date_order"><span t-field="doc.date_order"/></t> + </div> + <div class="col-xs-5 date-invoice"> + <t t-if="doc.validity_date">Date de validité<br /></t> + <t t-if="doc.validity_date"><span t-field="doc.validity_date"/></t> + </div> + </div> + </div> + <div class="col-xs-6"> + <div class="header-address"> + <t t-if="doc.partner_id.parent_id.name"> + <span class="header-client-nom" t-field="doc.partner_id.parent_id.name" /><br/> + </t> + <t t-if="not doc.partner_id.parent_id.name"> + <span class="header-client-nom" t-field="doc.partner_id.name" /><br/> + </t> + <p> + <span t-field="doc.partner_id.street" /> <br/> + <t t-if="doc.partner_id.street2"> + <span t-field="doc.partner_id.street2" /> <br/> + </t> + <span t-field="doc.partner_id.zip" /> <span t-field="doc.partner_id.city" /> + </p> + <p> + <t t-if="doc.partner_id.email"> + <span t-field="doc.partner_id.email" /><br/> + </t> + <t t-if="doc.partner_id.phone"> + <span t-field="doc.partner_id.phone" /><br/> + </t> + <t t-if="doc.partner_id.mobile"> + <span t-field="doc.partner_id.mobile" /> + </t> + </p> + </div> + </div> + </div> + <hr class="separation-client"/> + <div class="row"> + <div class="col-xs-6 header-ref"> + <t t-if="doc.lf_note_ref_facture"> + <p class="header-reference">Référence</p> + <p t-field="doc.lf_note_ref_facture"/> + </t> + <t t-if="not doc.lf_note_ref_facture"> + &nbsp; + </t> + </div> + </div> + <t t-if="doc.lf_note_ref_facture"> + <hr class="separation-client"/> + </t> + <!-- Is there a discount on at least one line? --> + <t t-set="display_discount" t-value="any([l.discount for l in doc.order_line])"/> + <div class="invoice-lines"> + <table class="table table-lefilament"> + <thead> + <tr> + <th class="table-designation">DÉSIGNATION</th> + <th class="text-right">PU HT</th> + <th class="text-right">Qté</th> + <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">REMISE (%)</th> + <th class="prix-total text-right">MONTANT HT</th> + </tr> + </thead> + <tbody class="sale_tbody"> + <tr t-foreach="doc.order_line" t-as="l"> + <td class="table-designation"><span t-field="l.name"/></td> + <td class="text-right text-middle prix-u"> + <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + <td class="text-right text-middle quantite"> + <span t-field="l.product_uom_qty"/> + <span groups="product.group_uom" t-field="l.product_uom"/> + </td> + <td t-if="display_discount" class="text-right text-middle" groups="sale.group_discount_per_so_line"> + <span t-field="l.discount"/> + </td> + <td class="text-right text-middle prix-total"> + <span t-field="l.price_subtotal" + t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + </tr> + </tbody> + </table> + </div> + <div class="row"> + <div class="col-xs-12"> + <div class="bpa"> + <t t-if="doc.payment_term_id"> + <strong><u>Conditions de paiement</u></strong><br/> + <span t-field="doc.payment_term_id.note"/> + </t> + <p> + BON POUR ACCORD - CACHET | DATE | SIGNATURE + </p> + </div> + <div class="total pull-right"> + <table class="table table-lefilament-total"> + <tr> + <td class="total-title prix-u">TOTAL H.T</td> + <td></td> + <td class="total-total text-right"> + <span t-field="doc.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + </tr> + <tr> + <td class="total-title prix-u">TVA</td> + <td></td> + <td class="total-total text-right"> + <span t-field="doc.amount_tax" + t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/> + </td> + </tr> + <tr class="total-line"> + <td class="total-title prix-u">TOTAL</td> + <td></td> + <td class="total-total text-right"> + <span t-field="doc.amount_total" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + </tr> + </table> + </div> + </div> + </div> + <p t-if="doc.note" class="commentaire"> + <strong>Commentaire :</strong> <br/><span t-field="doc.note"/> + </p> + </div> + </xpath> + </template> + + <template id="report_devis_layouted_lefilament" inherit_id="sale.report_saleorder_document"> + <xpath expr="//t[@t-foreach='page']" position="replace"> + <t t-foreach="page" t-as="p"> <!-- Lines associated --> <t t-foreach="p['lines']" t-as="l"> - <tr> - <td class="table-designation"><span t-field="l.name"/></td> - <td class="text-middle table-prix-u"> - <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - <td class="text-middle table-quantite"> - <span t-field="l.product_uom_qty"/> - <span t-field="l.uom_id" groups="product.group_uom"/> - </td> - <td t-if="display_discount" class="text-center text-middle" groups="sale.group_discount_per_so_line"> - <span t-field="l.discount"/> - </td> - <!-- <td> - <span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/> - </td> --> - <td class="text-middle prix-total"> - <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> - </td> - </tr> - </t> - - <!-- Subtotal --> - <!-- <t t-call="sale.subtotal_template"/> --> - - <!-- Separator --> - <!-- <t t-call="sale.separator_template"/> --> - + <tr> + <td class="table-designation"><span t-field="l.name"/></td> + <td class="text-middle table-prix-u"> + <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + <td class="text-middle table-quantite"> + <span t-field="l.product_uom_qty"/> + <span t-field="l.uom_id" groups="product.group_uom"/> + </td> + <td t-if="display_discount" class="text-center text-middle" groups="sale.group_discount_per_so_line"> + <span t-field="l.discount"/> + </td> + <td class="text-middle prix-total"> + <span t-field="l.price_subtotal" + t-field-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/> + </td> + </tr> + </t> <!-- Pagebreak --> <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True"> <t t-if="p_index < p_size - 1"> @@ -237,27 +205,22 @@ </table> <p style="page-break-before:always;"> </p> <table class="table table-condensed"> - <thead> - <tr> - <th class="table-designation">DÉSIGNATION</th> - <th class="text-right">PU HT</th> - <th class="text-right">Qté</th> - <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">REMISE (%)</th> - <th class="prix-total text-right">MONTANT HT</th> - </tr> - </thead> + <tr> + <th class="table-designation">DÉSIGNATION</th> + <th class="text-right">PU HT</th> + <th class="text-right">Qté</th> + <th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">REMISE (%)</th> + <th class="prix-total text-right">MONTANT HT</th> + </tr> + </thead> <tbody> </t> </t> </t> - - </xpath> - - </template> - - - </data> + </xpath> + </template> + </data> </odoo> diff --git a/templates/report_facture_lefilament.xml b/templates/report_facture_lefilament.xml index 3434dde..efaa70a 100644 --- a/templates/report_facture_lefilament.xml +++ b/templates/report_facture_lefilament.xml @@ -2,249 +2,234 @@ <!--Custom report.--> <odoo> - <data> - <template id="report_factures_lefilament" inherit_id="sale.report_invoice_document_inherit_sale"> - <xpath expr="//div[@class='page']" position="replace"> - <div class="page"> - <t t-set="r" t-value="o.get_report_variables()" /> - - <style type="text/css" > - body, table, td, span, div, p { - <t t-esc="r['body_font']" /> - } - .header-num { - <t t-esc="r['num_facture']" /> - } - .header-num span { - <t t-esc="r['num_facture_font']" /> - } - .header-client-nom { - <t t-esc="r['nom_client']" /> - } - .table-lefilament th, .table-lefilament td span, .table-lefilament-total td span { - <t t-esc="r['tab_font']" /> - } - .table-lefilament-total .total-line { - <t t-esc="r['total_css']" /> - } - .footer { - <t t-esc="r['footer_font']" /> - } - - </style> - - <div class="row header-content"> - <div class="col-xs-6"> - <div class="col-xs-12 header-num bg-color"> - <h3> - <span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">FACTURE</span> - <span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span> - <span t-if="o.type == 'out_invoice' and o.state == 'draft'">BROUILLON</span> - <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">FACTURE ANNULÉE</span> - <span t-if="o.type == 'out_refund'">AVOIR</span> - <span t-if="o.type == 'in_refund'">Vendor Refund</span> - <span t-if="o.type == 'in_invoice'">Vendor Bill</span> - <span t-field="o.number"/> - </h3> - </div> - <div class="col-xs-12 header-date"> - <div class="col-xs-5 date-invoice"> - <t t-if="o.date_invoice">Date de facturation<br /></t> - <t t-if="o.date_invoice"><span t-field="o.date_invoice"/></t> - </div> - <div class="col-xs-5 date-invoice"> - <t t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Date d'échéance <br /></t> - <t t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')"><span t-field="o.date_due"/></t> - </div> - </div> - </div> - <div class="col-xs-6"> - <div class="header-address"> - <t t-if="o.partner_id.parent_id.name"> - <span class="header-client-nom" t-field="o.partner_id.parent_id.name" /><br/> - </t> - <t t-if="not o.partner_id.parent_id.name"> - <span class="header-client-nom" t-field="o.partner_id.name" /><br/> - </t> - <p> - <span t-field="o.partner_id.street" /> <br/> - <t t-if="o.partner_id.street2"> - <span t-field="o.partner_id.street2" /> <br/> - </t> - <span t-field="o.partner_id.zip" /> <span t-field="o.partner_id.city" /> - </p> - <p> - <t t-if="o.partner_id.email"> - <span t-field="o.partner_id.email" /><br/> - </t> - <t t-if="o.partner_id.phone"> - <span t-field="o.partner_id.phone" /><br/> - </t> - <t t-if="o.partner_id.mobile"> - <span t-field="o.partner_id.mobile" /> - </t> - </p> - </div> - </div> - </div> - - <hr class="separation-client"/> - - <div class="row"> - <div class="col-xs-6 header-ref"> - <t t-if="o.lf_note_ref_facture"> - <p class="header-reference">Référence</p> - <p t-field="o.lf_note_ref_facture"/> - </t> - <t t-if="not o.lf_note_ref_facture"> - &nbsp; - </t> - </div> - </div> - - <t t-if="o.lf_note_ref_facture"> - <hr class="separation-client"/> - </t> - - <!-- 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])"/> - - <div class="invoice-lines"> - <table class="table table-lefilament"> - <thead> - <tr> - <th class="table-designation">DÉSIGNATION</th> - <th class="text-right">PU HT</th> - <th class="text-right">Qté</th> - <th class="text-right" t-if="display_discount" groups="sale.group_discount_per_so_line">REMISE (%)</th> - <th class="prix-total text-right">MONTANT HT</th> - </tr> - </thead> - <tbody class="invoice_tbody"> - <tr t-foreach="o.invoice_line_ids" t-as="l"> - <td class="table-designation"><span t-field="l.name"/></td> - <td class="text-right text-middle prix-u"> - <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - <td class="text-right text-middle quantite"> - <span t-field="l.quantity"/> - <span t-field="l.uom_id" groups="product.group_uom"/> - </td> - <td t-if="display_discount" class="text-right text-middle" groups="sale.group_discount_per_so_line"> - <span t-field="l.discount"/> - </td> - <td class="text-right text-middle prix-total"> - <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - </tr> - </tbody> - </table> - </div> - - <div class="row"> - <div class="col-xs-12"> - <div class="remarques"> - <t t-if="o.payment_term_id"> - <strong><u>Conditions de paiement</u></strong><br/> - <span t-field="o.payment_term_id.note"/> - </t> - - <p t-if="o.fiscal_position_id.note"> - <strong>Fiscal Position Remark:</strong> - <span t-field="o.fiscal_position_id.note"/> - </p> - &nbsp; - </div> - <div class="total pull-right"> - <table class="table table-lefilament-total"> - <tr> - <td class="total-title prix-u">TOTAL H.T</td> - <td></td> - <td class="total-total text-right"> - <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - </tr> - <t t-foreach="o.tax_line_ids" t-as="t"> - <tr> - <td class="total-title prix-u">TVA</td> - <td class="text-right"><span t-esc="'%.1f'%t.tax_id.amount" /> %</td> - <td class="total-total text-right"> - <span t-field="t.amount" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - </tr> - </t> - <tr class="total-line"> - <td class="total-title prix-u">TOTAL</td> - <td></td> - <td class="total-total text-right"> - <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - </tr> - </table> - </div> - </div> - </div> - - <p t-if="o.comment" class="commentaire"><strong>Commentaire :</strong> <br/><span t-field="o.comment"/></p> - </div> - </xpath> - - </template> - - - <template id="report_factures_layouted_lefilament" inherit_id="sale.report_invoice_layouted"> - <xpath expr="//t[@t-foreach='o.order_lines_layouted()']" position="replace"> - <t groups="sale.group_sale_layout" t-foreach="o.order_lines_layouted()" t-as="p"> - - <!-- Lines associated --> - <t t-foreach="p['lines']" t-as="l"> - <tr> - <td class="table-designation"><span t-field="l.name"/></td> - <td class="text-middle prix-u"> - <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - <td class="text-middle quantite"> - <span t-field="l.quantity"/> - <span t-field="l.uom_id" groups="product.group_uom"/> - </td> - <td t-if="display_discount" class="text-middle" groups="sale.group_discount_per_so_line"> - <span t-field="l.discount"/> - </td> - <td class="text-middle prix-total"> - <span t-field="l.price_subtotal" - t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> - </td> - </tr> - </t> - - <!-- Pagebreak --> - <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True"> - <t t-if="p_index < p_size - 1"> - - </tbody> - </table> - <p style="page-break-before:always;"> </p> - <table class="table table-condensed"> - - <thead> - <tr> - <th class="table-designation">DÉSIGNATION</th> - <th class="text-right">PU HT</th> - <th class="text-right">Qté</th> - <th class="text-right" t-if="display_discount" groups="sale.group_discount_per_so_line">REMISE (%)</th> - <th class="prix-total text-right">MONTANT HT</th> - </tr> - </thead> - <tbody> - - </t> - </t> - </t> - </xpath> - - </template> - - </data> + <data> + <template id="report_factures_lefilament" inherit_id="sale.report_invoice_document_inherit_sale"> + <xpath expr="//div[@class='page']" position="replace"> + <div class="page"> + <t t-set="r" t-value="o.get_report_variables()" /> + <style type="text/css" > + body, table, td, span, div, p { + <t t-esc="r['body_font']" /> + } + .header-num { + <t t-esc="r['num_facture']" /> + } + .header-num span { + <t t-esc="r['num_facture_font']" /> + } + .header-client-nom { + <t t-esc="r['nom_client']" /> + } + .table-lefilament th, .table-lefilament td span, .table-lefilament-total td span { + <t t-esc="r['tab_font']" /> + } + .table-lefilament-total .total-line { + <t t-esc="r['total_css']" /> + } + .footer { + <t t-esc="r['footer_font']" /> + } + + </style> + <div class="row header-content"> + <div class="col-xs-6"> + <div class="col-xs-12 header-num bg-color"> + <h3> + <span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">FACTURE</span> + <span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span> + <span t-if="o.type == 'out_invoice' and o.state == 'draft'">BROUILLON</span> + <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">FACTURE ANNULÉE</span> + <span t-if="o.type == 'out_refund'">AVOIR</span> + <span t-if="o.type == 'in_refund'">Vendor Refund</span> + <span t-if="o.type == 'in_invoice'">Vendor Bill</span> + <span t-field="o.number"/> + </h3> + </div> + <div class="col-xs-12 header-date"> + <div class="col-xs-5 date-invoice"> + <t t-if="o.date_invoice">Date de facturation<br /></t> + <t t-if="o.date_invoice"><span t-field="o.date_invoice"/></t> + </div> + <div class="col-xs-5 date-invoice"> + <t t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Date d'échéance <br /></t> + <t t-if="o.date_due and o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')"><span t-field="o.date_due"/></t> + </div> + </div> + </div> + <div class="col-xs-6"> + <div class="header-address"> + <t t-if="o.partner_id.parent_id.name"> + <span class="header-client-nom" t-field="o.partner_id.parent_id.name" /><br/> + </t> + <t t-if="not o.partner_id.parent_id.name"> + <span class="header-client-nom" t-field="o.partner_id.name" /><br/> + </t> + <p> + <span t-field="o.partner_id.street" /> <br/> + <t t-if="o.partner_id.street2"> + <span t-field="o.partner_id.street2" /> <br/> + </t> + <span t-field="o.partner_id.zip" /> <span t-field="o.partner_id.city" /> + </p> + <p> + <t t-if="o.partner_id.email"> + <span t-field="o.partner_id.email" /><br/> + </t> + <t t-if="o.partner_id.phone"> + <span t-field="o.partner_id.phone" /><br/> + </t> + <t t-if="o.partner_id.mobile"> + <span t-field="o.partner_id.mobile" /> + </t> + </p> + </div> + </div> + </div> + <hr class="separation-client"/> + <div class="row"> + <div class="col-xs-6 header-ref"> + <t t-if="o.lf_note_ref_facture"> + <p class="header-reference">Référence</p> + <p t-field="o.lf_note_ref_facture"/> + </t> + <t t-if="not o.lf_note_ref_facture"> + &nbsp; + </t> + </div> + </div> + <t t-if="o.lf_note_ref_facture"> + <hr class="separation-client"/> + </t> + <!-- 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])"/> + <div class="invoice-lines"> + <table class="table table-lefilament"> + <thead> + <tr> + <th class="table-designation">DÉSIGNATION</th> + <th class="text-right">PU HT</th> + <th class="text-right">Qté</th> + <th class="text-right" t-if="display_discount" groups="sale.group_discount_per_so_line">REMISE (%)</th> + <th class="prix-total text-right">MONTANT HT</th> + </tr> + </thead> + <tbody class="invoice_tbody"> + <tr t-foreach="o.invoice_line_ids" t-as="l"> + <td class="table-designation"><span t-field="l.name"/></td> + <td class="text-right text-middle prix-u"> + <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + <td class="text-right text-middle quantite"> + <span t-field="l.quantity"/> + <span t-field="l.uom_id" groups="product.group_uom"/> + </td> + <td t-if="display_discount" class="text-right text-middle" groups="sale.group_discount_per_so_line"> + <span t-field="l.discount"/> + </td> + <td class="text-right text-middle prix-total"> + <span t-field="l.price_subtotal" + t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + </tr> + </tbody> + </table> + </div> + <div class="row"> + <div class="col-xs-12"> + <div class="remarques"> + <t t-if="o.payment_term_id"> + <strong><u>Conditions de paiement</u></strong><br/> + <span t-field="o.payment_term_id.note"/> + </t> + + <p t-if="o.fiscal_position_id.note"> + <strong>Fiscal Position Remark:</strong> + <span t-field="o.fiscal_position_id.note"/> + </p> + &nbsp; + </div> + <div class="total pull-right"> + <table class="table table-lefilament-total"> + <tr> + <td class="total-title prix-u">TOTAL H.T</td> + <td></td> + <td class="total-total text-right"> + <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + </tr> + <t t-foreach="o.tax_line_ids" t-as="t"> + <tr> + <td class="total-title prix-u">TVA</td> + <td class="text-right"><span t-esc="'%.1f'%t.tax_id.amount" /> %</td> + <td class="total-total text-right"> + <span t-field="t.amount" + t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + </tr> + </t> + <tr class="total-line"> + <td class="total-title prix-u">TOTAL</td> + <td></td> + <td class="total-total text-right"> + <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + </tr> + </table> + </div> + </div> + </div> + <p t-if="o.comment" class="commentaire"><strong>Commentaire :</strong> <br/><span t-field="o.comment"/></p> + </div> + </xpath> + </template> + <template id="report_factures_layouted_lefilament" inherit_id="sale.report_invoice_layouted"> + <xpath expr="//t[@t-foreach='o.order_lines_layouted()']" position="replace"> + <t groups="sale.group_sale_layout" t-foreach="o.order_lines_layouted()" t-as="p"> + + <!-- Lines associated --> + <t t-foreach="p['lines']" t-as="l"> + <tr> + <td class="table-designation"><span t-field="l.name"/></td> + <td class="text-middle prix-u"> + <span t-field="l.price_unit" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + <td class="text-middle quantite"> + <span t-field="l.quantity"/> + <span t-field="l.uom_id" groups="product.group_uom"/> + </td> + <td t-if="display_discount" class="text-middle" groups="sale.group_discount_per_so_line"> + <span t-field="l.discount"/> + </td> + <td class="text-middle prix-total"> + <span t-field="l.price_subtotal" + t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> + </td> + </tr> + </t> + <!-- Pagebreak --> + <t t-if="'pagebreak' in p['category'] and p['category'].pagebreak is True"> + <t t-if="p_index < p_size - 1"> + + </tbody> + </table> + <p style="page-break-before:always;"> </p> + <table class="table table-condensed"> + + <thead> + <tr> + <th class="table-designation">DÉSIGNATION</th> + <th class="text-right">PU HT</th> + <th class="text-right">Qté</th> + <th class="text-right" t-if="display_discount" groups="sale.group_discount_per_so_line">REMISE (%)</th> + <th class="prix-total text-right">MONTANT HT</th> + </tr> + </thead> + <tbody> + + </t> + </t> + </t> + </xpath> + </template> + </data> </odoo> diff --git a/templates/report_layout_footer.xml b/templates/report_layout_footer.xml index cd77e7e..45fef21 100644 --- a/templates/report_layout_footer.xml +++ b/templates/report_layout_footer.xml @@ -6,33 +6,25 @@ <div class="footer-conditions"> Conformément à l'article L 441-6 du Code de commerce, des pénalités de retard sont dues à défaut de règlement le jour suivant la date de paiement qui figure sur la facture, le taux d'intérêt de ces pénalités de retard est de 3 fois le taux d'intérêt légal. Indemnités pour frais de recouvrement en cas de retard de paiement : 40€ sauf frais supplémentaires </div> - <div class="text-center" style="border-top: 1px solid #eee; padding-top: 2px;"> <t t-if="not company.custom_footer" > <t t-set="company" t-value="company.sudo()"/> - <span t-field="company.name"/> <t t-if="company.company_type"> - <span t-field="company.company_type"/></t> <t t-if="company.street"> | <span t-field="company.street"/>,</t> <t t-if="company.zip"> <span t-field="company.zip"/></t> <t t-if="company.city"> <span t-field="company.city"/></t> - <br /> - <t t-if="company.siret"> SIRET : <span t-field="company.siret"/></t> <t t-if="company.ape"> | Code APE : <span t-field="company.ape"/></t> <t t-if="company.company_registry"> | R.C.S : <span t-field="company.company_registry"/></t> <t t-if="company.vat"> | TVA Intracommunautaire : <span t-field="company.vat"/></t> - <br /> - <t t-if="company.formation">Organisme de Formation enregistré sous le numéro <span t-field="company.formation"/>. Cet enregistrement ne vaut pas agrément de l’État<br /></t> - <t t-if="company.email">Contact : <span t-field="company.email"/></t> <t t-if="company.phone"> | Téléphone : <span t-field="company.phone"/></t> <t t-if="company.website"> | Site web : <span t-field="company.website"/></t> </t> - <ul t-if="not company.custom_footer" class="list-inline" name="financial_infos"> <t t-set="is_first" t-value="True"/> <t t-foreach="company.bank_journal_ids" t-as="journal"> @@ -44,11 +36,9 @@ </t> </t> </ul> - <t t-if="company.custom_footer"> <span t-raw="company.rml_footer"/> </t> - <ul class="list-inline"> <li>Page:</li> <li><span class="page"/></li> @@ -59,4 +49,4 @@ </div> </xpath> </template> -</data> \ No newline at end of file +</data> diff --git a/templates/report_layout_header.xml b/templates/report_layout_header.xml index 56cb415..d1a999c 100644 --- a/templates/report_layout_header.xml +++ b/templates/report_layout_header.xml @@ -69,4 +69,4 @@ </div> </xpath> </template> -</data> \ No newline at end of file +</data> diff --git a/views/account_config_settings.xml b/views/account_config_settings.xml index 723d21b..e4c112b 100644 --- a/views/account_config_settings.xml +++ b/views/account_config_settings.xml @@ -1,31 +1,33 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <record id="lefilament_view_account_config" model="ir.ui.view"> - <field name="name">lefilament.account.settings</field> - <field name="model">account.config.settings</field> - <field name="inherit_id" ref="account.view_account_config_settings"/> - <field name="arch" type="xml"> - <xpath expr="//form" position="inside"> - <group string="Configuration des Rapports"> - <p colspan="4">Le champs sont à remplir comme du CSS<br /> - Les typos disponibles sont : Lato, DejaVu Sans, DejaVu Serif, Roboto, Oswald, Helvetica</p> - <group string="Général"> - <field name="body_font" /> - <field name="footer_font" /> - </group> - <group string="Num Facture"> - <field name="num_facture" /> - <field name="num_facture_font" /> - </group> - <group string="Client"> - <field name="nom_client" /> - </group> - <group string="Tableau"> - <field name="tab_font" /> - <field name="total_css" /> - </group> + <record id="lefilament_view_account_config" model="ir.ui.view"> + <field name="name">lefilament.account.settings</field> + <field name="model">account.config.settings</field> + <field name="inherit_id" ref="account.view_account_config_settings"/> + <field name="arch" type="xml"> + <xpath expr="//form" position="inside"> + <group string="Configuration des Rapports"> + <p colspan="4">Le champs sont à remplir comme du CSS<br /> + Les typos disponibles sont : Lato, DejaVu Sans, DejaVu Serif, Roboto, Oswald, Helvetica</p> + <group string="Général"> + <field name="body_font" /> + <field name="footer_font" /> </group> - </xpath> - </field> - </record> + <group string="Num Facture"> + <field name="num_facture" /> + <field name="num_facture_font" /> + </group> + <group string="Client"> + <field name="nom_client" /> + </group> + <group string="Tableau"> + <field name="tab_font" /> + <field name="total_css" /> + </group> + </group> + </xpath> + </field> + </record> </odoo> diff --git a/views/lefilament_company_view.xml b/views/lefilament_company_view.xml index 5a4aef0..85f6140 100644 --- a/views/lefilament_company_view.xml +++ b/views/lefilament_company_view.xml @@ -1,21 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> - +<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - - <record id="view_form_lefilament_company_inherited" model="ir.ui.view"> - <field name="name">Company Le Filament 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='website']" position="after"> - <field name="company_type" /> - </xpath> - <xpath expr="//field[@name='currency_id']" position="before"> - <field name="formation" /> - </xpath> - </field> - </record> - - </data> -</odoo> \ No newline at end of file + <data> + <record id="view_form_lefilament_company_inherited" model="ir.ui.view"> + <field name="name">Company Le Filament 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='website']" position="after"> + <field name="company_type" /> + </xpath> + <xpath expr="//field[@name='currency_id']" position="before"> + <field name="formation" /> + </xpath> + </field> + </record> + </data> +</odoo> diff --git a/views/lefilament_facture_view.xml b/views/lefilament_facture_view.xml index 6383138..29ec3b0 100644 --- a/views/lefilament_facture_view.xml +++ b/views/lefilament_facture_view.xml @@ -1,56 +1,56 @@ <?xml version="1.0" encoding="utf-8"?> - +<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - <record id="view_form_lefilament_facture_inherited" model="ir.ui.view"> - <field name="name">Facture Le Filament Form</field> - <field name="model">account.invoice</field> - <field name="inherit_id" ref="account.invoice_form"/> - <field name="arch" type="xml"> - <xpath expr="//notebook" position="before"> - <group> - <field name="lf_note_ref_facture" string="Référence client - Note"/> - </group> - </xpath> - <xpath expr="//tree" position="attributes"> - <attribute name="editable"></attribute> - </xpath> - </field> - </record> + <data> + <record id="view_form_lefilament_facture_inherited" model="ir.ui.view"> + <field name="name">Facture Le Filament Form</field> + <field name="model">account.invoice</field> + <field name="inherit_id" ref="account.invoice_form"/> + <field name="arch" type="xml"> + <xpath expr="//notebook" position="before"> + <group> + <field name="lf_note_ref_facture" string="Référence client - Note"/> + </group> + </xpath> + <xpath expr="//tree" position="attributes"> + <attribute name="editable"></attribute> + </xpath> + </field> + </record> - <!-- AJOUT DU CHAMP "ARTICLE COMMENTAIRE" SUR LA FORM VIEW DEVIS --> - <record id="view_form_lefilament_devis_inherited" model="ir.ui.view"> - <field name="name">Devis Le Filament Form</field> - <field name="model">sale.order</field> - <field name="inherit_id" ref="sale.view_order_form"/> - <field name="arch" type="xml"> - <xpath expr="//field[@name='partner_id']" position="after"> - <field name="lf_note_ref_facture" /> - </xpath> - </field> - </record> + <!-- AJOUT DU CHAMP "ARTICLE COMMENTAIRE" SUR LA FORM VIEW DEVIS --> + <record id="view_form_lefilament_devis_inherited" model="ir.ui.view"> + <field name="name">Devis Le Filament Form</field> + <field name="model">sale.order</field> + <field name="inherit_id" ref="sale.view_order_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='partner_id']" position="after"> + <field name="lf_note_ref_facture" /> + </xpath> + </field> + </record> - <template id="assets_common" name="lefilament_facture_assets" inherit_id="report.assets_common"> + <template id="assets_common" name="lefilament_facture_assets" inherit_id="report.assets_common"> <xpath expr="." position="inside"> - <link rel="stylesheet" href="/lefilament_generic_reports/static/src/less/account_lefilament.less"/> - <link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet" /> - <link href="https://fonts.googleapis.com/css?family=Oswald:300,400,700" rel="stylesheet" /> + <link rel="stylesheet" href="/lefilament_generic_reports/static/src/less/account_lefilament.less"/> + <link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet" /> + <link href="https://fonts.googleapis.com/css?family=Oswald:300,400,700" rel="stylesheet" /> </xpath> </template> <record id="paperformat_lefilament" model="report.paperformat"> - <field name="name">Facture/Devis Le Filament</field> - <field name="default" eval="True"/> - <field name="format">A4</field> - <field name="orientation">Portrait</field> - <field name="margin_top">30</field> - <field name="margin_bottom">28</field> - <field name="margin_left">0</field> - <field name="margin_right">0</field> - <field name="header_line" eval="True"/> - <field name="header_spacing">32</field> - <field name="dpi">90</field> - </record> - - </data> + <field name="name">Facture/Devis Le Filament</field> + <field name="default" eval="True"/> + <field name="format">A4</field> + <field name="orientation">Portrait</field> + <field name="margin_top">30</field> + <field name="margin_bottom">28</field> + <field name="margin_left">0</field> + <field name="margin_right">0</field> + <field name="header_line" eval="True"/> + <field name="header_spacing">32</field> + <field name="dpi">90</field> + </record> + </data> </odoo> diff --git a/views/sale_config_settings.xml b/views/sale_config_settings.xml index 0589eaa..61ebfe4 100644 --- a/views/sale_config_settings.xml +++ b/views/sale_config_settings.xml @@ -1,31 +1,33 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <record id="lefilament_view_sale_config" model="ir.ui.view"> - <field name="name">lefilament.sale.settings</field> - <field name="model">sale.config.settings</field> - <field name="inherit_id" ref="sales_team.view_sale_config_settings"/> - <field name="arch" type="xml"> - <xpath expr="//form" position="inside"> - <group string="Configuration des Rapports"> - <p colspan="4">Le champs sont à remplir comme du CSS<br /> - Les typos disponibles sont : Lato, DejaVu Sans, DejaVu Serif, Roboto, Oswald, Helvetica</p> - <group string="Général"> - <field name="body_font" /> - <field name="footer_font" /> - </group> - <group string="Num Facture"> - <field name="num_facture" /> - <field name="num_facture_font" /> - </group> - <group string="Client"> - <field name="nom_client" /> - </group> - <group string="Tableau"> - <field name="tab_font" /> - <field name="total_css" /> - </group> + <record id="lefilament_view_sale_config" model="ir.ui.view"> + <field name="name">lefilament.sale.settings</field> + <field name="model">sale.config.settings</field> + <field name="inherit_id" ref="sales_team.view_sale_config_settings"/> + <field name="arch" type="xml"> + <xpath expr="//form" position="inside"> + <group string="Configuration des Rapports"> + <p colspan="4">Le champs sont à remplir comme du CSS<br /> + Les typos disponibles sont : Lato, DejaVu Sans, DejaVu Serif, Roboto, Oswald, Helvetica</p> + <group string="Général"> + <field name="body_font" /> + <field name="footer_font" /> </group> - </xpath> - </field> - </record> + <group string="Num Facture"> + <field name="num_facture" /> + <field name="num_facture_font" /> + </group> + <group string="Client"> + <field name="nom_client" /> + </group> + <group string="Tableau"> + <field name="tab_font" /> + <field name="total_css" /> + </group> + </group> + </xpath> + </field> + </record> </odoo> -- GitLab