@@ -8,14 +8,30 @@ class StockPicking(models.Model):
8
8
_inherit = "stock.picking"
9
9
10
10
def _check_required_package_measurement (self ):
11
- """Check the required measurement on destination pacakges.
12
-
13
- If package is None all result packages on the stock pickings are checked
14
- otherwise only the one
15
- """
11
+ """Check the required measurement on destination pacakges."""
16
12
packages = self .move_line_ids .mapped ("result_package_id" )
17
13
packages ._check_required_dimension ()
18
14
19
15
def button_validate (self ):
20
16
self ._check_required_package_measurement ()
21
17
return super ().button_validate ()
18
+
19
+ def _put_in_pack (self , move_line_ids , create_package_level = True ):
20
+ res = super ()._put_in_pack (
21
+ move_line_ids , create_package_level = create_package_level
22
+ )
23
+ package_length = self ._context .get ("choose_delivery_package_length" , 0 )
24
+ package_width = self ._context .get ("choose_delivery_package_width" , 0 )
25
+ package_height = self ._context .get ("choose_delivery_package_height" , 0 )
26
+ package_weight = self ._context .get ("choose_delivery_package_pack_weight" , 0 )
27
+
28
+ res .write (
29
+ {
30
+ "pack_length" : package_length ,
31
+ "width" : package_width ,
32
+ "height" : package_height ,
33
+ "pack_weight" : package_weight ,
34
+ }
35
+ )
36
+
37
+ return res
0 commit comments