Hi,
When setting up a new db from proteus, is it mandatory to call the wizards (ie,
to simulate the actions done from the client) or is it possible/recommended to
bypass it and populate directly the db?
Below the two ways I tried.
Seems that the company doesn’t become the default company for the next script
lines with the second method.
With the wizard way, where can I find the form parameters to be filled ?
# wizard
company_config = Wizard('company.company.config')
company_config.execute('company')
company = company_config.form
company.name = MY_DATA['company']['name']
euro, = Currency.find([('code', '=', MY_DATA['company']['currency'])])
company.currency = euro
company.footer = MY_DATA['company']['footer']
company.party = Party()
company_config.execute('add')
company, = Company.find()
or
# simply create company
party = Party(name=MY_DATA['company']['name'], lang=fr)
party.save()
company = Company(party=party, currency=euro)
company.footer = MY_DATA['company']['footer']
company.timezone = MY_DATA['company']['timezone']
company.vat_country = MY_DATA['company']['country']
company.vat_number = MY_DATA['company']['vat_number']
company.save()
Jean-Christophe Michel
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/34F69FEB-CCAA-4125-91AD-EA637056C9BB%40symetrie.com.