File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
stock_product_pack/models Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 66class ProcurementGroup (models .Model ):
77 _inherit = "procurement.group"
88
9+ def is_pack_dont_create_move (self , product ):
10+ return (
11+ product
12+ and product .pack_ok
13+ and product .dont_create_move
14+ and product .pack_type == "detailed"
15+ )
16+
917 @api .model
1018 def run (self , procurements , raise_user_error = True ):
1119 """If 'run' is called on a pack product storable.
1220 we remove the procurement with this product pack.
1321 """
1422 for procurement in procurements :
15- if (
16- procurement .product_id
17- and procurement .product_id .pack_ok
18- and procurement .product_id .dont_create_move
19- and procurement .product_id .pack_type == "detailed"
20- ):
23+ if self .is_pack_dont_create_move (procurement .product_id ):
2124 procurements .remove (procurement )
2225
2326 return super ().run (procurements , raise_user_error = raise_user_error )
You can’t perform that action at this time.
0 commit comments