[MERGE] with trunk

bzr revid: fka@tinyerp.com-20130418045147-32n4cszy0pc9zf2h
This commit is contained in:
Foram Katharotiya (OpenERP)
2013-04-18 10:21:47 +05:30
16 changed files with 40 additions and 28 deletions
+2 -1
View File
@@ -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)
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
@@ -20,7 +20,7 @@
<xpath expr="//separator[@string='title']" position="after">
<group colspan="8" height="450" width="750">
<field name="name" invisible="1"/>
<field name="plugin_file" filename="name"/>
<field name="plugin_file" filename="name" widget="url"/>
<separator string="Installation and Configuration Steps" colspan="4"/>
<field name="description" nolabel="1" colspan="8"/>
</group>
+3 -4
View File
@@ -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)
}
@@ -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)
-
+2 -1
View File
@@ -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')
@@ -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)
-
+2 -2
View File
@@ -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:
+3 -1
View File
@@ -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
+2 -1
View File
@@ -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
+12 -1
View File
@@ -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",
@@ -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"
assert issue.name == "Error in the account module", "Subject does not match"
+3 -3
View File
@@ -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