From 9c8ef5f4fd2b318b8325c20aa903aeed56ead093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Oct 2022 13:30:06 +0200 Subject: [PATCH] Set default value from context for stock reporting margin context issue11765 review419891003 (grafted from 9b78ba030c62e8cd02efcc7294101f00aa0647d3) --HG-- branch : 6.0 --- stock_reporting_margin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stock_reporting_margin.py b/stock_reporting_margin.py index b17a4b2669..a5efc33237 100644 --- a/stock_reporting_margin.py +++ b/stock_reporting_margin.py @@ -26,3 +26,7 @@ class Context(metaclass=PoolMeta): __name__ = 'stock.reporting.margin.context' include_shipment_cost = fields.Boolean("Include Shipment Cost") + + @classmethod + def default_include_shipment_cost(cls): + return Transaction().context.get('include_shipment_cost', False)