Lot invoicing + Fee
This commit is contained in:
@@ -4869,7 +4869,7 @@ class LotInvoice(Wizard):
|
||||
break
|
||||
if not invoice_line:
|
||||
raise UserError("No invoice line was generated from the selected lots.")
|
||||
self._invoice_selected_fees()
|
||||
self._invoiced_fee_count = self._invoice_selected_fees()
|
||||
self.message.invoice = invoice_line.invoice
|
||||
|
||||
return 'message'
|
||||
@@ -4895,6 +4895,7 @@ class LotInvoice(Wizard):
|
||||
fees.append(fee)
|
||||
if fees:
|
||||
Fee.invoice(fees)
|
||||
return len(fees)
|
||||
|
||||
@classmethod
|
||||
def _split_sale_padding(cls, padding, lots):
|
||||
@@ -4913,10 +4914,16 @@ class LotInvoice(Wizard):
|
||||
lot.sale_invoice_padding = padding_by_lot.get(lot.id, Decimal(0))
|
||||
Lot.save(lots)
|
||||
|
||||
def default_message(self, fields):
|
||||
return {
|
||||
'message': 'The invoice has been successfully created.',
|
||||
}
|
||||
def default_message(self, fields):
|
||||
fee_count = getattr(self, '_invoiced_fee_count', 0)
|
||||
message = 'The invoice has been successfully created.'
|
||||
if fee_count:
|
||||
message += (
|
||||
' %s selected fee invoice(s) have also been processed.'
|
||||
% fee_count)
|
||||
return {
|
||||
'message': message,
|
||||
}
|
||||
|
||||
def do_see_invoice(self, action):
|
||||
action['views'].reverse() # pour ouvrir en form directement
|
||||
|
||||
Reference in New Issue
Block a user