Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2036 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 25
1470
5
sie 24
3633
1
lip 24
4447
0
lut 24
1751
5
sty 24
7765