details:   https://code.tryton.org/tryton/commit/741a31ec9455
branch:    default
user:      Cédric Krier <[email protected]>
date:      Thu Oct 30 10:23:35 2025 +0100
description:
        Set shipment cost method to order for sale from web shop

        Closes #14336
diffstat:

 modules/web_shop/tryton.cfg |  5 +++++
 modules/web_shop/web.py     |  9 +++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r 11be2165a504 -r 741a31ec9455 modules/web_shop/tryton.cfg
--- a/modules/web_shop/tryton.cfg       Mon Oct 27 15:52:04 2025 +0100
+++ b/modules/web_shop/tryton.cfg       Thu Oct 30 10:23:35 2025 +0100
@@ -15,6 +15,7 @@
     product_attribute
     product_image
     sale_price_list
+    sale_shipment_cost
 xml:
     web.xml
     product.xml
@@ -52,3 +53,7 @@
 [register sale_price_list]
 model:
     web.Shop_PriceList
+
+[register sale_shipment_cost]
+model:
+    web.Shop_ShipmentCost
diff -r 11be2165a504 -r 741a31ec9455 modules/web_shop/web.py
--- a/modules/web_shop/web.py   Mon Oct 27 15:52:04 2025 +0100
+++ b/modules/web_shop/web.py   Thu Oct 30 10:23:35 2025 +0100
@@ -301,6 +301,15 @@
         return sale
 
 
+class Shop_ShipmentCost(metaclass=PoolMeta):
+    __name__ = 'web.shop'
+
+    def get_sale(self, party=None):
+        sale = super().get_sale(party=party)
+        sale.shipment_cost_method = 'order'
+        return sale
+
+
 class Shop_TaxRuleCountry(metaclass=PoolMeta):
     __name__ = 'web.shop'
 

Reply via email to