Skip to Content
Menú
This question has been flagged
1 Respondre
2039 Vistes

A customer asked me to also include the full name of the sales person in invoices. I'm assuming this is required under Belgian law, because otherwise the customer wouldn't bother to do this.

My question is: how do I do this? I can't find a single setting that gives the desired result.

Thanks in avance.

Avatar
Descartar
Best Answer

Hi,

You can add the Salesperson in the invoice report in two ways

1)a. First you need to locate the actual invoice layout template of the specific country localization from the addonsb. Inherit the template in your custom modulec. Add a new div inside the template and call the salesperson from the objectd. Run the module
2)In each template layout there is a python function to get the contact information. You can override that function and add a salesperson to it.
example:


from odoo.addons.l10n_din5008.models.account_move import AccountMove
from odoo import models, _
from odoo.tools import format_date


class AccountMove(models.Model):
    _inherit = 'account.move'

    def _compute_l10n_din5008_template_data(self):
        for record in self:
            record.l10n_din5008_template_data = data = []
            if record.name:
                data.append((_("Invoice No."), record.name))
            if record.invoice_date:
                data.append((_("Invoice Date"),
                             format_date(self.env, record.invoice_date)))
            if record.invoice_date_due:
                data.append((_("Due Date"),
                             format_date(self.env, record.invoice_date_due)))
            if record.delivery_date:
                data.append((_("Delivery Date"),
                             format_date(self.env, record.delivery_date)))
            if record.invoice_origin:
                data.append((_("Sales Order"), record.invoice_origin))
            if record.ref:
                data.append((_("Customer Reference"), record.ref))
            if record.invoice_user_id:
                data.append((_("Salesperson"), record.invoice_user_id.name))

    AccountMove._compute_l10n_din5008_template_data = _compute_l10n_din5008_template_data

The above code is an example of a function in a specific localization template. So instead of it you can find the function of your localization and add similar things.

Regards

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de juny 25
1471
5
d’ag. 24
3641
1
de jul. 24
4448
0
de febr. 24
1754
5
de gen. 24
7773