diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b0b7815ad3c..48b2591485d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -559,10 +559,11 @@ class account_move_line(osv.osv): ] def _auto_init(self, cr, context=None): - super(account_move_line, self)._auto_init(cr, context=context) + res = super(account_move_line, self)._auto_init(cr, context=context) cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') if not cr.fetchone(): cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') + return res def _check_no_view(self, cr, uid, ids, context=None): lines = self.browse(cr, uid, ids, context=context) diff --git a/addons/account/i18n/nl_BE.po b/addons/account/i18n/nl_BE.po index a3244945957..139807ab49b 100644 --- a/addons/account/i18n/nl_BE.po +++ b/addons/account/i18n/nl_BE.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-04-16 04:37+0000\n" -"X-Generator: Launchpad (build 16564)\n" +"X-Launchpad-Export-Date: 2013-04-17 05:15+0000\n" +"X-Generator: Launchpad (build 16567)\n" "Language: nl\n" #. module: account diff --git a/addons/account_followup/i18n/nl_BE.po b/addons/account_followup/i18n/nl_BE.po index 5125f27f2ff..64a73d776ef 100644 --- a/addons/account_followup/i18n/nl_BE.po +++ b/addons/account_followup/i18n/nl_BE.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-04-16 04:37+0000\n" -"X-Generator: Launchpad (build 16564)\n" +"X-Launchpad-Export-Date: 2013-04-17 05:15+0000\n" +"X-Generator: Launchpad (build 16567)\n" "Language: nl\n" #. module: account_followup diff --git a/addons/auth_signup/i18n/zh_CN.po b/addons/auth_signup/i18n/zh_CN.po index 9beb3a044d3..aa8d9f952c1 100644 --- a/addons/auth_signup/i18n/zh_CN.po +++ b/addons/auth_signup/i18n/zh_CN.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-04-16 04:37+0000\n" -"X-Generator: Launchpad (build 16564)\n" +"X-Launchpad-Export-Date: 2013-04-17 05:15+0000\n" +"X-Generator: Launchpad (build 16567)\n" #. module: auth_signup #: field:res.partner,signup_type:0 diff --git a/addons/base_report_designer/base_report_designer_installer.xml b/addons/base_report_designer/base_report_designer_installer.xml index 657eae8fd63..99898f5a703 100644 --- a/addons/base_report_designer/base_report_designer_installer.xml +++ b/addons/base_report_designer/base_report_designer_installer.xml @@ -20,7 +20,7 @@ - + diff --git a/addons/base_report_designer/installer.py b/addons/base_report_designer/installer.py index a21b6655af7..7fddc27f037 100644 --- a/addons/base_report_designer/installer.py +++ b/addons/base_report_designer/installer.py @@ -23,7 +23,6 @@ from openerp.osv import fields from openerp.osv import osv import base64 from openerp.tools.translate import _ -from openerp.modules.module import get_module_resource class base_report_designer_installer(osv.osv_memory): _name = 'base_report_designer.installer' @@ -31,13 +30,13 @@ class base_report_designer_installer(osv.osv_memory): def default_get(self, cr, uid, fields, context=None): data = super(base_report_designer_installer, self).default_get(cr, uid, fields, context=context) - plugin_file = open(get_module_resource('base_report_designer','plugin', 'openerp_report_designer.zip'),'rb') - data['plugin_file'] = base64.encodestring(plugin_file.read()) + base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + data['plugin_file'] = base_url + '/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip' return data _columns = { 'name':fields.char('File name', size=34), - 'plugin_file':fields.binary('OpenObject Report Designer Plug-in', readonly=True, help="OpenObject Report Designer plug-in file. Save as this file and install this plug-in in OpenOffice."), + 'plugin_file':fields.char('OpenObject Report Designer Plug-in', size=256, readonly=True, help="OpenObject Report Designer plug-in file. Save as this file and install this plug-in in OpenOffice."), 'description':fields.text('Description', readonly=True) } diff --git a/addons/base_report_designer/plugin/openerp_report_designer.zip b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip similarity index 100% rename from addons/base_report_designer/plugin/openerp_report_designer.zip rename to addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip diff --git a/addons/crm_helpdesk/test/process/help-desk.yml b/addons/crm_helpdesk/test/process/help-desk.yml index e2be4a64ca3..95536b1c8dd 100644 --- a/addons/crm_helpdesk/test/process/help-desk.yml +++ b/addons/crm_helpdesk/test/process/help-desk.yml @@ -4,8 +4,7 @@ Mail script will be fetched him request from mail server. so I process that mail after read EML file - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'crm.helpdesk', request_message) - diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index b0b60db6bd5..e41d80fb348 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -510,8 +510,9 @@ class hr_job(osv.osv): def _auto_init(self, cr, context=None): """Installation hook to create aliases for all jobs and avoid constraint errors.""" - self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(hr_job,self)._auto_init, + res = self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(hr_job,self)._auto_init, self._columns['alias_id'], 'name', alias_prefix='job+', alias_defaults={'job_id': 'id'}, context=context) + return res def create(self, cr, uid, vals, context=None): mail_alias = self.pool.get('mail.alias') diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index f2d4e4736fa..335edc71892 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -4,8 +4,7 @@ An applicant is interested in the job position. So he sends a resume by email. - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'hr.applicant', request_message) - diff --git a/addons/l10n_lu/wizard/print_vat.py b/addons/l10n_lu/wizard/print_vat.py index 79213026496..bfa058720d3 100644 --- a/addons/l10n_lu/wizard/print_vat.py +++ b/addons/l10n_lu/wizard/print_vat.py @@ -9,10 +9,10 @@ from __future__ import with_statement import openerp from openerp.osv import fields, osv from openerp import tools +from openerp.modules.module import get_module_resource from openerp.tools.translate import _ from openerp.report.render import render from openerp.report.interface import report_int -from openerp import addons import tempfile import os @@ -53,7 +53,7 @@ class report_custom(report_int): try: tmp_file = tempfile.mkstemp(".pdf")[1] try: - tools.pdf_utils.fill_pdf(addons.get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) + tools.pdf_utils.fill_pdf(get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) with open(tmp_file, "r") as ofile: self.obj = external_pdf(ofile.read()) finally: diff --git a/addons/mail/mail_alias.py b/addons/mail/mail_alias.py index f806b325291..8730599ad72 100644 --- a/addons/mail/mail_alias.py +++ b/addons/mail/mail_alias.py @@ -160,7 +160,7 @@ class mail_alias(osv.Model): alias_id_column.required = False # call _auto_init - child_model_auto_init_fct(cr, context=context) + res = child_model_auto_init_fct(cr, context=context) registry = RegistryManager.get(cr.dbname) mail_alias = registry.get('mail.alias') @@ -188,6 +188,8 @@ class mail_alias(osv.Model): # set back the unique alias_id constraint alias_id_column.required = True + return res + def create_unique_alias(self, cr, uid, vals, model_name=None, context=None): """Creates an email.alias record according to the values provided in ``vals``, with 2 alterations: the ``alias_name`` value may be suffixed in order to diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index f7c91939b98..5545745b235 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -60,8 +60,9 @@ class res_users(osv.Model): def _auto_init(self, cr, context=None): """ Installation hook: aliases, partner following themselves """ # create aliases for all users and avoid constraint errors - self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init, + res = self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users, self)._auto_init, self._columns['alias_id'], 'login', alias_force_key='id', context=context) + return res def create(self, cr, uid, data, context=None): # create default alias same as the login diff --git a/addons/product/product.py b/addons/product/product.py index fdcbee20cb4..518e455ddc1 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -518,6 +518,13 @@ class product_product(osv.osv): def _set_image(self, cr, uid, id, name, value, args, context=None): return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context) + def _get_name_template_ids(self, cr, uid, ids, context=None): + result = set() + template_ids = self.pool.get('product.product').search(cr, uid, [('product_tmpl_id', 'in', ids)]) + for el in template_ids: + result.add(el) + return list(result) + _defaults = { 'active': lambda *a: 1, 'price_extra': lambda *a: 0.0, @@ -549,7 +556,11 @@ class product_product(osv.osv): 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')), 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')), 'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'), - 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', size=128, store=True, select=True), + 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', size=128, store={ + 'product.template': (_get_name_template_ids, ['name'], 10), + 'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10), + + }, select=True), 'color': fields.integer('Color Index'), # image: all image fields are base64 encoded and PIL-supported 'image': fields.binary("Image", diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml index 9f16dc80b97..af81ff4d295 100644 --- a/addons/project_issue/test/subscribe_issue.yml +++ b/addons/project_issue/test/subscribe_issue.yml @@ -2,8 +2,7 @@ In Order to test process of Issue in OpenERP, Custmer send the issue by email. - !python {model: mail.thread}: | - from openerp import addons - request_file = open(addons.get_module_resource('project_issue','test', 'issue.eml'),'rb') + request_file = open(openerp.modules.module.get_module_resource('project_issue','test', 'issue.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'project.issue', request_message) - @@ -14,4 +13,4 @@ assert issue_ids and len(issue_ids), "issue is not created after getting request" issue = self.browse(cr, uid, issue_ids[0], context=context) assert not issue.partner_id, "Customer should be a new" - assert issue.name == "Error in the account module", "Subject does not match" \ No newline at end of file + assert issue.name == "Error in the account module", "Subject does not match" diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 01536f471fe..3d8e41c42ff 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -40,8 +40,8 @@ import logging from report_helper import WebKitHelper import openerp +from openerp.modules.module import get_module_resource from openerp.report.report_sxw import * -from openerp import addons from openerp import tools from openerp.tools.translate import _ from openerp.osv.osv import except_osv @@ -280,7 +280,7 @@ class WebKitParser(report_sxw): template = False if report_xml.report_file : - path = addons.get_module_resource(*report_xml.report_file.split(os.path.sep)) + path = get_module_resource(*report_xml.report_file.split(os.path.sep)) if path and os.path.exists(path) : template = file(path).read() if not template and report_xml.report_webkit_data : @@ -296,7 +296,7 @@ class WebKitParser(report_sxw): ) if not report_xml.header : header = '' - default_head = addons.get_module_resource('report_webkit', 'default_header.html') + default_head = get_module_resource('report_webkit', 'default_header.html') with open(default_head,'r') as f: header = f.read() css = report_xml.webkit_header.css