From e495d2dbfa07d9f61b9dad6c26a211ea5e02f27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Sep 2024 19:27:36 +0200 Subject: [PATCH] Support POS sale line columns defined before mixin is applied The mixin is applied after the Model so if another module wants to extend the method, the method may be in the super class. --- modules/sale_point/sale_reporting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/sale_point/sale_reporting.py b/modules/sale_point/sale_reporting.py index 6ea721a753..b8cb820a8b 100644 --- a/modules/sale_point/sale_reporting.py +++ b/modules/sale_point/sale_reporting.py @@ -37,6 +37,11 @@ class AbstractMixin: @classmethod def _pos_sale_line_columns(cls, line, point, sale, currency): + try: + columns = super()._pos_sale_line_columns( + line, point, sale, currency) + except AttributeError: + columns = [] return [ line.product.as_('product'), line.quantity.as_('quantity'), @@ -48,7 +53,7 @@ class AbstractMixin: Literal(None).as_('customer'), point.storage_location.as_('location'), point.address.as_('shipment_address'), - ] + ] + columns @classmethod def _lines(cls):