customs declaration: specify invoice number, not picking number
This commit is contained in:
parent
1287ccf59d
commit
2dd63fa309
|
@ -149,11 +149,20 @@ class SCDeliveryCarrier(models.Model):
|
||||||
total = 0.0
|
total = 0.0
|
||||||
for i in items:
|
for i in items:
|
||||||
total += i['value_amount']
|
total += i['value_amount']
|
||||||
|
invoice_number = picking.name
|
||||||
|
invoice_date = picking.date
|
||||||
|
if picking.sale_id and picking.sale_id.invoice_ids:
|
||||||
|
invoices = picking.sale_id.invoice_ids.filtered(lambda r: r.type == 'out_invoice' and
|
||||||
|
r.state not in ['draft', 'cancel'])
|
||||||
|
if len(invoices):
|
||||||
|
invoice_number = invoices[0].number
|
||||||
|
invoice_date = invoices[0].date_invoice
|
||||||
customs = {
|
customs = {
|
||||||
'contents_type': 'commercial_goods',
|
'contents_type': 'commercial_goods',
|
||||||
'contents_explanation': explanation,
|
'contents_explanation': explanation,
|
||||||
'currency': currency,
|
'currency': currency,
|
||||||
'invoice_number': picking.name,
|
'invoice_number': invoice_number,
|
||||||
|
#'invoice_date': ''.join(c for c in invoice_date if c.isdigit()),
|
||||||
'total_value_amount': total,
|
'total_value_amount': total,
|
||||||
'items': items
|
'items': items
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue