[FIX] l10n_in_edi: export without shipping details

Before this commit, when we create an export Invoice ( foreign customer )
without shipping details and processing the invoice, the system asks for
mandatory to provide details of shipping, which are not compulsory to
generate an E-Invoice in India.

After this commit, the system will proceed with E-Invoicing in case of
export without shipping details on the invoice form.

closes odoo/odoo#98737

Task-id: 2948375
X-original-commit: d2d68fcc6c019847b552f3a61b6fabebeb13a354
Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
Nidhi Patel
2022-08-24 13:24:59 +02:00
parent f72963aba3
commit 6f30abe258
@@ -408,15 +408,23 @@ class AccountEdiFormat(models.Model):
if is_overseas:
json_payload.update({
"ExpDtls": {
"ShipBNo": invoice.l10n_in_shipping_bill_number or "",
"ShipBDt": invoice.l10n_in_shipping_bill_date
and invoice.l10n_in_shipping_bill_date.strftime("%d/%m/%Y") or "",
"Port": invoice.l10n_in_shipping_port_code_id.code or "",
"RefClm": tax_details_by_code.get("igst") and "Y" or "N",
"ForCur": invoice.currency_id.name,
"CntCode": saler_buyer.get("buyer_details").country_id.code or "",
}
})
if invoice.l10n_in_shipping_bill_number:
json_payload["ExpDtls"].update({
"ShipBNo": invoice.l10n_in_shipping_bill_number,
})
if invoice.l10n_in_shipping_bill_date:
json_payload["ExpDtls"].update({
"ShipBDt": invoice.l10n_in_shipping_bill_date.strftime("%d/%m/%Y"),
})
if invoice.l10n_in_shipping_port_code_id:
json_payload["ExpDtls"].update({
"Port": invoice.l10n_in_shipping_port_code_id.code
})
return json_payload
@api.model