From e18a2daa42dca7aa6f01d06449de0ddceb201755 Mon Sep 17 00:00:00 2001 From: "Pedram (pebr)" Date: Wed, 17 Jan 2024 16:50:03 +0100 Subject: [PATCH] [FIX] point_of_sale: use journal account when income account is missing Prior to this commit, when the product income account was absent, and the product category income account was also missing, PoS would fail to create an invoice. Now, it correctly utilizes the PoS config journal default account. opw-3615194 closes odoo/odoo#149816 Signed-off-by: Joseph Caburnay (jcb) --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index a02a9d30c63..e5bce1896b5 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -1512,7 +1512,7 @@ class PosOrderLine(models.Model): commercial_partner = self.order_id.partner_id.commercial_partner_id fiscal_position = self.order_id.fiscal_position_id line = line.with_company(self.order_id.company_id) - account = line.product_id._get_product_accounts()['income'] + account = line.product_id._get_product_accounts()['income'] or self.order_id.config_id.journal_id.default_account_id if not account: raise UserError(_( "Please define income account for this product: '%s' (id:%d).",