Skip to content
Snippets Groups Projects
Commit bd5071ac authored by Guillaume (guva)'s avatar Guillaume (guva)
Browse files

[FIX] l10n_de: add shipping address to invoice report


With this commit, we add the shipping address
to the invoice report when it is different from
the invoicing address.
We do the same way as in l10n_de_sale/models/sale.py
and l10n_de_purchase/models/purchase.py,
by adding the computed field l10n_de_addresses
in account_move.

Steps:

- Insltall l10n_de and sale
- Set Customer addresses in settings
- Ensure that DIN5008 is set as document layout
- Create and confirm an invoice with delivery
  address different than invoicing address
- Print or preview invoice
-> Shipping address does not appear on report

opw-3090418

closes odoo/odoo#108675

Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
parent ab9d2240
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ class AccountMove(models.Model):
l10n_de_template_data = fields.Binary(compute='_compute_l10n_de_template_data')
l10n_de_document_title = fields.Char(compute='_compute_l10n_de_document_title')
l10n_de_addresses = fields.Binary(compute='_compute_l10n_de_addresses')
def _compute_l10n_de_template_data(self):
for record in self:
......@@ -38,3 +39,14 @@ class AccountMove(models.Model):
record.l10n_de_document_title = _('Vendor Credit Note')
elif record.move_type == 'in_invoice':
record.l10n_de_document_title = _('Vendor Bill')
def _compute_l10n_de_addresses(self):
for record in self:
record.l10n_de_addresses = data = []
if record.partner_shipping_id == record.partner_id:
data.append((_("Invoicing and Shipping Address:"), record.partner_shipping_id))
elif record.move_type in ("in_invoice", "in_refund"):
data.append((_("Invoicing and Shipping Address:"), record.partner_id))
else:
data.append((_("Shipping Address:"), record.partner_shipping_id))
data.append((_("Invoicing Address:"), record.partner_id))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment