diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
index 06de9681cef..a4a4698822f 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
@@ -491,7 +491,7 @@ class AccountEdiXmlUBL20(models.AbstractModel):
sales_order_id = 'sale_line_ids' in invoice.invoice_line_ids._fields \
and ",".join(invoice.invoice_line_ids.sale_line_ids.order_id.mapped('name'))
# OrderReference/ID (order_reference) is mandatory inside the OrderReference node !
- order_reference = invoice.ref or invoice.name if sales_order_id else invoice.ref
+ order_reference = invoice.ref or invoice.name
vals = {
'builder': self,
diff --git a/addons/l10n_sa_edi/tests/compliance/simplified/invoice.xml b/addons/l10n_sa_edi/tests/compliance/simplified/invoice.xml
index 4a0ed4d07ca..42918ffc799 100644
--- a/addons/l10n_sa_edi/tests/compliance/simplified/invoice.xml
+++ b/addons/l10n_sa_edi/tests/compliance/simplified/invoice.xml
@@ -9,6 +9,9 @@
SAR
SAR
Mohammed Ali
+
+ INV/2023/00034
+
QR
diff --git a/addons/l10n_sa_edi/tests/compliance/standard/invoice.xml b/addons/l10n_sa_edi/tests/compliance/standard/invoice.xml
index a34768f15e7..165a0d1eaa1 100644
--- a/addons/l10n_sa_edi/tests/compliance/standard/invoice.xml
+++ b/addons/l10n_sa_edi/tests/compliance/standard/invoice.xml
@@ -12,6 +12,9 @@
SAR
SAR
Azure Interior
+
+ INV/2022/00014
+
PIH