Odoo Help


How to make Account Receivable and Account Payable fields auto-incriment

on 9/11/15, 12:34 PM 1,168 views


i want to make  Account Receivable and Account Payable fields auto incriment exp, in the accounting chart ;custumer account is : 411100

for the custumer 1 with the name c1, i want to creat automaticlly an Account Receivable 411101 c1

for the custumer 2 with the name c2, i want to creat automaticlly an Account Receivable 411102 c2



Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
On 9/12/15, 2:08 PM

You will be ending with one account per customer, why?, you could use an account.analytic.account by put an inherits with that model instead to don't mess the account chart like are done for project.project. Analytic accounts are more suitable for this, just my opinion, if you have requirements for that then move on, also account.journal could be used too for that.

+1 What anis wants is contrary to collective accounts for the purpose of a regular accounts payable/receivable management.

Ermin Trevisan
on 9/14/15, 3:22 AM

Vale Trood

--Vale Trood--

| 5 2 7
Tunis, France
--Vale Trood--

Vale Trood
On 9/11/15, 1:43 PM


Hey friend try to create a function which will add for each customer do like this:

1. add 411101 + custmer..id

2. concatenate the first result with the name of the customer

Which means a function like this:

def get_inputs(self, cr, uid,ids, field_id, context=None): 

obj = self.pool.get('table_of_cutomers') 

id_var = self.read(cr, uid,ids,['id','name_customer'])

obj_ids = obj.search(cr, uid, [('name_customer', '=', field_id)])

and then you will add (411101 + id) put it in a variable and concatenate i as i told you.

To call your function you can call an on_change function like this:

def on_change_customer_id(self, cr, uid, ids, field_id, context=None):

res = {'value':{'customer_ids': self.get_inputs(cr, uid, ids, field_id, context=context),


return res

Dont forget the xml:

<field name="field_id" on_change="on_change_customer_id(field_id)">


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 9/11/15, 12:34 PM
Seen: 1168 times
Last updated: 9/12/15, 2:08 PM