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.

1

Questions about creating demo data and installation wizard

By
Benjamin Bachmann
on 1/27/15, 3:59 AM 2,367 views

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.

 

  1. 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?
  2. 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"/>

                <field name="order_policy">prepaid</field>

          </record>

 

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.

1

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/27/15, 4:31 AM

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).

0
Benjamin Bachmann
On 1/27/15, 5:05 AM

@Ivan

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 -*-

{

    'name': 'Testing',

    'category': 'Generic Modules',

    'summary': 'Test suite with demo data',

    'version': '1.0',

    'description': """

Testing

======================

 

    """,

    'author': "bloopark systems GmbH & Co. KG",

    'website': "http://www.bloopark.de",

    'depends': [

        'account',

        'account_chart',

        'base',

        'crm',

        'product',

        'purchase',

        'sale',

        'sale_stock',

        'stock',

        'l10n_de',

        'account',

        'account_accountant',

        'account_chart',

        'account_followup',

        'account_voucher',

        'analytic',

        'auth_signup',

        'base_action_rule',

        'base_iban',

        'base_import',

        'base_report_designer',

        'base_setup',

        'base_vat',

        'board',

        'claim_from_delivery',

        'contacts',

        'crm',

        'crm_claim',

        'crm_helpdesk',

        'crm_partner_assign',

        'crm_profiling',

        'delivery',

        'document',

        'email_template',

        'fetchmail',

        'hr',

        'hr_expense',

        'hr_holidays',

        'knowledge',

        'l10n_de',

        'mail',

        'marketing',

        'marketing_campaign',

        'note',

        'procurement',

        'product',

        'product_expiry',

        'purchase',

        'report_webkit',

        'resource',

        'sale',

        'sale_commission',

        'sale_crm',

        'sale_stock',

        'share',

        'stock',

        'stock_invoice_directly',

        'warning',

        'web',

        'web_calendar',

        'web_diagram',

        'web_gantt',

        'web_graph',

        'web_kanban',

        'web_tests',

        'web_view_editor',

        'admin_technical_features',

        'disable_openerp_online',

        'mrp'

 

    ],

    'data': [

 

        'demo/account/payment_terms.xml',

        'demo/account/account.xml',

        'demo/base/partners.xml',

        'demo/base/filters.xml',

        'demo/settings/common.xml',

        'demo/settings/companies.xml',

        'demo/settings/email.xml',

        'demo/settings/sequence.xml',

        'demo/settings/users.xml',

        'demo/settings/hr.employee.csv',

        'demo/product/catgeories.xml',

        'demo/product/pricelists.xml',

        'demo/crm/crm.xml',

        'demo/crm/crm.phonecall.csv',

        'demo/crm/business_portfolio.xml',

        'demo/sale_commission/commissions.xml',

        'demo/sale_commission/res.partner.xml',

        'demo/sale_commission/sale.agent.csv',

        'demo/sale_commission/settlement.csv',

        'demo/partner/res.partner.csv',

        'demo/product/products.xml',

        'demo/sale/res.partner.xml',

        'demo/sale/sale.order.csv',

        'demo/sale/sale.xml',

        'demo/sale/status.xml',

        'demo/sale/account.voucher.csv',

        'demo/sale/account_voucher_line.xml',

    ],

    'demo': [

    ],

    'installable': True,

    'auto_install': False,

}

 

Well, you need to trace back. The file odoo/odoo/addons/sale/sale_demo.xml that I mentioned in my answer creates sale.order, then confirms it. As for the account_id needed for the invoice, it is dependant on the Receivable Account set partner (Customer) you choose to create the sale.order

Ivan
on 1/27/15, 5:13 AM

Sorry, was cut earlier than I expected: Well, you need to trace back. The file odoo/odoo/addons/sale/sale_demo.xml that I mentioned in my answer creates sale.order, then confirms it. As for the account_id needed for the invoice, it is dependant on the Receivable Account set partner (Customer) you choose to create the sale.order and the account set in each of the sale.order.line (which is usually taken from the sale.order.line's product's account.

Ivan
on 1/27/15, 5:17 AM

Sorry, typo: You need to trace back. The file odoo/odoo/addons/sale/sale_demo.xml that I mentioned in my answer creates sale.order, then confirms it. As for the account_id needed for the invoice, it is dependant on the Receivable Account set at the partner (Customer) you choose to create the sale.order and the account set in each of the sale.order.line (which is usually taken from the sale.order.line's product's account.

Ivan
on 1/27/15, 5:18 AM
0

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 1/27/15, 5:40 AM

You can put your demo data in 'demo' key in __openerp__.py and then trigger the server with -i and -d options.

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

1 follower(s)

Stats

Asked: 1/27/15, 3:59 AM
Seen: 2367 times
Last updated: 3/16/15, 8:10 AM