diff --git a/__manifest__.py b/__manifest__.py index f65d07e51231c7941f4b1fd719f00ec90a6ff45c..b60135c59ae9f7318a9acdc56c26b4a40cde7d3a 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -8,6 +8,7 @@ 'depends': ['web','sale'], 'qweb': [], 'data': [ + 'data/paperformat_data.xml', 'views/res_company_views.xml', 'views/report_templates.xml', 'views/report_sale.xml', diff --git a/data/paperformat_data.xml b/data/paperformat_data.xml new file mode 100644 index 0000000000000000000000000000000000000000..8c8b8fc025a42fff0727653b7d595d7533a25151 --- /dev/null +++ b/data/paperformat_data.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data noupdate="1"> + <record id="paperformat_landscape" model="report.paperformat"> + <field name="name">A4 Landscape</field> + <field name="default" eval="True" /> + <field name="format">A4</field> + <field name="page_height">0</field> + <field name="page_width">0</field> + <field name="orientation">Landscape</field> + <field name="margin_top">40</field> + <field name="margin_bottom">32</field> + <field name="margin_left">7</field> + <field name="margin_right">7</field> + <field name="header_line" eval="False" /> + <field name="header_spacing">35</field> + <field name="dpi">90</field> + </record> + + </data> +</odoo> \ No newline at end of file diff --git a/static/src/scss/layout_generic.scss b/static/src/scss/layout_generic.scss index 5de3e552ae0bcbc7e2dee7c5530edaf2810004b8..f28a406a9ea57f6d4fbd54affa27d0394242569b 100644 --- a/static/src/scss/layout_generic.scss +++ b/static/src/scss/layout_generic.scss @@ -50,4 +50,24 @@ address .align-items-baseline{ } } } +} + +.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{ + 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; } \ No newline at end of file diff --git a/views/report_composition_templates.xml b/views/report_composition_templates.xml index dfe21a1c42615914b3b33c0e5340eee7419cb859..ef7b288c821e475bd1d1d98fc5a30a802ac7aac7 100644 --- a/views/report_composition_templates.xml +++ b/views/report_composition_templates.xml @@ -5,34 +5,46 @@ <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)" /> - + <h1 class="mt0 text-center">Compositions</h1> <div class="page"> - <div class="oe_structure"/> - <h1 class="text-center">Compositions</h1> <div class="row"> - <div class="col-6"> - <h2 class="mt16"> - <span>Devis n°</span> + <div class="col-6" name="div_outgoing_address"> + <h2> + <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"/> + </h2> + <div class="mw-100 mb-3"> <p class="m-0">Du <span t-field="doc.date_order" t-options='{"widget": "date"}'/></p> <p class="m-0">Référent projet: <span t-field="doc.user_id"/></p> - </h2> + </div> </div> - <div class="col-6"> - <t t-set="address"> + <div class="col-6" name="div_outgoing_address"> + <div> <div t-field="doc.partner_id" - t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' /> - </t> + t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> + </div> </div> </div> + <br/> - <div class="row mt32 mb32" id="projets"> <t t-foreach="doc.sale_project_ids" t-as="project"> - <div class="col-12"> - <h3><span t-field="project.name"/></h3> - <t t-foreach="project.intervention_ids" t-as="intervention"> +<!-- <div class="col-12">--> + <div style="page-break-after: always;"> + <div class="row mt32 mb32" name="projets"> + <div class="col-12"> + <h3>Projet N° <span t-field="project.name"/></h3> + </div> + </div> + <div class="row mt32 mb32" name="projets"> + <t t-foreach="project.intervention_ids" t-as="intervention"> <div class="col-4"> - <h4 class="text-center"><span t-field="intervention.name"/></h4> + <h4 class="text-center">Intervention n° <span t-field="intervention.name"/></h4> <t t-if="intervention.sequence_type == 'sequence'"> <div class="row"> <div class="col-6"> @@ -51,7 +63,7 @@ <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 o_main_table"> + <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"> @@ -76,10 +88,14 @@ </table> </div> </t> +<!-- </div>--> +<!-- <p ></p>--> + + </div> </div> </t> </div> - </div> + </t> </template> diff --git a/views/report_compositions.xml b/views/report_compositions.xml index e1669beebfd2e72490f8693b74fb15349d34553a..2efdb5d97da1052db2a30703c589fd98ba00b902 100644 --- a/views/report_compositions.xml +++ b/views/report_compositions.xml @@ -5,12 +5,13 @@ <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_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> <field name="print_report_name">'Composition - %s' % (object.name)</field> <field name="binding_model_id" ref="sale.model_sale_order"/> + <field name="paperformat_id" ref="ap_report.paperformat_landscape"/> </record> </data> diff --git a/views/report_delivery_ap.xml b/views/report_delivery_ap.xml index 5fc9f896c9b1ed82a71d0362c60c0f8776c40e4a..3a853cc9e324a8aaf016e108f43b052f3549d1d9 100644 --- a/views/report_delivery_ap.xml +++ b/views/report_delivery_ap.xml @@ -5,8 +5,7 @@ <record id="action_delivery_ap" model="ir.actions.report"> <field name="name">Bons de livraisons</field> <field name="model">sale.order</field> - <field name="report_type">qweb-html</field> -<!-- <field name="report_type">qweb-pdf</field>--> + <field name="report_type">qweb-pdf</field> <field name="report_name">ap_report.report_delivery_ap</field> <field name="report_file">ap_report.report_delivery_ap</field> <field name="print_report_name">'Bon de livraison - %s' % (object.name)</field> diff --git a/views/report_delivery_ap_template.xml b/views/report_delivery_ap_template.xml index 338319c689c78e259432a310cc70d7cb887852d1..373be54fd40e3a8ed87faba299b72aaa19384b86 100644 --- a/views/report_delivery_ap_template.xml +++ b/views/report_delivery_ap_template.xml @@ -6,52 +6,33 @@ <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> <t t-call="web.external_layout"> + <h1 class="mt0 text-center">Bon de livraison</h1> <div class="page"> -<!-- <div class="row justify-content-end mb16">--> -<!-- <div class="col-4" name="right_box">--> -<!-- <img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px;" alt="Barcode"/>--> -<!-- </div>--> -<!-- </div>--> <div class="row"> + <div class="col-6" name="div_outgoing_address"> + <h2> + <t t-if="not (env.context.get('proforma', False) or is_pro_forma)"> + <span t-if="o.state not in ['draft','sent']">Commande n° </span> + <span t-if="o.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="o.name"/> + </h2> + <div class="mw-100 mb-3"> + <p class="m-0">Du <span t-field="o.date_order" t-options='{"widget": "date"}'/></p> + <p class="m-0">Référent projet: <span t-field="o.user_id"/></p> + </div> + </div> <div class="col-6" name="div_outgoing_address"> <div> <div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> </div> </div> -<!-- <div class="col-5 offset-1" name="div_incoming_address">--> -<!-- <div t-if="o.picking_type_id.code=='incoming' and o.partner_id">--> -<!-- <span><strong>Vendor Address:</strong></span>--> -<!-- </div>--> -<!-- <div t-if="o.picking_type_id.code=='internal' and o.partner_id">--> -<!-- <span><strong>Warehouse Address:</strong></span>--> -<!-- </div>--> -<!-- <div t-if="o.picking_type_id.code=='outgoing' and o.partner_id">--> -<!-- <span><strong>Customer Address:</strong></span>--> -<!-- </div>--> -<!-- <div t-if="o.partner_id" name="partner_header">--> -<!-- <div t-field="o.partner_id"--> -<!-- t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True, "phone_icons": True}'/>--> -<!-- <p t-if="o.sudo().partner_id.vat"><t t-esc="o.company_id.country_id.vat_label or 'Tax ID'"/>: <span t-field="o.sudo().partner_id.vat"/></p>--> -<!-- </div>--> -<!-- </div>--> </div> <br/> - <h1 t-field="o.name" class="mt0 float-left"/> -<!-- <div class="row mt48 mb32">--> -<!-- <div t-if="o.origin" class="col-auto" name="div_origin">--> -<!-- <strong>Order:</strong>--> -<!-- <p t-field="o.origin"/>--> -<!-- </div>--> -<!-- <div class="col-auto" name="div_state">--> -<!-- <strong>Status:</strong>--> -<!-- <p t-field="o.state"/>--> -<!-- </div>--> -<!-- <div class="col-auto" name="div_sched_date">--> -<!-- <strong>Scheduled Date:</strong>--> -<!-- <p t-field="o.scheduled_date"/>--> -<!-- </div>--> -<!-- </div>--> <table class="table table-sm" t-if="o.sale_intervention_stock_ids"> <thead> <tr> @@ -67,6 +48,30 @@ </tr> </thead> <tbody> +<!-- <t t-set="product_template" t-value="[]"/>--> + +<!-- <t t-foreach="o.sale_intervention_stock_ids" t-as="l">--> + +<!-- <t t-set="product_template" t-value="product_template+[l.product_template_id]"/>--> + +<!-- </t>--> + +<!-- <t t-foreach="set(product_template)" t-as="tmp">--> + +<!--<!– <div><strong t-esc="tmp.name"/></div>–>--> +<!-- <tr>--> +<!-- <td>--> +<!-- <span t-field="tmp.name"/><br/>--> +<!-- <span t-field="stock.product_id.description_picking"/>--> +<!-- </td>--> +<!-- <td>--> +<!-- <span t-field="stock.product_uom_qty"/>--> + +<!-- </td>--> +<!-- <td></td>--> +<!-- </tr>--> + +<!-- </t>--> <t t-foreach="o.sale_intervention_stock_ids" t-as="stock"> <!-- In case you come across duplicated lines, ask NIM or LAP --> <!-- <t t-foreach="move.move_line_ids.sorted(key=lambda ml: ml.location_id.id)" t-as="ml">-->