diff --git a/__manifest__.py b/__manifest__.py index 780e9916453a91e83afafe22d007dfcaa5bf245f..4e06f55dd710b22157d4ac0f404af6b010f48511 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -12,6 +12,7 @@ ], "data": [ # datas + "data/paperformat_data.xml", # views "views/assets.xml", "views/product_views.xml", diff --git a/data/paperformat_data.xml b/data/paperformat_data.xml new file mode 100644 index 0000000000000000000000000000000000000000..170d81daf40c2e3c6aa03dea09bce538733d3cb3 --- /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_nohead_foot" model="report.paperformat"> + <field name="name">A4 - no header-footer</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">Portrait</field> + <field name="margin_top">10</field> + <field name="margin_bottom">10</field> + <field name="margin_left">7</field> + <field name="margin_right">7</field> + <field name="header_line" eval="False" /> + <field name="header_spacing">0</field> + <field name="dpi">90</field> + </record> + + </data> +</odoo> diff --git a/report/report_saleorder_preparation.xml b/report/report_saleorder_preparation.xml index 3d1bc4fbd6c644a47a9bc575a5dc10dab346ae82..be8ef49abf82cbdebd845b7bb435298db6e97921 100644 --- a/report/report_saleorder_preparation.xml +++ b/report/report_saleorder_preparation.xml @@ -4,16 +4,20 @@ <template id="report_sale_order_preparation"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> - <t t-call="web.external_layout"> - <span><strong - >Adresse du client :</strong></span> - <div - t-field="o.partner_shipping_id" - t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}' - /> - <div class="page"> + <t t-call="web.basic_layout"> + <div class="float-right"> + <span><strong>Adresse du client :</strong></span> + <div + t-field="o.partner_shipping_id" + t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}' + /> <br /> - <h1 t-field="o.name" class="mt0 float-left" /> + </div> + <div class="page"> + <h1 class="mt0 float-left"> + Préparation + <span t-field="o.name" /> + </h1> <div class="row mt48 mb32"> <div class="col-auto" name="div_state"> <strong>Statut :</strong> @@ -70,7 +74,29 @@ </tr> </thead> <tbody> - <t t-foreach="o.order_line" t-as="line"> + <t t-set="categ_id" t-value="False" /> + <t + t-foreach="o.order_line.sorted(key=lambda r: r.product_id.product_tmpl_id.categ_id.complete_name)" + t-as="line" + > + <t + t-if="line.product_id.product_tmpl_id.categ_id.id != categ_id" + > + <tr> + <td + colspan="4" + style="background-color:#d3d3d3" + > + <span + t-field="line.product_id.product_tmpl_id.categ_id.complete_name" + /> + <t + t-set="categ_id" + t-value="line.product_id.product_tmpl_id.categ_id.id" + /> + </td> + </tr> + </t> <tr> <td> <span @@ -91,7 +117,7 @@ <span> </span> </td> <td> - <span> </span> + <span><br /><br /> </span> </td> </tr> </t> diff --git a/views/sale_order.xml b/views/sale_order.xml index cd47c1bd2be247a81c4f8f7191611b235c2f3e89..e3b946c48cd8d945f3f8488591f01c94a50943d9 100644 --- a/views/sale_order.xml +++ b/views/sale_order.xml @@ -59,6 +59,7 @@ >'Préparation de Commande - %s - %s' % (object.name, object.partner_id.name or '')</field> <field name="binding_model_id" ref="model_sale_order" /> <field name="binding_type">report</field> + <field name="paperformat_id" ref="fumoc_sale.paperformat_nohead_foot" /> </record> </data>