From ba1d2b754f0acfa1e93e85c0d77a68375403a970 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 3 Mar 2021 09:19:53 +0000 Subject: [PATCH] [FIX] account_fleet: Field vehicle_id unavailable on vendor refund MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fleet vehicle_id must be visible on vendor refund opw:2471784 closes odoo/odoo#67280 X-original-commit: 7144321c3fd13f83241ae7e4be71a9a4d576a871 Signed-off-by: William André (wan) Signed-off-by: Simon Goffin (sig) --- addons/account_fleet/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_fleet/models/account_move.py b/addons/account_fleet/models/account_move.py index 33cda7efd4b..646e4ae5df0 100644 --- a/addons/account_fleet/models/account_move.py +++ b/addons/account_fleet/models/account_move.py @@ -16,7 +16,7 @@ class AccountMove(models.Model): log_list = [] not_posted_before = self.filtered(lambda r: not r.posted_before) posted = super()._post(soft) # We need the move name to be set, but we also need to know which move are posted for the first time. - for line in (not_posted_before & posted).line_ids.filtered(lambda ml: ml.vehicle_id): + for line in (not_posted_before & posted).line_ids.filtered(lambda ml: ml.vehicle_id and ml.move_id.move_type == 'in_invoice'): val = { 'service_type_id': vendor_bill_service.id, 'vehicle_id': line.vehicle_id.id,