mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: draft invoice use invoice_date_due
This commit is contained in:
@@ -796,6 +796,13 @@ class PmsFolioService(Component):
|
||||
self.env["ir.config_parameter"].sudo().get_param("web.base.url")
|
||||
+ move_url
|
||||
)
|
||||
invoice_date = (
|
||||
move.invoice_date.strftime("%d/%m/%Y")
|
||||
if move.invoice_date
|
||||
else move.invoice_date_due.strftime("%d/%m/%Y")
|
||||
if move.invoice_date_due
|
||||
else None
|
||||
)
|
||||
invoices.append(
|
||||
PmsFolioInvoiceInfo(
|
||||
id=move.id if move.id else None,
|
||||
@@ -803,9 +810,7 @@ class PmsFolioService(Component):
|
||||
amount=round(move.amount_total, 2)
|
||||
if move.amount_total
|
||||
else None,
|
||||
date=move.invoice_date.strftime("%d/%m/%Y")
|
||||
if move.invoice_date
|
||||
else None,
|
||||
date=invoice_date,
|
||||
state=move.state if move.state else None,
|
||||
paymentState=move.payment_state
|
||||
if move.payment_state
|
||||
|
||||
@@ -146,6 +146,8 @@ class PmsInvoiceService(Component):
|
||||
# so, we need to save and rewrite it. in all line that are not updated or deleted
|
||||
for line in invoice.invoice_line_ids.filtered(
|
||||
lambda l: l.id not in updated_invoice_lines_name
|
||||
if updated_invoice_lines_name
|
||||
else []
|
||||
and l.id
|
||||
not in [
|
||||
line[1] for line in new_vals["invoice_line_ids"] if line[0] == 2
|
||||
|
||||
Reference in New Issue
Block a user