Odoo Help

Welcome!

This community 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.

0

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

By
anis
on 9/11/15, 12:34 PM 752 views

Hi,

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

thanks

2

Axel Mendoza

--Axel Mendoza--
10318
| 7 7 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 an 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
0

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
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)">

Regards.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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