İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1083 Görünümler

When we create an invoice in the accounting app, we select a contact as customer. But, when we go to Other Info, the salesperson is the user that create the invoice, not the one associated to the contact. Is there a way to configure it to take the salesperson associated to the contact as default value?

Avatar
Vazgeç
En İyi Yanıt

Hi,

Please refer to the code:


from odoo import models, api

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

@api.onchange('partner_id')
def _onchange_partner_id_set_salesperson(self):
if self.partner_id and self.partner_id.user_id:
self.user_id = self.partner_id.user_id


Hope it helps.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eyl 25
340
2
Eyl 25
243
1
Eyl 25
310
5
Eyl 25
1206
Overpaid Invoice Çözüldü
1
Eyl 25
438