diff --git a/__manifest__.py b/__manifest__.py index d510d86a69634eb3b47a5a7be6fc74287d25b1ab..61fff779fe3d849b63a5b03e206f8f1944be7936 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -24,6 +24,7 @@ "report/report_invoice.xml", "report/report_pricelist.xml", "report/report_saleorder.xml", + "report/report_saleorder_preparation.xml", "report/report_stockpicking_operations.xml", # views menu # wizard diff --git a/report/report_saleorder_preparation.xml b/report/report_saleorder_preparation.xml new file mode 100644 index 0000000000000000000000000000000000000000..cd14341a1d350992b5f9a8dd205d5c466bf68d26 --- /dev/null +++ b/report/report_saleorder_preparation.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <data> + <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"> + <div class="page"> + <div class="row"> + <div class="col-6" name="div_outgoing_address"> + <div> + <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> + </div> + </div> + <br /> + <h1 t-field="o.name" class="mt0 float-left" /> + <div class="row mt48 mb32"> + <div class="col-auto" name="div_state"> + <strong>Statut :</strong> + <p t-field="o.state" /> + </div> + <div class="col-auto" name="div_commitment_date"> + <strong>Date de livraison prévue :</strong> + <p t-field="o.commitment_date" /> + </div> + <div class="col-auto" name="div_transporter"> + <strong>Transporteur :</strong> + <p t-field="o.res_transporter_id" /> + </div> + <div class="col-auto" name="div_packaging"> + <strong>Emballage :</strong> + <p t-field="o.packaging_id" /> + </div> + <div class="col-auto" name="div_billing"> + <strong>Type de facturation :</strong> + <p t-field="o.billing_type_id" /> + </div> + </div> + <div class="row mt48 mb32"> + <div + t-if="o.partner_shipping_id.delivery_note" + class="col-auto" + name="div_delivery_note" + > + <strong>Note :</strong> + <p t-field="o.partner_shipping_id.delivery_note" /> + </div> + </div> + <table + class="table table-sm table-prepa" + t-if="o.order_line" + > + <thead> + <tr> + <th name="th_product"> + <strong>Article</strong> + </th> + <th name="th_qty"> + <strong>Quantité</strong> + </th> + <th name="th_serial_number" class="text-center"> + <strong>Numéro de Lot</strong> + </th> + <th name="th_expiry" class="text-center"> + <strong>DLC</strong> + </th> + </tr> + </thead> + <tbody> + <t t-foreach="o.order_line" t-as="line"> + <tr> + <td> + <span + t-field="line.product_id.display_name" + /><br /> + <span + t-field="line.product_id.description" + /> + </td> + <td> + <span t-field="line.product_uom_qty" /> + <span + t-field="line.product_uom" + groups="uom.group_uom" + /> + + </td> + </tr> + </t> + </tbody> + </table> + <p t-field="o.note" /> + </div> + </t> + </t> + </t> + </template> + </data> +</odoo> diff --git a/static/src/scss/layout_generic.scss b/static/src/scss/layout_generic.scss new file mode 100644 index 0000000000000000000000000000000000000000..2b4c15adad1d86c19b4ce162cb8efe4caa3f5e80 --- /dev/null +++ b/static/src/scss/layout_generic.scss @@ -0,0 +1,6 @@ +/*** + Preparations +***/ +.table-prepa td { + border: thin solid #000; +} diff --git a/views/assets.xml b/views/assets.xml new file mode 100644 index 0000000000000000000000000000000000000000..145c7fb7d642d2ee38c60a0752953a41e81d4fcf --- /dev/null +++ b/views/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="/fumoc_sale/static/src/scss/layout_generic.scss" + /> + </xpath> + </template> +</odoo> diff --git a/views/sale_order.xml b/views/sale_order.xml index b92a931799f29aa41c85b3151024629c6c3856fb..cd47c1bd2be247a81c4f8f7191611b235c2f3e89 100644 --- a/views/sale_order.xml +++ b/views/sale_order.xml @@ -46,5 +46,20 @@ </field> </record> + <record id="action_report_sale_preparation" model="ir.actions.report"> + <field name="name">Préparation Commande</field> + <field name="model">sale.order</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">fumoc_sale.report_sale_order_preparation</field> + <field + name="report_file" + >fumoc_sale.report_sale_order_preparation_operations</field> + <field + name="print_report_name" + >'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> + </record> + </data> </odoo>