diff --git a/stock_picking_invoice_link/models/account_move.py b/stock_picking_invoice_link/models/account_move.py index f5538e3c0890..3992e96db1ef 100644 --- a/stock_picking_invoice_link/models/account_move.py +++ b/stock_picking_invoice_link/models/account_move.py @@ -21,7 +21,7 @@ class AccountMove(models.Model): ) picking_count = fields.Integer( - string="Pickings count", compute="_compute_picking_ids" + string="Pickings count", compute="_compute_picking_count" ) @api.depends("invoice_line_ids", "invoice_line_ids.move_line_ids") @@ -32,6 +32,11 @@ def _compute_picking_ids(self): ) invoice.picking_count = len(invoice.picking_ids) + @api.depends("picking_ids") + def _compute_picking_count(self): + for invoice in self: + invoice.picking_count = len(invoice.picking_ids) + def action_show_picking(self): """This function returns an action that display existing pickings of given invoice.