Skip to Content
Menu
This question has been flagged
2 Replies
5494 Views

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
Discard
Best Answer

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
2
Feb 16
10139
0
Oct 15
2950
1
Mar 15
3603
0
Mar 15
3216
3
Feb 16
5549