[IMP] pms: allow partial invoicing (#61)

* [IMP] pms: allow partial invoicing

* [FIX] pms: precommit fixes

* [FIX] pms: uncomment init test file
This commit is contained in:
Miguel Padin
2021-03-01 16:23:21 +01:00
committed by GitHub
parent 965a03881c
commit f28cc65dcd
5 changed files with 207 additions and 22 deletions

View File

@@ -285,4 +285,12 @@ class FolioAdvancePaymentInv(models.TransientModel):
)
if not lines_to_invoice:
raise UserError(_("Nothing to invoice"))
return lines_to_invoice
lines_dict = dict()
for line in lines_to_invoice:
if not line.display_type:
lines_dict[line.id] = line.qty_to_invoice
else:
lines_dict[line.id] = 0
return lines_dict
# return lines_to_invoice