跳至内容
菜单
此问题已终结
2 回复
6583 查看

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

形象
丢弃
最佳答案

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
形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
2
2月 16
11167
0
10月 15
3710
1
3月 15
4553
0
3月 15
4270
3
2月 16
6330