On Friday, June 9, 2017 at 4:26:30 PM UTC+9, Sergi Almacellas Abellana
wrote:
>
> El 09/06/17 a les 07:05, Dr Praveen Bhatia ha escrit:
> > Hi
> > What is the proteus code to reload country list ?
> > I am getting empty country list.
> > Praveen
>
> There is no proteus code. The country list is included as static data of
> the country module. You should update the module in order to make the
> data available.
>
> What I can not understand is how you made it to have and empty country
> list :$
>
>
> --
> Sergi Almacellas Abellana
> www.koolpi.com
> Twitter: @pokoli_srk
>
This is the code that I wrote:
import os
os.environ['DB_NAME']='mydb'
from trytond.tests.test_tryton import db_exist,
drop_create,create_db,drop_db
from proteus import config, Model, Wizard
def activate_modules(modules):
if isinstance(modules, basestring):
modules = [modules]
#drop_create()
cfg = config.set_trytond('mydb')
Module = Model.get('ir.module')
modules = Module.find([
('name', 'in', modules),
])
Module.click(modules, 'activate')
Wizard('ir.module.activate_upgrade').execute('upgrade')
return cfg
drop_create('mydb')
activate_modules(['company','country'])
Module = Model.get('ir.module')
mm = Module.find([])
print("Activated modules : " , [m.name
for m in Module.find([('state', '=', 'activated')])])
print("Countries are : ", [m.name for m in
Model.get('country.country').find([])])
print("Languages are : ", [m.name for m in Model.get('ir.lang').find([])])
================================
And here is the output showing Activated modules, Languages and Countries
(Empty !). So I have missed some steps for loading the country file
(data.xml in the country module)
('Activated modules : ', [u'company', u'country', u'currency', u'ir', u'party',
u'res'])
('Countries are : ', [])
('Languages are : ', [u'English', u'Bulgarian', u'Catal\xe0', u'Czech',
u'German', u'Spanish', u'Spanish (Latin American)', u'French',
u'Hungarian', u'Italian', u'Lao', u'Lithuanian', u'Dutch', u'Polish',
u'Portuguese (Brazil)', u'Russian', u'Slovenian', u'Chinese Simplified'])
--
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/7ab68ff7-b719-481a-b593-317054d5ebee%40googlegroups.com.