Skip to content

Commit

Permalink
[FIX] Create delivery note only after quantity done has been set
Browse files Browse the repository at this point in the history
  • Loading branch information
are-agilebg committed Jan 14, 2025
1 parent 15dedcf commit aab2be3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion l10n_it_delivery_note/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ def button_validate(self):
if not self.delivery_note_id and delivery_note_to_create:
self._check_delivery_note_consistency()
res = super().button_validate()
if delivery_note_to_create and not self.delivery_note_id:
if (
delivery_note_to_create and
not self.delivery_note_id and
isinstance(res, bool)
):
delivery_note = self._create_delivery_note()
self.write({"delivery_note_id": delivery_note.id})
if self.sale_id:
Expand Down

0 comments on commit aab2be3

Please sign in to comment.