Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] l10n_it_delivery_note: fix delivery note invoice assignment by using invoice IDs #4591

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion l10n_it_delivery_note/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ def button_validate(self):
delivery_note = self._create_delivery_note()
self.write({"delivery_note_id": delivery_note.id})
if self.sale_id:
self.sale_id._assign_delivery_notes_invoices(self.sale_id.invoice_ids)
self.sale_id._assign_delivery_notes_invoices(
self.sale_id.invoice_ids.ids
)
return res

def _create_delivery_note(self):
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_delivery_note/wizard/delivery_note_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def confirm(self):

self.selected_picking_ids.write({"delivery_note_id": delivery_note.id})
if sale_order_id:
sale_order_id._assign_delivery_notes_invoices(sale_order_id.invoice_ids)
sale_order_id._assign_delivery_notes_invoices(sale_order_id.invoice_ids.ids)

if self.user_has_groups("l10n_it_delivery_note.use_advanced_delivery_notes"):
return delivery_note.goto()
2 changes: 1 addition & 1 deletion l10n_it_delivery_note/wizard/delivery_note_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
sale_order_ids = self.selected_picking_ids.sale_id
sale_order_id = sale_order_ids and sale_order_ids[0] or self.env["sale.order"]
if sale_order_id:
sale_order_id._assign_delivery_notes_invoices(sale_order_id.invoice_ids)
sale_order_id._assign_delivery_notes_invoices(sale_order_id.invoice_ids.ids)

Check warning on line 66 in l10n_it_delivery_note/wizard/delivery_note_select.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_delivery_note/wizard/delivery_note_select.py#L66

Added line #L66 was not covered by tests

if self.user_has_groups("l10n_it_delivery_note.use_advanced_delivery_notes"):
return self.delivery_note_id.goto()
Loading