commit
f5c8d4f9ad
|
@ -26,6 +26,7 @@ import report
|
|||
from osv import fields, osv, orm
|
||||
import tools
|
||||
from tools.translate import _
|
||||
import addons
|
||||
|
||||
class module(osv.osv):
|
||||
_inherit = 'ir.module.module'
|
||||
|
@ -104,7 +105,7 @@ class module(osv.osv):
|
|||
context.update({'level': 1})
|
||||
dots = self.get_graphical_representation(cr, uid, object_ids, context=context)
|
||||
# todo: use os.realpath
|
||||
file_path = tools.config['addons_path']+"/base_module_doc_rst/"
|
||||
file_path = addons.get_module_resource('base_module_doc_rst')
|
||||
path_png = file_path + "/module.png"
|
||||
for key, val in dots.items():
|
||||
path_dotfile = file_path + "/%s.dot" % (key,)
|
||||
|
|
|
@ -24,7 +24,7 @@ import os
|
|||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import pooler
|
||||
from tools import config
|
||||
import addons
|
||||
from base_module_quality import base_module_quality
|
||||
|
||||
class quality_test(base_module_quality.abstract_quality_check):
|
||||
|
@ -45,7 +45,7 @@ This test checks the Unit Test(PyUnit) Cases of the module. Note that 'unit_test
|
|||
def run_test(self, cr, uid, module_path):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
module_name = module_path.split('/')[-1]
|
||||
test_file = config['addons_path'] +'/' + module_name +'/unit_test/test.py'
|
||||
test_file = addons.get_module_resource(module_name) + '/unit_test/test.py'
|
||||
if not os.path.isfile(test_file):
|
||||
self.result += _("Module does not have 'unit_test/test.py' file")
|
||||
return None
|
||||
|
|
|
@ -24,6 +24,7 @@ import os
|
|||
from osv import fields, osv
|
||||
import tools
|
||||
from tools.translate import _
|
||||
import addons
|
||||
|
||||
import addons
|
||||
|
||||
|
@ -182,8 +183,8 @@ class hr_employee(osv.osv):
|
|||
return {'value': {'work_email' : work_email}}
|
||||
|
||||
def _get_photo(self, cr, uid, context=None):
|
||||
res_path = addons.get_module_resource("hr","image/photo.png")
|
||||
return open(res_path,'rb').read().encode('base64')
|
||||
return open(addons.get_module_resource('hr','image','photo.png'),
|
||||
'rb').read().encode('base64')
|
||||
|
||||
_defaults = {
|
||||
'active': 1,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="My Timesheet">
|
||||
<separator string="It will open the your current timesheet" colspan="4" />
|
||||
<separator string="It will open your current timesheet" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="terp-camera_test" name="open_timesheet" string="Open" type="object"/>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
from osv import fields
|
||||
from osv import osv
|
||||
from tools import config
|
||||
import addons
|
||||
|
||||
import base64
|
||||
|
||||
|
@ -32,7 +32,7 @@ class outlook_installer(osv.osv_memory):
|
|||
def default_get(self, cr, uid, fields, context={}):
|
||||
data = super(outlook_installer, self).default_get(cr, uid, fields, context)
|
||||
data['doc_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_outlook.html'
|
||||
file = open(config['addons_path'] + "/outlook/plugin/openerp-outlook-plugin.zip", 'r')
|
||||
file = open(addons.get_module_resource('outlook','plugin','openerp-outlook-plugin.zip'), 'r')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
return data
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ At the end of the month, the planning manager can also check if the encoded time
|
|||
'project_planning_demo.xml',
|
||||
],
|
||||
'test': [
|
||||
'test/planning_states.yml'
|
||||
'test/planning_report.yml'
|
||||
'test/planning_states.yml',
|
||||
'test/project_planning_report.yml'
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr='//filter[@string="Member"]' position='after'>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-camera_test" string="Invoiceble" domain="[('to_invoice','!=', False)]" help="Invoiceable Project"/>
|
||||
<filter icon="terp-camera_test" string="Invoiceable" domain="[('to_invoice','!=', False)]" help="Invoiceable Project"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -40,7 +40,7 @@ import netsvc
|
|||
import pooler
|
||||
from report_helper import WebKitHelper
|
||||
from report.report_sxw import *
|
||||
from tools.config import config
|
||||
import addons
|
||||
from tools.translate import _
|
||||
from osv.osv import except_osv
|
||||
|
||||
|
@ -225,7 +225,7 @@ class WebKitParser(report_sxw):
|
|||
template = False
|
||||
|
||||
if report_xml.report_file :
|
||||
path = os.path.join(config['addons_path'], report_xml.report_file)
|
||||
path = addons.get_module_resource(report_xml.report_file)
|
||||
if os.path.exists(path) :
|
||||
template = file(path).read()
|
||||
if not template and report_xml.report_webkit_data :
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
## -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
@ -30,6 +29,7 @@ from osv import osv
|
|||
from osv import fields
|
||||
from tools import to_xml
|
||||
from tools.translate import _
|
||||
import addons
|
||||
|
||||
class survey_question_wiz(osv.osv_memory):
|
||||
_name = 'survey.question.wiz'
|
||||
|
@ -400,7 +400,7 @@ class survey_question_wiz(osv.osv_memory):
|
|||
context.update({'response_id':response_id})
|
||||
report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context)
|
||||
attachments = []
|
||||
file = open(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf")
|
||||
file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
|
||||
file_data = ""
|
||||
while 1:
|
||||
line = file.readline()
|
||||
|
@ -410,7 +410,7 @@ class survey_question_wiz(osv.osv_memory):
|
|||
|
||||
attachments.append((survey_data.title + ".pdf",file_data))
|
||||
file.close()
|
||||
os.remove(tools.config['addons_path'] + '/survey/report/' + survey_data.title + ".pdf")
|
||||
os.remove(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
|
||||
user_email = False
|
||||
resp_email = False
|
||||
|
||||
|
@ -455,10 +455,9 @@ class survey_question_wiz(osv.osv_memory):
|
|||
if not report_name or not res_ids:
|
||||
return (False, Exception('Report name and Resources ids are required !!!'))
|
||||
try:
|
||||
ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf'
|
||||
service = netsvc.LocalService(report_name);
|
||||
(result, format) = service.create(cr, uid, res_ids, {}, context)
|
||||
fp = open(ret_file_name, 'wb+');
|
||||
fp = open(addons.get_module_resource('survey', 'report') + file_name + '.pdf', 'wb+');
|
||||
fp.write(result);
|
||||
fp.close();
|
||||
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# GNU Affero General Public License for more details
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -32,6 +31,7 @@ from osv import osv
|
|||
import tools
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import addons
|
||||
|
||||
|
||||
class survey_send_invitation(osv.osv_memory):
|
||||
|
@ -79,7 +79,7 @@ class survey_send_invitation(osv.osv_memory):
|
|||
if not report_name or not res_ids:
|
||||
return (False, Exception('Report name and Resources ids are required !!!'))
|
||||
try:
|
||||
ret_file_name = tools.config['addons_path'] + '/survey/report/' + file_name + '.pdf'
|
||||
ret_file_name = addons.get_module_resource('survey', 'report') + file_name + '.pdf'
|
||||
service = netsvc.LocalService(report_name);
|
||||
(result, format) = service.create(cr, uid, res_ids, {}, {})
|
||||
fp = open(ret_file_name, 'wb+');
|
||||
|
@ -122,7 +122,7 @@ class survey_send_invitation(osv.osv_memory):
|
|||
new_user.append(use.id)
|
||||
for id in survey_ref.browse(cr, uid, survey_ids):
|
||||
report = self.create_report(cr, uid, [id.id], 'report.survey.form', id.title)
|
||||
file = open(tools.config['addons_path'] + '/survey/report/' + id.title +".pdf")
|
||||
file = open(addons.get_module_resource('survey', 'report') + id.title +".pdf")
|
||||
file_data = ""
|
||||
while 1:
|
||||
line = file.readline()
|
||||
|
@ -131,7 +131,7 @@ class survey_send_invitation(osv.osv_memory):
|
|||
break
|
||||
attachments.append((id.title +".pdf",file_data))
|
||||
file.close()
|
||||
os.remove(tools.config['addons_path'] + '/survey/report/' + id.title + ".pdf")
|
||||
os.remove(addons.get_module_resource('survey', 'report') + id.title +".pdf")
|
||||
|
||||
for partner in self.pool.get('res.partner').browse(cr, uid, partner_ids):
|
||||
for addr in partner.address:
|
||||
|
|
Loading…
Reference in New Issue