File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,12 @@ def _auto_refresh_delivery(self):
67
67
if self .state in {"draft" , "sent" }:
68
68
price_unit = self .carrier_id .rate_shipment (self )["price" ]
69
69
if not self .is_all_service :
70
- self ._create_delivery_line (self .carrier_id , price_unit )
71
- self .with_context (auto_refresh_delivery = True ).write (
72
- {"recompute_delivery_price" : False }
73
- )
70
+ self .with_context (skip_validation_check = True )._create_delivery_line (
71
+ self .carrier_id , price_unit
72
+ )
73
+ self .with_context (
74
+ auto_refresh_delivery = True , skip_validation_check = True
75
+ ).write ({"recompute_delivery_price" : False })
74
76
75
77
@api .model
76
78
def create (self , vals ):
Original file line number Diff line number Diff line change @@ -303,8 +303,7 @@ def test_auto_refresh_so_and_unlink_line(self):
303
303
self .assertFalse (delivery_line .exists ())
304
304
305
305
def test_auto_add_delivery_line_add_service (self ):
306
- """Delivery line should not be created because
307
- there are only service products in SO"""
306
+ self .env ["ir.config_parameter" ].sudo ().set_param (self .auto_add_delivery_line , 1 )
308
307
service = self .env ["product.product" ].create (
309
308
{"name" : "Service Test" , "type" : "service" }
310
309
)
You can’t perform that action at this time.
0 commit comments