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 import income and expense account for product

By
Daniel Frey
on 9/7/13, 1:00 PM 2,846 views

Hi

I would like to define income and expense accounts for a product during a csv-import. What I tried so far is to export keys "property_account_expense/id" and "property_account_income/id". They contain values like "product_product_721_1", "product_product_721_2" aso. So they seem not to reference an existing account directly. How can I reference an existing account, say "account_account_721"?

Cheers Daniel

Locate the account you want to reference from accounts. Export the accounts, get the ids and add these ids in the right column of your product csv sheet.

kaynis
on 9/7/13, 7:28 PM

I tried this. Getting an error like "No matching record found for external id 'account_account_721' in field 'Expense Account' at row 2" for each line.

Daniel Frey
on 9/8/13, 6:10 AM

Silly question to ask but are you sure you are using the correct account required by the field? or the account is created correctly?

kaynis
on 9/8/13, 4:56 PM

Please patch the bug outlined at https://bugs.launchpad.net/openobject-server/+bug/1194893 - if you are getting a second underscore, this bug is preventing the generation of correct XML id's for related fields.

Bista Solutions US, Ray Carnes
on 9/9/13, 9:00 PM
0

Olivier Dony (odo)

--Olivier Dony (odo)--
2112
| 7 6 7
--Olivier Dony (odo)--

 

Olivier Dony (odo)
On 9/9/13, 12:19 PM

You seem to be doing the right thing. When you export the "Expense Account" and "Income Account" columns, you should not pay attention to the looks of the External ID of those accounts, it's correct, Technically it will look like __export__.product_product_864 simply because it was generated on-the-fly while performing an export of product with ID 864. But it still refers to an account, so you can reuse it for another product if you want to use the same account.

Have you actually tried to copy that value (including the __export__ prefix!) to another product and re-import that modified file? Does it work? It should work just fine.

Note that providing an External ID for filling in a column is only one of the possible options, albeit the safer one. You can also change the title of the column and drop the /id part (i.e. property_account_income/id becomes property_account_income) and then provide the account name (ideally unique!) or preferably the account code in that column, instead of the External ID.

This solves it. Thanks a lot. It is not even necessary to add "/code" to import the unique account codes. "property_account_income" is enough. Actually, it does perfectly work withouth the "__export__." prefix to import the codes. I tried the generated on-the-fly ids, they cannot be imported (tried without the prefix though).

Daniel Frey
on 9/9/13, 2:29 PM

Yes, the __export__ prefix is actually a pseudo-module name and it is a part of the External IDs. That probably explains why the generated IDs did not work for you. For other values (names or codes) there is no prefix, you must use the exact name/code.

Olivier Dony (odo)
on 9/9/13, 2:44 PM

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

0 follower(s)

Stats

Asked: 9/7/13, 1:00 PM
Seen: 2846 times
Last updated: 3/16/15, 8:10 AM