From 5ba37d8a7ed9a001a1a0195439922408228de89b Mon Sep 17 00:00:00 2001 From: Alessio Renda Date: Thu, 25 Jan 2024 12:37:58 +0100 Subject: [PATCH] [IMP] l10n_it_delivery_note: group pickings by dn state and date - Add options to group pickings by delivery note state and date - Make delivery note state and date sortable in picking's tree view --- l10n_it_delivery_note/models/stock_picking.py | 6 ++++-- l10n_it_delivery_note/views/stock_picking.xml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/l10n_it_delivery_note/models/stock_picking.py b/l10n_it_delivery_note/models/stock_picking.py index d0e23878bea4..8fbe30bf934d 100644 --- a/l10n_it_delivery_note/models/stock_picking.py +++ b/l10n_it_delivery_note/models/stock_picking.py @@ -26,7 +26,7 @@ class StockPicking(models.Model): "ir.sequence", related="delivery_note_id.sequence_id" ) delivery_note_state = fields.Selection( - string="DN State", related="delivery_note_id.state" + string="DN State", related="delivery_note_id.state", store=True ) delivery_note_partner_ref = fields.Char(related="delivery_note_id.partner_ref") delivery_note_partner_shipping_id = fields.Many2one( @@ -46,7 +46,9 @@ class StockPicking(models.Model): check_company=True, ) delivery_note_type_code = fields.Selection(related="delivery_note_type_id.code") - delivery_note_date = fields.Date(string="DN Date", related="delivery_note_id.date") + delivery_note_date = fields.Date( + string="DN Date", related="delivery_note_id.date", store=True + ) delivery_note_note = fields.Html(related="delivery_note_id.note") transport_condition_id = fields.Many2one( diff --git a/l10n_it_delivery_note/views/stock_picking.xml b/l10n_it_delivery_note/views/stock_picking.xml index 784ca34ddf07..c7e3d5f460f3 100644 --- a/l10n_it_delivery_note/views/stock_picking.xml +++ b/l10n_it_delivery_note/views/stock_picking.xml @@ -388,6 +388,18 @@ domain="[('delivery_note_state', '=', 'confirm')]" /> + + + +