File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
l10n_it_delivery_note/wizard Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,13 @@ def create_invoices(self):
5050 delivery_note_ids = self .env ["stock.delivery.note" ].browse (
5151 self ._context .get ("active_ids" , [])
5252 )
53- if len (delivery_note_ids .mapped ("partner_id" )) > 1 :
54- raise UserError (
55- self .env ._ ("You must select only delivery notes from one partner." )
53+ for partner in delivery_note_ids .mapped ("partner_id" ):
54+ dns_partner = delivery_note_ids .filtered (
55+ lambda dn , p = partner : dn .partner_id == p
56+ )
57+ dns_partner .action_invoice (
58+ invoice_method = self .invoice_method , final = self .deduct_down_payments
5659 )
57- delivery_note_ids .action_invoice (
58- invoice_method = self .invoice_method , final = self .deduct_down_payments
59- )
6060 invoices_ids = delivery_note_ids .mapped ("invoice_ids" )
6161 if not invoices_ids :
6262 raise UserError (
You can’t perform that action at this time.
0 commit comments