PDFs: Fix country name evaluation

This commit is contained in:
Raphael Michel
2020-12-02 14:26:19 +01:00
parent 937b967259
commit 87a514ca8b

View File

@@ -262,7 +262,7 @@ DEFAULT_VARIABLES = OrderedDict((
("invoice_country", {
"label": _("Invoice address country"),
"editor_sample": _("Atlantis"),
"evaluate": lambda op, order, ev: order.invoice_address.country if getattr(order, 'invoice_address', None) else ''
"evaluate": lambda op, order, ev: str(getattr(order.invoice_address.country, 'name', '')) if getattr(order, 'invoice_address', None) else ''
}),
("addons", {
"label": _("List of Add-Ons"),