Skip to Content
Menu
This question has been flagged
325 Views

Hello,

I wrote the following code in a webhook ; everything works except that when I check the partner, there is no link to the account ; even if it is created (so I need to do it manually). No error raised.


Thanks in advance


NB: default model in my webhook 'res.partner'


Python code:


model_accounting =env['account.account']

nomducompte = payload.get('nomducompte')

code411 = payload.get('compte411')

idSF = payload.get('IDSF') #ID Salesforce


rec411 = model_accounting.create({

    'name' : nomducompte,

    'code' : code411,

    'account_type' : 'asset_receivable',

    'reconcile' : True,

    'company_id' : 1 

})


valeurs = { 

    'name': nomducompte,

    'x_studio_id_salesforce' : idSF,

    'property_account_receivable_id' : rec411['id'], # DOES NOT WORK

# DOES NOT WORK     'property_account_receivable_id' : rec411.id}) #DOES NOT WORK


Avatar
Discard