@@ -20,25 +20,26 @@ class AccountMove(models.Model):
20
20
related = "payment_mode_id.payment_method_id.mandate_required" , readonly = True
21
21
)
22
22
23
- @api .model
24
- def create (self , vals ):
25
- """Fill the mandate_id from the partner if none is provided on
26
- creation, using same method as upstream."""
27
- onchanges = {
28
- "_onchange_partner_id" : ["mandate_id" ],
29
- "_onchange_payment_mode_id" : ["mandate_id" ],
30
- }
31
- for onchange_method , changed_fields in list (onchanges .items ()):
32
- if any (f not in vals for f in changed_fields ):
33
- move = self .new (vals )
34
- move = move .with_company (move .company_id .id )
35
- getattr (move , onchange_method )()
36
- for field in changed_fields :
37
- if field not in vals and move [field ]:
38
- vals [field ] = move ._fields [field ].convert_to_write (
39
- move [field ], move
40
- )
41
- return super ().create (vals )
23
+ @api .model_create_multi
24
+ def create (self , vals_list ):
25
+ for vals in vals_list :
26
+ """Fill the mandate_id from the partner if none is provided on
27
+ creation, using same method as upstream."""
28
+ onchanges = {
29
+ "_onchange_partner_id" : ["mandate_id" ],
30
+ "_onchange_payment_mode_id" : ["mandate_id" ],
31
+ }
32
+ for onchange_method , changed_fields in list (onchanges .items ()):
33
+ if any (f not in vals for f in changed_fields ):
34
+ move = self .new (vals )
35
+ move = move .with_company (move .company_id .id )
36
+ getattr (move , onchange_method )()
37
+ for field in changed_fields :
38
+ if field not in vals and move [field ]:
39
+ vals [field ] = move ._fields [field ].convert_to_write (
40
+ move [field ], move
41
+ )
42
+ return super ().create (vals_list )
42
43
43
44
def set_mandate (self ):
44
45
if self .payment_mode_id .payment_method_id .mandate_required :
0 commit comments