[IMP]:set demo company only if there is demo=True
bzr revid: nch@tinyerp.com-20100511095635-eudhldu015wv58sj
This commit is contained in:
@@ -53,16 +53,18 @@ class base_setup_company(osv.osv_memory):
|
||||
""" get default company if any, and the various other fields
|
||||
from the company's fields
|
||||
"""
|
||||
base_mod = self.pool.get('ir.module.module').search(cr, uid, [('name','ilike','base')])
|
||||
base_mod_rec = self.pool.get('ir.module.module').browse(cr, uid, base_mod)[0]
|
||||
defaults = super(base_setup_company, self)\
|
||||
.default_get(cr, uid, fields_list=fields_list, context=context)
|
||||
|
||||
companies = self.pool.get('res.company')
|
||||
company_id = companies.search(cr, uid, [], limit=1, order="id")
|
||||
if not company_id or 'company_id' not in fields_list:
|
||||
return defaults
|
||||
company = companies.browse(cr, uid, company_id[0])
|
||||
|
||||
defaults['company_id'] = company.id
|
||||
if not base_mod_rec.demo:
|
||||
return defaults
|
||||
defaults['currency'] = company.currency_id.id
|
||||
for field in ['name','logo','rml_header1','rml_footer1','rml_footer2']:
|
||||
defaults[field] = company[field]
|
||||
|
||||
Reference in New Issue
Block a user