From 9fd6061ffd01c49c67e45f901d7c91332d2748fe Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 17 Dec 2024 14:52:30 -0300 Subject: [PATCH] [FIX+MIG] l10n_br_stock_account: Adapt View v16 --- l10n_br_stock_account/models/stock_picking.py | 28 +++---------------- l10n_br_stock_account/views/stock_picking.xml | 9 +++--- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/l10n_br_stock_account/models/stock_picking.py b/l10n_br_stock_account/models/stock_picking.py index 7f7fb75eb4a8..204c52225b3a 100644 --- a/l10n_br_stock_account/models/stock_picking.py +++ b/l10n_br_stock_account/models/stock_picking.py @@ -48,30 +48,10 @@ def _amount_all(self): picking._compute_amount() @api.model - def fields_view_get( - self, view_id=None, view_type="form", toolbar=False, submenu=False - ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) - - if view_type == "form": - view = self.env["ir.ui.view"] - - sub_form_view = order_view["fields"]["move_ids_without_package"]["views"][ - "form" - ]["arch"] - - sub_form_node = self.env["stock.move"].inject_fiscal_fields(sub_form_view) - - sub_arch, sub_fields = view.postprocess_and_fields( - sub_form_node, "stock.move" - ) - - order_view["fields"]["move_ids_without_package"]["views"]["form"] = { - "fields": sub_fields, - "arch": sub_arch, - } - - return order_view + def _get_view(self, view_id=None, view_type="form", **options): + arch, view = super()._get_view(view_id, view_type, **options) + arch = self.env["stock.move"].inject_fiscal_fields(arch) + return arch, view def _put_in_pack(self, move_line_ids, create_package_level=True): package = super()._put_in_pack(move_line_ids, create_package_level) diff --git a/l10n_br_stock_account/views/stock_picking.xml b/l10n_br_stock_account/views/stock_picking.xml index 4dbc3ffee8dd..1f379539eb34 100644 --- a/l10n_br_stock_account/views/stock_picking.xml +++ b/l10n_br_stock_account/views/stock_picking.xml @@ -66,7 +66,7 @@ name="fiscal" string="Fiscal" attrs="{'invisible': ['|', ('invoice_state', 'in', [False, 'none']), ('parent.fiscal_operation_id', '=', False)]}" - colspan="4" + colspan="2" > @@ -118,9 +118,10 @@ - + @@ -169,6 +169,7 @@ name="invoice_line_ids" readonly="1" nolabel="1" + colspan="2" /> @@ -193,7 +194,7 @@