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.
This commit is contained in:
Cédric Krier
2024-09-05 19:27:36 +02:00
parent 6451c3f157
commit e495d2dbfa
+6 -1
View File
@@ -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):