mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: add isDownpayment to folio line datamodel
This commit is contained in:
@@ -17,3 +17,4 @@ class PmsFolioSaleInfo(Datamodel):
|
||||
serviceId = fields.Integer(required=False, allow_none=True)
|
||||
displayType = fields.String(required=False, allow_none=True)
|
||||
defaultInvoiceTo = fields.Integer(required=False, allow_none=True)
|
||||
isDownPayment = fields.Boolean(required=False, allow_none=True)
|
||||
|
||||
@@ -518,6 +518,7 @@ class PmsFolioService(Component):
|
||||
defaultInvoiceTo=sale_line.default_invoice_to
|
||||
if sale_line.default_invoice_to
|
||||
else None,
|
||||
isDownPayment=sale_line.is_down_payment,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -130,7 +130,9 @@ class PmsInvoiceService(Component):
|
||||
if pms_invoice_info.originDownPaymentId:
|
||||
if not pms_invoice_info.partnerId:
|
||||
raise UserError(_("For manual invoice, partner is required"))
|
||||
payment = self.env["account.payment"].browse(pms_invoice_info.paymentId)
|
||||
payment = self.env["account.payment"].browse(
|
||||
pms_invoice_info.originDownPaymentId
|
||||
)
|
||||
self.env["account.payment"]._create_downpayment_invoice(
|
||||
payment=payment,
|
||||
partner_id=pms_invoice_info.partnerId,
|
||||
|
||||
Reference in New Issue
Block a user