diff --git a/stock_picking_show_linked/README.rst b/stock_picking_show_linked/README.rst index bbd56b1aeee0..c1f805a5092d 100644 --- a/stock_picking_show_linked/README.rst +++ b/stock_picking_show_linked/README.rst @@ -63,6 +63,7 @@ Contributors ------------ - Juany Davila +- Foram Darji Maintainers ----------- diff --git a/stock_picking_show_linked/__manifest__.py b/stock_picking_show_linked/__manifest__.py index bd41285a262b..c1cefdc338eb 100644 --- a/stock_picking_show_linked/__manifest__.py +++ b/stock_picking_show_linked/__manifest__.py @@ -1,4 +1,5 @@ # Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) { "name": "Stock Picking Show Linked", "summary": """ @@ -6,7 +7,7 @@ (in the case of chained routes) through a button in the parent picking view. """, - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse Management", diff --git a/stock_picking_show_linked/i18n/it.po b/stock_picking_show_linked/i18n/it.po index 738b96b1f1ab..9fbee5159451 100644 --- a/stock_picking_show_linked/i18n/it.po +++ b/stock_picking_show_linked/i18n/it.po @@ -4,17 +4,16 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0+e\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-03-19 15:37+0000\n" -"Last-Translator: mymage \n" -"Language-Team: none\n" -"Language: it\n" +"POT-Creation-Date: 2024-12-11 19:18+0000\n" +"PO-Revision-Date: 2024-12-11 19:18+0000\n" +"Last-Translator: \n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"Plural-Forms: \n" #. module: stock_picking_show_linked #: model:ir.model.fields,field_description:stock_picking_show_linked.field_stock_picking__dest_picking_count diff --git a/stock_picking_show_linked/i18n/stock_picking_show_linked.pot b/stock_picking_show_linked/i18n/stock_picking_show_linked.pot index 6e5bbecbf00b..e847d99ce50e 100644 --- a/stock_picking_show_linked/i18n/stock_picking_show_linked.pot +++ b/stock_picking_show_linked/i18n/stock_picking_show_linked.pot @@ -4,8 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0+e\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-11 19:15+0000\n" +"PO-Revision-Date: 2024-12-11 19:15+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" diff --git a/stock_picking_show_linked/models/stock_picking.py b/stock_picking_show_linked/models/stock_picking.py index d1cb3f18ed16..f93845ddfe15 100644 --- a/stock_picking_show_linked/models/stock_picking.py +++ b/stock_picking_show_linked/models/stock_picking.py @@ -1,4 +1,5 @@ # Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) from odoo import api, fields, models @@ -9,22 +10,26 @@ class StockPicking(models.Model): dest_picking_count = fields.Integer(compute="_compute_picking_count") origin_picking_count = fields.Integer(compute="_compute_picking_count") - @api.depends("move_ids") + @api.depends("move_ids.move_orig_ids", "move_ids.move_dest_ids") def _compute_picking_count(self): for record in self: origin_pickings = record.mapped("move_ids.move_orig_ids.picking_id") dest_pickings = record.mapped("move_ids.move_dest_ids.picking_id") - record.origin_picking_count = len(origin_pickings) - record.dest_picking_count = len(dest_pickings) - - def _get_action_link(self, pickings): + record.update( + { + "origin_picking_count": len(origin_pickings), + "dest_picking_count": len(dest_pickings), + } + ) + + def _get_action_link(self, picking_ids): result = self.env["ir.actions.actions"]._for_xml_id( "stock.action_picking_tree_all" ) # choose the view_mode accordingly - if not pickings or len(pickings) > 1: - result["domain"] = "[('id','in',%s)]" % pickings - elif len(pickings) == 1: + if not picking_ids or len(picking_ids) > 1: + result["domain"] = f"[('id','in',{picking_ids})]" + elif len(picking_ids) == 1: res = self.env.ref("stock.view_picking_form", False) form_view = [(res and res.id or False, "form")] if "views" in result: @@ -33,7 +38,7 @@ def _get_action_link(self, pickings): ] else: result["views"] = form_view - result["res_id"] = pickings[0] + result["res_id"] = picking_ids[0] return result def action_stock_picking_origin(self): diff --git a/stock_picking_show_linked/readme/CONTRIBUTORS.md b/stock_picking_show_linked/readme/CONTRIBUTORS.md index ccefab247774..22788e2bc0b7 100644 --- a/stock_picking_show_linked/readme/CONTRIBUTORS.md +++ b/stock_picking_show_linked/readme/CONTRIBUTORS.md @@ -1 +1,2 @@ - Juany Davila \<\> +- Foram Darji \<\> diff --git a/stock_picking_show_linked/static/description/index.html b/stock_picking_show_linked/static/description/index.html index bedcb4c5a8be..cd7a58e24170 100644 --- a/stock_picking_show_linked/static/description/index.html +++ b/stock_picking_show_linked/static/description/index.html @@ -410,6 +410,7 @@

Authors

Contributors

diff --git a/stock_picking_show_linked/views/stock_picking.xml b/stock_picking_show_linked/views/stock_picking.xml index 1c26ec34784d..ee6279655267 100644 --- a/stock_picking_show_linked/views/stock_picking.xml +++ b/stock_picking_show_linked/views/stock_picking.xml @@ -1,4 +1,6 @@ + stock_picking_show_linked.form @@ -13,7 +15,7 @@ type="object" name="action_stock_picking_destination" icon="fa-truck" - attrs="{'invisible': [('dest_picking_count', '==', 0)]}" + invisible="dest_picking_count == 0" >