From 453ff3f33815cf0067cc75a4fc8a37db625a19f0 Mon Sep 17 00:00:00 2001 From: Mmequignon Date: Wed, 23 Aug 2023 14:00:05 +0200 Subject: [PATCH] postlogistics: Set customer name mandatory --- delivery_postlogistics/postlogistics/web_service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/delivery_postlogistics/postlogistics/web_service.py b/delivery_postlogistics/postlogistics/web_service.py index 88236aef09..fee41c12e1 100644 --- a/delivery_postlogistics/postlogistics/web_service.py +++ b/delivery_postlogistics/postlogistics/web_service.py @@ -167,6 +167,8 @@ def _prepare_customer(self, picking): if picking.picking_type_id.code != "outgoing": partner = picking.partner_id + if not partner.name: + raise exceptions.UserError(_("Customer name is required.")) customer = { "name1": self._sanitize_string(partner.name), "street": self._sanitize_string(partner.street),