diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb8b5ef27a4408c9767c962d0f4e70fb99715061..732d0c4a644eb444d6b4385643ff32fab19fab52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: | # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| # We don't want to mess with tool-generated files - .svg$|/tests/([^/]+/)?cassettes/| + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| # Library files can have extraneous formatting (even minimized) /static/(src/)?lib/| # Repos using Sphinx to generate docs don't need prettying @@ -26,10 +26,12 @@ repos: language: fail files: "\\.rej$" - repo: https://github.com/oca/maintainer-tools - rev: ab1d7f6 + rev: 7d8a9f9ad73db0976fb03cbee43d953bc29b89e9 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons + - id: oca-fix-manifest-website + args: ["https://le-filament.com"] - repo: https://github.com/myint/autoflake rev: v1.4 hooks: @@ -42,11 +44,11 @@ repos: - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.1.2 + rev: v2.6.2 hooks: - id: prettier name: prettier (with plugin-xml) @@ -57,7 +59,7 @@ repos: - --plugin=@prettier/plugin-xml files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.8.1 + rev: v8.15.0 hooks: - id: eslint verbose: true @@ -65,7 +67,7 @@ repos: - --color - --fix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.2.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -87,12 +89,12 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/asottile/pyupgrade - rev: v2.7.2 + rev: v2.32.1 hooks: - id: pyupgrade args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort - rev: 5.5.1 + rev: 5.10.1 hooks: - id: isort name: isort except __init__.py @@ -100,13 +102,13 @@ repos: - --settings=. exclude: /__init__\.py$ - repo: https://gitlab.com/PyCQA/flake8 - rev: 3.8.3 + rev: 3.9.2 hooks: - id: flake8 name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - repo: https://github.com/PyCQA/pylint - rev: pylint-2.5.3 + rev: v2.11.1 hooks: - id: pylint name: pylint with optional checks @@ -115,7 +117,7 @@ repos: - --exit-zero verbose: true additional_dependencies: &pylint_deps - - pylint-odoo==3.5.0 + - pylint-odoo==5.0.5 - id: pylint name: pylint with mandatory checks args: diff --git a/__manifest__.py b/__manifest__.py index 7f586a7fbf20b0ea2d6b6432bccd0be1e668a24b..28d253bdc72a92f79a7d669fd3a8f9b2c19b5944 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -7,14 +7,18 @@ "depends": ["web", "ap_sale_project"], "qweb": [], "data": [ + # datas "data/paperformat_data.xml", - "views/res_company_views.xml", - "views/report_templates.xml", - "views/report_sale.xml", - "views/report_account.xml", "data/report_layout.xml", - "views/report_compositions.xml", - "views/report_composition_templates.xml", - "views/report_delivery_ap_template.xml", + "data/ir_actions_report.xml", + # templates + "templates/assets.xml", + "templates/report_layout.xml", + "templates/report_sale.xml", + "templates/report_account.xml", + "templates/report_composition.xml", + "templates/report_delivery_ap_template.xml", + # views + "views/res_company_views.xml", ], } diff --git a/views/report_compositions.xml b/data/ir_actions_report.xml similarity index 95% rename from views/report_compositions.xml rename to data/ir_actions_report.xml index 3e283b249b81581ced4b6cbe5cf6cdd8fd66d225..2bce5468d9a6da98742e99896bd24d12e000be66 100644 --- a/views/report_compositions.xml +++ b/data/ir_actions_report.xml @@ -5,7 +5,6 @@ <record id="action_compostion" model="ir.actions.report"> <field name="name">Compositions</field> <field name="model">sale.order</field> -<!-- <field name="report_type">qweb-html</field>--> <field name="report_type">qweb-pdf</field> <field name="report_name">ap_report.report_composition</field> <field name="report_file">ap_report.report_composition</field> diff --git a/data/paperformat_data.xml b/data/paperformat_data.xml index bbb10a63e6adba7aa41fecf54db05ec79c087ac1..746d76157b3eb0a8f4e8694b883bb40f93dc91b8 100644 --- a/data/paperformat_data.xml +++ b/data/paperformat_data.xml @@ -13,7 +13,7 @@ <field name="margin_left">7</field> <field name="margin_right">7</field> <field name="header_line" eval="False" /> - <field name="header_spacing">15</field> + <field name="header_spacing">0</field> <field name="dpi">90</field> </record> diff --git a/data/report_layout.xml b/data/report_layout.xml index 6539607d46cf5ed68e3ecc874ff39e646c8974ed..e13f13e007138751adafdd284f16c2147efb7689 100644 --- a/data/report_layout.xml +++ b/data/report_layout.xml @@ -10,12 +10,5 @@ <field name="pdf">/ap_report/static/pdf/preview_generic.pdf</field> </record> - <record id="ap_report_layout_compo" model="report.layout"> - <field name="name">Arbre et Paysage Composition</field> - <field name="sequence">6</field> - <field name="view_id" ref="ap_report.ap_external_layout_generic_compo" /> - <field name="image">/ap_report/static/src/img/preview_generic.png</field> - <field name="pdf">/ap_report/static/pdf/preview_generic.pdf</field> - </record> </data> </odoo> diff --git a/static/src/scss/layout_generic.scss b/static/src/scss/layout_generic.scss index f085882c1f5d2825c4a639bd822eaf084059e1b7..eef3d09e7f44afbe3255e2b44c0aa28b042d1f56 100644 --- a/static/src/scss/layout_generic.scss +++ b/static/src/scss/layout_generic.scss @@ -18,49 +18,30 @@ address .align-items-baseline { font-size: 15px !important; } -.o_report_layout_boxed .row > div > table.table-compo tr:last-child td { - background-color: inherit !important; - color: inherit !important; -} - -.o_report_layout_boxed .row > div > table.table-compo tr:last-child td:first-child { - border-right: 1px solid #495057; -} - -.o_report_layout_boxed table.table-compo tbody tr td { - font-size: 14px !important; - border-top: 1px solid; - border-right: 1px solid #495057; -} - -.o_report_layout_boxed - .row:not(#total) - > div - > table.table-compo - tr:not(:first-child):not(:last-child) - td:last-child { - background-color: inherit !important; -} - .o_report_layout_boxed .table-prepa tbody td { font-size: 17px; border: 1px solid #495057; } -.o_report_layout_boxed - .row:not(#total) - > div - > table.table-compo - tbody - tr:not(:last-child) - td:last-child { - background-color: #fff !important; -} - .o_boxed_footer_compo { font-size: 12px !important; } +/*** + Compositions +***/ +.header_compo, +.footer-compo { + font-size: 12px; +} .o_report_compo { - font-size: 14px !important; + font-size: 12px !important; +} +.table-compo td { + color: #000 !important; + font-size: 11px; + border: thin solid #000; + padding: 2px; + padding-left: 5px; + padding-right: 5px; } diff --git a/templates/assets.xml b/templates/assets.xml new file mode 100644 index 0000000000000000000000000000000000000000..2bcfb8cad86b27b97fe3ee31e43d42bbdafa633d --- /dev/null +++ b/templates/assets.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <!-- Assets for reports --> + <template id="report_assets_common" inherit_id="web.report_assets_common"> + <xpath expr="." position="inside">--> + <link + rel="stylesheet" + type="text/scss" + href="/ap_report/static/src/scss/layout_generic.scss" + /> + </xpath> + </template> +</odoo> diff --git a/views/report_account.xml b/templates/report_account.xml similarity index 100% rename from views/report_account.xml rename to templates/report_account.xml diff --git a/templates/report_composition.xml b/templates/report_composition.xml new file mode 100644 index 0000000000000000000000000000000000000000..7dc5431ab0e0021d769f08b94ffa9b585b626845 --- /dev/null +++ b/templates/report_composition.xml @@ -0,0 +1,323 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <data> + <!-- Layout Composition--> + <template id="external_layout_generic_compo"> + <div + t-attf-class="header header_compo o_company_#{company.id}_layout" + t-att-style="report_header_style" + > + <div class="row"> + <div class="col-12"> + <!-- Composition titre --> + <div class="row"> + <div class="col-12"> + <h2 class="text-center text-uppercase">Compositions</h2> + </div> + </div> + <!-- Titre devis & adresse --> + <div class="row"> + <!-- Titre devis --> + <div class="col-3"> + <h6> + <t + t-if="not (env.context.get('proforma', False) or is_pro_forma)" + > + <span + t-if="doc.state not in ['draft','sent']" + >Commande n° </span> + <span + t-if="doc.state in ['draft','sent']" + >Devis N° </span> + </t> + <t + t-if="env.context.get('proforma', False) or is_pro_forma" + > + <span>Facture pro-forma n° </span> + </t> + <span t-field="doc.name" /> + </h6> + <p class="m-0">Du <span + t-field="doc.date_order" + t-options='{"widget": "date"}' + /> + </p> + </div> + <!-- Adresse --> + <div class="offset-6 col-3"> + <span t-field="doc.partner_id.name" /><br /> + <t t-if="doc.partner_id.street"> + <span + t-field="doc.partner_id.street" + style="font-weight: bold;" + /><br /></t> + <t t-if="doc.partner_id.street2"><span + t-field="doc.partner_id.street2" + /><br /></t> + <t t-if="doc.partner_id.zip"><span + t-field="doc.partner_id.zip" + /></t> - + <t t-if="doc.partner_id.city"><span + t-field="doc.partner_id.city" + /><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" + /><br /></t> + </div> + </div> + </div> + <!-- logo --> + <div style="position: absolute; top: 0; right: 0;"> + <img + t-if="company.logo" + t-att-src="image_data_uri(company.logo)" + style="max-height: 80px;" + alt="Logo" + /> + </div> + </div> + </div> + <hr /> + + <div + t-attf-class="article o_report_compo o_company_#{company.id}_layout" + t-att-data-oe-model="o and o._name" + t-att-data-oe-id="o and o.id" + t-att-data-oe-lang="o and o.env.context.get('lang')" + > + <t t-raw="0" /> + </div> + <!-- Footer --> + <div t-attf-class="footer footer-compo o_company_#{company.id}_layout"> + <div class="row"> + <div class="col-6"> + <t + t-set="icons" + t-value="o.sale_project_ids.intervention_ids.plant_sequence_ids.product_id.categ_id.filtered(lambda c: c.symbol != False)" + /> + <t t-foreach="icons" t-as="icon"> + <i t-attf-class="fa {{icon.symbol}}" /> + <span t-esc="icon.name" style="padding-left: 5px;" /> + <t t-if="not icon_last"> + <span + style="padding-left: 10px; padding-right: 10px;" + >-</span> + </t> + </t> + </div> + <div class="col-6"> + <div class="text-right"> + Date d’édition : <t + t-esc="datetime.date.today()" + t-options='{"widget": "date"}' + /> + </div> + </div> + </div> + <div class="text-center" style="border-top: 1px solid #ccc;"> + <p class="mb-0" style="padding-top: 4px;"> + <t t-if="company.phone"><span + class="o_force_ltr" + t-field="company.phone" + /></t> + <t t-if="company.email"> - <span t-field="company.email" /></t> + <t t-if="company.website"> - <span + t-field="company.website" + /></t> + <t t-if="company.vat"> - <t + t-esc="company.country_id.vat_label or 'Tax ID'" + />: <span t-field="company.vat" /></t> + <t t-if="company.company_type"><span + t-field="company.company_type" + /></t> + <t t-if="company.siret"> - SIRET: <span + t-field="company.siret" + /></t> + <t t-if="company.ape"> - Code NAF: <span + t-field="company.ape" + /></t> + </p> + <div t-if="report_type == 'pdf'"> + Page: <span class="page" /> / <span class="topage" /> + </div> + </div> + </div> + </template> + + <template id="report_composition_document"> + <t t-call="ap_report.external_layout_compo"> + <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" /> + <div class="page"> + <!-- Projets --> + <t + t-foreach="doc.sale_project_ids.filtered(lambda p: p.intervention_ids)" + t-as="project" + > + <div style="page-break-after: always;"> + <h4>Projet <t t-esc="project.name" /></h4> + <p>Référent projet : <t t-esc="project.user_id.name" /></p> + <!-- ajoute un itérateur de 3 pour la mise en page par colonne --> + <t + t-set="multiple" + t-value="len(project.intervention_ids) // 3" + /> + <t t-foreach="list(range(0, multiple + 1))" t-as="iterator"> + <div + class="row mt32 mb32" + style="page-break-after: always;" + > + <t + t-foreach="project.intervention_ids[iterator * 3:iterator * 3 + 3]" + t-as="intervention" + > + <div class="col-4"> + <h5 class="text-center"> + <span t-field="intervention.name" /> + </h5> + <!-- Détail de l'intervention --> + <div style="margin-bottom: 8px;"> + <t + t-if="intervention.sequence_type == 'sequence'" + > + <div class="row"> + <div class="col-6"> + <p class="m-0"><span + t-field="intervention.full_seq_qty" + /> séquences entières</p> + <p class="m-0"><span + t-field="intervention.plant_qty_per_seq" + /> plants par séquence</p> + <p class="m-0"><span + t-field="intervention.extra_plants_qty" + /> plants supplémentaires</p> + </div> + <div class="col-6"> + <p + class="m-0" + >Longueur: <span + t-field="intervention.intervention_length" + t-options="{'widget': 'float', 'precision': 0}" + /> m</p> + <p + class="m-0" + >Intervalle entre plants: <span + t-field="intervention.plant_interval" + /> m</p> + </div> + </div> + </t> + <t + t-else="intervention.sequence_type == 'list'" + > + <p class="m-0">Longueur: <span + t-field="intervention.intervention_length" + t-options="{'widget': 'float', 'precision': 0}" + /> m</p> + <p + class="m-0" + >Intervalle entre plants: <span + t-field="intervention.plant_interval" + /> m</p> + <p + class="m-0" + >Nombre de plants: <span + t-field="intervention.plants_qty" + /></p> + </t> + </div> + <table + class="table table-sm table-striped table-compo mt16" + > + <tbody class="compo_tbody"> + <t + t-if="intervention.sequence_type == 'sequence'" + > + <t + t-foreach="intervention.plant_sequence_ids" + t-as="compo" + > + <tr> + <td + class="text-center" + ><t + t-if="compo.product_id.categ_id.symbol" + ><i + t-attf-class="fa {{compo.product_id.categ_id.symbol}}" + /></t></td> + <td><span + t-field="compo.product_id.name" + /></td> + <td><t + t-if="compo.product_alternance_id" + >ou</t></td> + <td class="text-center"> + <t + t-if="compo.product_alternance_id.categ_id.symbol" + > + <i + t-attf-class="fa {{compo.product_alternance_id.categ_id.symbol}}" + /> + </t> + </td> + <td><t + t-if="compo.product_alternance_id" + ><span + t-field="compo.product_alternance_id.name" + /></t></td> + </tr> + </t> + </t> + <t + t-else="intervention.sequence_type == 'list'" + > + <t + t-foreach="intervention.plant_sequence_ids" + t-as="compo" + > + <tr> + <td + class="text-center" + ><t + t-if="compo.product_id.categ_id.symbol" + ><i + t-attf-class="fa {{compo.product_id.categ_id.symbol}}" + /></t></td> + <td><span + t-field="compo.product_id.name" + /></td> + <td + class="text-right" + ><span + t-field="compo.qty" + /></td> + </tr> + </t> + </t> + </tbody> + </table> + </div> + </t> + </div> + </t> + </div> + </t> + </div> + </t> + </template> + + <template id="report_composition"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="doc"> + <t + t-call="ap_report.report_composition_document" + t-lang="doc.partner_id.lang" + /> + </t> + </t> + </template> + + </data> +</odoo> diff --git a/views/report_delivery_ap_template.xml b/templates/report_delivery_ap_template.xml similarity index 75% rename from views/report_delivery_ap_template.xml rename to templates/report_delivery_ap_template.xml index 15bd511b35da14fa17e12e804d62ce19778138c5..a8fc384b3eb31d098137dd4453f8d71fbc5ff49b 100644 --- a/views/report_delivery_ap_template.xml +++ b/templates/report_delivery_ap_template.xml @@ -4,13 +4,14 @@ <template id="report_picking" inherit_id="stock.report_picking"> <div class="page" position="replace"> - <h1 class="mt0 mb-2 text-center">Bon de préparation</h1> + <h1 class="mt0 mb-6 text-center">Bon de préparation</h1> + <hr /> <div class="page"> <div class="row"> <div class="col-8" name="div_outgoing_address"> - <h2> + <h4> <span>Devis N° </span><span t-field="o.origin" /> - </h2> + </h4> <div class="mw-100 mb-3"> <p class="m-0">Du <span t-field="o.scheduled_date" @@ -25,6 +26,7 @@ class="m-0" >Longueur de Haie: <span t-field="o.intervention_length" + t-options="{'widget': 'float', 'precision': 0}" /><span> m</span></p> <p t-if="o.plant_qty" @@ -59,59 +61,53 @@ </thead> <tbody> <t t-set="product_category" t-value="[]" /> - <t t-foreach="o.move_ids_without_package" t-as="l"> - <t t-set="product_category" t-value="product_category+[l.product_id.categ_id.parent_id]" /> - </t> - <t t-foreach="set(product_category)" t-as="category"> - <tr> - <td /> - <td> - <div><strong t-esc="category.name" /></div> - </td> - <td> - </td> - </tr> + <td colspan="3"> + <div><strong t-esc="category.name" /></div> + </td> + </tr> <t t-foreach="o.move_ids_without_package" t-as="l"> - <t t-if="category.id==l.product_id.categ_id.parent_id.id" > - <tr> - <td /> - <td> - <span + <td /> + <td> + <span t-field="l.product_id.display_name" /><br /> - <span + <span t-field="l.product_id.description_picking" /> - </td> - <td> - <span + </td> + <td> + <span t-if="l.state != 'done'" t-field="l.product_uom_qty" + t-options="{'widget': 'float', 'precision': 0}" /> - <span + <span t-if="l.state == 'done'" t-field="l.quantity_done" + t-options="{'widget': 'float', 'precision': 0}" /> - <span t-field="l.product_uom" /> - </td> - </tr> + <span + t-if="l.product_uom.id != %(uom.product_uom_unit)d" + t-field="l.product_uom" + /> + </td> + </tr> </t> </t> </t> - </tbody> </table> </div> diff --git a/views/report_templates.xml b/templates/report_layout.xml similarity index 61% rename from views/report_templates.xml rename to templates/report_layout.xml index 03bf427f897cbd83f9f735f4dba7d48fd7cee83c..2e4e104a2a56f66768d9274c526cca155aa67744 100644 --- a/views/report_templates.xml +++ b/templates/report_layout.xml @@ -1,15 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> <odoo> - <!-- Assets for reports --> - <template id="report_assets_common" inherit_id="web.report_assets_common"> - <xpath expr="." position="inside">--> - <link - rel="stylesheet" - type="text/scss" - href="/ap_report/static/src/scss/layout_generic.scss" - /> - </xpath> - </template> <template id="ap_external_layout_generic"> <div @@ -98,56 +88,7 @@ </div> </template> - <template id="ap_external_layout_generic_compo"> - <div - t-attf-class="article o_report_layout_boxed o_report_compo o_company_#{company.id}_layout" - t-att-data-oe-model="o and o._name" - t-att-data-oe-id="o and o.id" - t-att-data-oe-lang="o and o.env.context.get('lang')" - > - <div class="pt-1"> - <!-- This div ensures that the address is not cropped by the header. --> - <t t-call="web.address_layout" /> - </div> - <t t-raw="0" /> - </div> - - <div - t-attf-class="footer o_boxed_footer o_boxed_footer_compo o_company_#{company.id}_layout" - > - <div class="text-center"> - <ul class="list-inline"> - <li class="list-inline-item"> - <t t-if="company.phone"><span - class="o_force_ltr" - t-field="company.phone" - /></t> - <t t-if="company.email"> - <span t-field="company.email" /></t> - <t t-if="company.website"> - <span - t-field="company.website" - /></t> - <t t-if="company.vat"> - <t - t-esc="company.country_id.vat_label or 'Tax ID'" - />: <span t-field="company.vat" /></t> - <t t-if="company.company_type"><span - t-field="company.company_type" - /></t> - <t t-if="company.siret"> - SIRET: <span - t-field="company.siret" - /></t> - <t t-if="company.ape"> - Code NAF: <span - t-field="company.ape" - /></t> - </li> - </ul> - <div t-if="report_type == 'pdf'" class="text-muted"> - Page: <span class="page" /> / <span class="topage" /> - </div> - </div> - </div> - </template> - - <template id="external_layout_spe"> + <template id="external_layout_compo"> <t t-if="not o" t-set="o" t-value="doc" /> <t t-if="not company"> @@ -163,7 +104,9 @@ </t> </t> - <t t-call="ap_report.ap_external_layout_generic_compo"><t t-raw="0" /></t> + <t t-call="ap_report.external_layout_generic_compo"> + <t t-raw="0" /> + </t> </template> diff --git a/views/report_sale.xml b/templates/report_sale.xml similarity index 100% rename from views/report_sale.xml rename to templates/report_sale.xml diff --git a/views/report_composition_templates.xml b/views/report_composition_templates.xml deleted file mode 100644 index 57e311ef02f091dc50143f9984bfb4ff264dfa4c..0000000000000000000000000000000000000000 --- a/views/report_composition_templates.xml +++ /dev/null @@ -1,277 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<odoo> - <data> - <template id="external_layout_generic_compo"> - <div - t-attf-class="header o_company_#{company.id}_layout" - t-att-style="report_header_style" - > - <div class="row"> - <div class="col-4"> - </div> - <div class="col-4 text-center"> - <h1 class="mt0 text-center">Compositions</h1> - </div> - <div class="col-4 mb4 text-right"> - <img - t-if="company.logo" - t-att-src="image_data_uri(company.logo)" - style="max-height: 80px;" - alt="Logo" - /> - </div> - <!-- <div class="col-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/>--> - </div> - - </div> - <div - t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout" - t-att-data-oe-model="o and o._name" - t-att-data-oe-id="o and o.id" - t-att-data-oe-lang="o and o.env.context.get('lang')" - > - <div class="pt-1"> - <!-- This div ensures that the address is not cropped by the header. --> - <t t-call="web.address_layout" /> - </div> - <t t-raw="0" /> - </div> - - <div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout"> - <div class="text-center"> - <ul class="list-inline"> - <li class="list-inline-item"> - <t t-if="company.phone"><span - class="o_force_ltr" - t-field="company.phone" - /></t> - <t t-if="company.email"> - <span - t-field="company.email" - /></t> - <t t-if="company.website"> - <span - t-field="company.website" - /></t> - <t t-if="company.vat"> - <t - t-esc="company.country_id.vat_label or 'Tax ID'" - />: <span t-field="company.vat" /></t> - <t t-if="company.company_type"><span - t-field="company.company_type" - /></t> - <t t-if="company.siret"> - SIRET: <span - t-field="company.siret" - /></t> - <t t-if="company.ape"> - Code NAF: <span - t-field="company.ape" - /></t> - </li> - </ul> - <div t-field="company.report_footer" /> - <div t-if="report_type == 'pdf'"> - Page: <span class="page" /> / <span class="topage" /> - </div> - </div> - </div> - </template> - - <template id="report_composition_document"> - <t t-call="ap_report.external_layout_spe"> - <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" /> - <div class="page"> - <div class="row"> - <div class="col-8" name="div_outgoing_address"> - <h3> - <t - t-if="not (env.context.get('proforma', False) or is_pro_forma)" - > - <span - t-if="doc.state not in ['draft','sent']" - >Commande n° </span> - <span - t-if="doc.state in ['draft','sent']" - >Devis N° </span> - </t> - <t - t-if="env.context.get('proforma', False) or is_pro_forma" - > - <span>Facture pro-forma n° </span> - </t> - <span t-field="doc.name" /> - </h3> - <div class="mw-100 mb-3"> - <p class="m-0">Du <span - t-field="doc.date_order" - t-options='{"widget": "date"}' - /><br /> - Référent projet: <span t-field="doc.user_id" /> - </p> - </div> - </div> - <div class="col-3 text-center"> - <h2 class="text-center">Compositions</h2> - </div> - <div class="col-3" name="div_outgoing_address"> - <div> - <span t-field="doc.partner_id.name" /><br /> - <t t-if="doc.partner_id.street"><span - t-field="doc.partner_id.street" - /><br /></t> - <t t-if="doc.partner_id.street2"><span - t-field="doc.partner_id.street2" - /><br /></t> - <t t-if="doc.partner_id.zip"><span - t-field="doc.partner_id.zip" - /></t> - - <t t-if="doc.partner_id.city"><span - t-field="doc.partner_id.city" - /></t> - </div> - </div> - <div class="col-1 text-right"> - <img - t-if="doc.company_id.logo" - t-att-src="image_data_uri(doc.company_id.logo)" - style="max-height: 50px;" - alt="Logo" - /> - </div> - </div> - <t t-foreach="doc.sale_project_ids" t-as="project"> - <div style="page-break-after: always;"> - <div class="row mt32 mb32" name="projets"> - <t - t-foreach="project.intervention_ids" - t-as="intervention" - > - <div class="col-4"> - <h5>Intervention n° <span - t-field="intervention.name" - /></h5> - <t - t-if="intervention.sequence_type == 'sequence'" - > - <div class="row"> - <div class="col-6"> - <p class="m-0"><span - t-field="intervention.full_seq_qty" - /> séquences entières</p> - <p class="m-0"><span - t-field="intervention.plant_qty_per_seq" - /> plants par séquence</p> - <p class="m-0"><span - t-field="intervention.extra_plants_qty" - /> plants supplémentaires</p> - </div> - <div class="col-6"> - <p class="m-0">Longueur: <span - t-field="intervention.intervention_length" - /></p> - <p - class="m-0" - >Intervalle entre plants: <span - t-field="intervention.plant_interval" - /></p> - </div> - </div> - </t> - <t - t-else="intervention.sequence_type == 'list'" - > - <p class="m-0">Longueur: <span - t-field="intervention.intervention_length" - /></p> - <p - class="m-0" - >Intervalle entre plants: <span - t-field="intervention.plant_interval" - /></p> - <p class="m-0">Nombre de plants: <span - t-field="intervention.plants_qty" - /></p> - </t> - <table class="table table-sm table-compo"> - <tbody class="compo_tbody"> - <t - t-if="intervention.sequence_type == 'sequence'" - > - <t - t-foreach="intervention.plant_sequence_ids" - t-as="compo" - > - - <tr> - <td class="text-center"><t - t-if="compo.product_id.categ_id.symbol" - ><i - t-attf-class="fa {{compo.product_id.categ_id.symbol}}" - /></t></td> - <td><span - t-field="compo.product_id.name" - /></td> - <td><t - t-if="compo.product_alternance_id" - >ou</t></td> - <td class="text-center"> - <t - t-if="compo.product_alternance_id.categ_id.symbol" - > - <i - t-attf-class="fa {{compo.product_alternance_id.categ_id.symbol}}" - /> - </t> - </td> - <td><t - t-if="compo.product_alternance_id" - ><span - t-field="compo.product_alternance_id.name" - /></t></td> - </tr> - </t> - </t> - <t - t-else="intervention.sequence_type == 'list'" - > - <t - t-foreach="intervention.plant_sequence_ids" - t-as="compo" - > - - <tr> - <td class="text-center"><t - t-if="compo.product_id.categ_id.symbol" - ><i - t-attf-class="fa {{compo.product_id.categ_id.symbol}}" - /></t></td> - <td><span - t-field="compo.product_id.name" - /></td> - <td><span - t-field="compo.qty" - /></td> - </tr> - </t> - </t> - </tbody> - </table> - </div> - </t> - - </div> - </div> - </t> - </div> - </t> - </template> - - <template id="report_composition"> - <t t-call="web.html_container"> - <t t-foreach="docs" t-as="doc"> - <t - t-call="ap_report.report_composition_document" - t-lang="doc.partner_id.lang" - /> - </t> - </t> - </template> - - </data> -</odoo>