Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi i like to create my own demo data by adding records and dependencies to one of my own add-ons. I created all the records but i get stuck with some Problems. I am using the newest Version from odoo 8 from github.
* I do not want the original demo data from odoo just my own, so i do not check the demo data box then creating a database. My demo Data comes from a data.xml.
- Is it possible to integrate demo data for the installation wizards ? For example to set the tax by default to german 19% and use german Financing ? So all is set then I put in my add-on the dependency of the sale module?
- I created demo sale orders and demo sale_order_lines and like to get some of them confirmed and i tried to make it like the original demo data but at the point then they should use a workflow like:
<record id="testing.sale_order_1" model="sale.order">
<field name="warehouse_id" ref="stock.warehouse0"/>
I get an error :
ParseError: ""null value in column "account_id" violates not-null constraint
" while evaluating
u'action_invoice_create()'" while parsing /var/www/addons/testing/demo/sale/status.xml:456, near
<record id="testing.sale_order_1" model=„sale.order">
But if I install the sale module upfront and set the tax and the financing it works like a charm and orders are confirmed an invoices are created and confirmed
How can i get the account_id in the records, because i cant see how it is done with the original demo content. There is no information of a account_id and for my understanding account_ids are created from odoo.
It would be a lot of things that you need to consider if you want to load your demo data without Odoo's:
- Odoo's demo data is loaded if you create a new database with demo data. This will upload all XML files that are listed in the 'demo' key in each of installed __openerp__.py. Hence, if you want to separate your demo data from Odoo's from creation point of view, you cannot put the XML file in 'demo' key. Which means you are left with the 'data' key to list the XML file. But that means your data will be created regardless whether you choose to create the new database with demo data or not. There are other options such as removing all the files listed in 'demo' in all module except yours or change Odoo to only upload 'demo' XML files from your module.
- To make your demo data usable, you need to create necessary prerequisite data (accounts, tax, warehouses, locations, partners, etc) before you create your demo data. The accounts used in Odoo demo is defined in the XML files in odoo/addons/account/demo folder, which is later used in the sale module's demo data (odoo/odoo/addons/sale/sale_demo.xml).
In short, in my opinion it would be a hassle to load your demo data but not Odoo's.
Your module need to depends on the appropriate modules. You stated that "if I install the sale module upfront ...". From the pieces of codes that you have posted here, you are using (creating) 'sale.order' model, then your module need to depends on 'sale' module (in the least).
You can customize installation wizard to capture new fields. The sales tax is included in the installation wizard of account module (odoo/addons/account/res_config.py, see how 'sale_tax' is defined, used, and stored in set_default_taxes method).
Thx for the quick response
I know it is a lot of work to create something like demo data from scratch without the original demo data.
I already work on this for a while and put a lot of data together:
I do not want to check the demo data box from odoo I want my data supplied then installing the testing add-on witch should put demo data in a fresh db so can rum yaml and unit tests with my own data.
It all works fine but some specific information i do not know how to put in an xml. see in my question.
my __openerp__.py looks something like this:
# -*- coding: utf-8 -*-
'category': 'Generic Modules',
'summary': 'Test suite with demo data',
'author': "bloopark systems GmbH & Co. KG",
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/27/15, 3:59 AM|
|Seen: 3198 times|
|Last updated: 3/16/15, 8:10 AM|