From a912525d205f081516c3212c4a119c356cfd2a3f Mon Sep 17 00:00:00 2001 From: jordan <jordan@le-filament.com> Date: Wed, 23 Jun 2021 12:22:19 +0200 Subject: [PATCH] [update] add DLC on detailed_operation tree view in stock_picking --- README.rst | 1 + __manifest__.py | 1 + views/stock_move_line.xml | 22 ++++++++++++++++++++++ views/stock_picking.xml | 12 ++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 views/stock_move_line.xml diff --git a/README.rst b/README.rst index 235911b..497909d 100755 --- a/README.rst +++ b/README.rst @@ -10,6 +10,7 @@ Fumaison Occ - Vente - Ce module hérite du module *product* et ajoute un champ EAN7 sur les articles champs au modèle *product.product* - Ajout de champs venant de *fumoc_partner* sur *sale_order* - Ajout de la note de facturation et de la DLC des lots dans les factures pdf +- Ajout de la DLC dans la vue détaillée des opérations sur le bon de livraison Description =========== diff --git a/__manifest__.py b/__manifest__.py index 0e131a4..7b61921 100755 --- a/__manifest__.py +++ b/__manifest__.py @@ -17,6 +17,7 @@ # views 'views/product_views.xml', 'views/sale_order.xml', + 'views/stock_move_line.xml', 'views/stock_picking.xml', # reports 'report/report_deliveryslip.xml', diff --git a/views/stock_move_line.xml b/views/stock_move_line.xml new file mode 100644 index 0000000..50c6561 --- /dev/null +++ b/views/stock_move_line.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2021 Le Filament + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> +<odoo> + <data> + + <record id="fumoc_stock_move_line_detailed_operation_tree_inherit" model="ir.ui.view"> + <field name="name">fumoc_sale.stock.move.line.tree</field> + <field name="model">stock.move.line</field> + <field name="inherit_id" ref="product_expiry.view_stock_move_line_detailed_operation_tree_expiry"/> + <field name="priority" eval="8"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='expiration_date']" position="attributes"> + <attribute name="string">DLC</attribute> + <attribute name="attrs">{'column_invisible': [('parent.show_lots_text', '=', True)]}</attribute> + <attribute name="widget">date</attribute> + </xpath> + </field> + </record> + + </data> +</odoo> diff --git a/views/stock_picking.xml b/views/stock_picking.xml index c19036d..c660eb2 100644 --- a/views/stock_picking.xml +++ b/views/stock_picking.xml @@ -10,12 +10,24 @@ <field name="inherit_id" ref="stock.view_picking_form"/> <field name="priority" eval="8"/> <field name="arch" type="xml"> + <xpath expr="//page[@name='extra']//group[@name='other_infos']" position="after"> <group string="Infos Livraison" name="delivery_infos"> <field name="res_transporter_id"/> <field name="packaging_id"/> </group> </xpath> + + <xpath expr="//field[@name='move_line_ids_without_package']" position="attributes"> + <attribute name="context">{ + 'tree_view_ref': 'fumoc_sale.fumoc_stock_move_line_detailed_operation_tree_inherit', + 'default_picking_id': id, + 'default_location_id': location_id, + 'default_location_dest_id': location_dest_id, + 'default_company_id': company_id + }</attribute> + </xpath> + </field> </record> -- GitLab