Skip to content
Extraits de code Groupes Projets
Valider 9a84a03e rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[ADD] compute vendeur onchange du client sur account_move

parent 6c8ef28b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# Copyright 2021- Le Filament (https://le-filament.com) # Copyright 2021- Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models from odoo import api, fields, models
class AccountInvoice(models.Model): class AccountInvoice(models.Model):
...@@ -33,6 +33,10 @@ class AccountInvoice(models.Model): ...@@ -33,6 +33,10 @@ class AccountInvoice(models.Model):
# ------------------------------------------------------ # ------------------------------------------------------
# Computed fields / Search Fields # Computed fields / Search Fields
# ------------------------------------------------------ # ------------------------------------------------------
@api.onchange("partner_id")
def _update_invoice_default_sale_person(self):
for move in self.filtered("partner_id"):
move.invoice_user_id = move.partner_id.user_id or self.env.user
# ------------------------------------------------------ # ------------------------------------------------------
# Onchange / Constraints # Onchange / Constraints
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter