develop
Andreas Brückl 2014-11-25 15:19:24 +01:00
parent 52d653f241
commit bde3c1fe59
5 changed files with 51 additions and 18 deletions

View File

@ -8,7 +8,7 @@ db_port = 5436
db_user = False
db_password = False
addons_path = odoo/addons,ext/addons
addons_path = ext/odoo/addons,ext/custom-addons
timezone = Europe/Brussels
dbfilter_test = ['.*',]

View File

@ -31,7 +31,7 @@ class res_company(osv.osv):
def get_image(self, img):
def _get_dir():
styles_dir = 'pittoresk_reports/static/src/img'
styles_dir = 'cam_custom/static/src/img'
adps = addons.module.ad_paths
for adp in adps:
dir = os.path.join(adp, styles_dir)
@ -52,4 +52,25 @@ class res_company(osv.osv):
path = _get_dir()
fname = os.path.join(path, img)
img_data = _get_file_data(fname)
return img_data
return img_data
def _get_rml_header(self, cr, uid, ids, _field_name, _args, context=None):
result = dict.fromkeys(ids, False)
# Get filename
dirname = 'cam_reports/report'
adps = addons.module.ad_paths
for adp in adps:
dir = os.path.join(adp, dirname)
if os.path.isdir(dir):
break
if os.path.isdir(dir):
filename = os.path.join(dir, 'page.rml')
f = open(filename , 'rb')
data = f.read()
result = dict.fromkeys(ids, data)
return result
_columns = {
'rml_header': fields.function(_get_rml_header, type='text', string='RML Header'),
}

View File

@ -70,6 +70,12 @@ def main():
'login',
'update_module',
]
if cmd == 'update_modules':
methods = [
'login',
'update_modules',
]
if not methods:

View File

@ -11,18 +11,18 @@ class Config():
self.company_data = {
'name': 'Camadeus GmbH',
'street': 'Kriehubergasse 16',
'street': 'Seeböckgasse 39',
'street2': False,
'city': 'Wien',
'zip': '1050',
'phone': '+43 1 78910 96 70',
'zip': 'A-1160',
'phone': '+43 (0)1 486 36 49',
'fax': False,
'email': 'office@camadeus.at',
'website': 'http://www.camadeus.at',
'company_registry': '280076b ',
'email': 'office@zeibich.at',
'website': 'http://www.zeibich.at',
'company_registry': '51835d ',
'country_id': 'at', # "de" für deutschland
'logo': False,
'vat': 'ATU 62991855 ',
'vat': 'ATU14644107 ',
'rml_header1': False,
'vat_check_vies': True,
'tax_calculation_rounding_method': 'round_globally',
@ -100,10 +100,10 @@ class Config():
'document',
'auth_crypt',
'cam_testenv',
#'cam_max_width',
#'oerp_no_phoning_home',
#'cam_custom',
#'custom_reports',
'cam_max_width',
'oerp_no_phoning_home',
'cam_custom',
'custom_reports',
#'crm',
#'sale',
#'cam_hr_overtime',

View File

@ -29,7 +29,7 @@ class CamadeusFunctions():
payload = {'params': payload}
json_data = json.dumps(payload)
headers = {'content-type': 'application/json'}
r = requests.post('%s:%s/web/database/create' % (self.env.host,self.env.port), data=json_data, headers=headers, auth=self.env.basic_auth)
r = requests.post('%s:%s/web/database/create' % (self.env.host,self.env.port), data=json_data, headers=headers, auth=self.env.basic_auth, verify=False)
if r and r.json().get('result',False):
return True
else:
@ -257,7 +257,7 @@ class CamadeusFunctions():
return True
def uninstall_chat(self):
""" Chat-Modul deinstallieren """
"""Chat-Modul deinstallieren """
modules = ['im_chat','im_odoo_support','bus']
modules_to_install = self._execute('ir.module.module', 'search', [('name','in',modules)])
@ -266,7 +266,7 @@ class CamadeusFunctions():
return True
def set_uom(self):
""" Mengeneinheiten setzen"""
"""Mengeneinheiten setzen"""
context = {'lang': 'de_DE'}
c = self.config
@ -318,4 +318,10 @@ class CamadeusFunctions():
res = self._execute('ir.module.module', 'button_upgrade', mod_ids)
res = self._execute('base.module.upgrade', 'upgrade_module', mod_ids)
return True
def update_modules(self):
"""Verfügbare Module updaten"""
wizard_id = self._execute('base.module.update', 'create', {})
vals = self._execute('base.module.update', 'update_module', [wizard_id])
return True