Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
6581 Vistas

Hi everyone !

I have a request for a Odoo 8.0.

I want to create automatically an account when I create a partner. For exemple, if I create a partner named "Mr Smith", I want an account named "CSMITH" but I don't want to create manually each account.

For now, each partner I create have for account "110200".

Sorry if I'm not clear, but I'm originaly french.

Where I can configure that ?

Thanks for your help

Avatar
Descartar
Mejor respuesta

Hi Jfs,
To achieve the above i think you have to super the create function of the res.partner . After supering the create function you have to create a account from the code  for the partner and can assign the name of account as partners name.

Thank you

class ResPartner(models.Model):
_inherit = 'res.partner'

@api.model
def create(self, vals):
res= super(ResPartner, self).create(vals)
#write the code for creating the account and assign to partner
return res
Avatar
Descartar
Mejor respuesta

Odoo does automatically create customer/vendor accounts in the accounts payables/receivables accounting when you create customers or vendors. This is common behaviour of accounts receivables/payables accounting applications and the purpose is to avoid creating separate general ledger accounts for each customer/vendor. I do not know any possible use case which would make such requirement meaningful (except of banking business, but then you need a banking software and not an ERP software like Odoo).

But if you have sound accounting knowledge  and you know the reason for your requirement, then Niyas answer will help you.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
feb 16
11166
0
oct 15
3710
1
mar 15
4552
0
mar 15
4270
3
feb 16
6328