Skip to content

Commit e31b374

Browse files
committed
fixup! [IMP] sale_order_action_invoice_create_hook: Add more options to the hook
1 parent 30162f6 commit e31b374

File tree

1 file changed

+4
-5
lines changed
  • sale_order_action_invoice_create_hook

1 file changed

+4
-5
lines changed

sale_order_action_invoice_create_hook/hooks.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ def new_action_invoice_create(self, grouped=False, final=False):
9696
# Change to true if new lines are added
9797
new_lines = True
9898
# END HOOOK
99-
100-
if references.get(invoices.get(group_key)):
101-
if order not in references[invoices[group_key]]:
102-
references[invoice] = references[invoice] | order
99+
if references.get(invoices.get(group_key)):
100+
if order not in references[invoices[group_key]]:
101+
references[invoice] = references[invoice] | order
103102

104103
# START HOOK
105104
# WAS: if not invoices:
106105
# Check if new lines have been added in order to determine whether
107106
# there are invoice lines or not
108-
if not new_lines:
107+
if not new_lines and not self.env.context.get('no_check_lines', False):
109108
raise UserError(_('There is no invoicable line.'))
110109
# END HOOK
111110

0 commit comments

Comments
 (0)