@@ -335,8 +335,8 @@
-
-
+
+
diff --git a/addons/edi/models/res_company.py b/addons/edi/models/res_company.py
index cf5efe997e0..0ab6607cdad 100644
--- a/addons/edi/models/res_company.py
+++ b/addons/edi/models/res_company.py
@@ -37,13 +37,12 @@ class res_company(osv.osv):
an empty dict if no address can be found
"""
res_partner = self.pool.get('res.partner')
- res_partner_address = self.pool.get('res.partner.address')
addresses = res_partner.address_get(cr, uid, [company.partner_id.id], ['default', 'contact', 'invoice'])
addr_id = addresses['invoice'] or addresses['contact'] or addresses['default']
result = {}
if addr_id:
- address = res_partner_address.browse(cr, uid, addr_id, context=context)
- result = res_partner_address.edi_export(cr, uid, [address], edi_struct=edi_address_struct, context=context)[0]
+ address = res_partner.browse(cr, uid, addr_id, context=context)
+ result = res_partner.edi_export(cr, uid, [address], edi_struct=edi_address_struct, context=context)[0]
if company.logo:
result['logo'] = company.logo # already base64-encoded
if company.paypal_account:
@@ -52,7 +51,7 @@ class res_company(osv.osv):
res_partner_bank = self.pool.get('res.partner.bank')
bank_ids = res_partner_bank.search(cr, uid, [('company_id','=',company.id),('footer','=',True)], context=context)
if bank_ids:
- result['bank_ids'] = res_partner_address.edi_m2m(cr, uid,
+ result['bank_ids'] = res_partner.edi_m2m(cr, uid,
res_partner_bank.browse(cr, uid, bank_ids, context=context),
context=context)
return result
diff --git a/addons/edi/models/res_partner.py b/addons/edi/models/res_partner.py
index 7c40a5c7354..357fdec061b 100644
--- a/addons/edi/models/res_partner.py
+++ b/addons/edi/models/res_partner.py
@@ -20,13 +20,16 @@
##############################################################################
import logging
-from osv import fields,osv
+from osv import fields,osv
from edi import EDIMixin
from openerp import SUPERUSER_ID
from tools.translate import _
-RES_PARTNER_ADDRESS_EDI_STRUCT = {
+RES_PARTNER_EDI_STRUCT = {
'name': True,
+ 'ref': True,
+ 'lang': True,
+ 'website': True,
'email': True,
'street': True,
'street2': True,
@@ -39,14 +42,6 @@ RES_PARTNER_ADDRESS_EDI_STRUCT = {
'mobile': True,
}
-RES_PARTNER_EDI_STRUCT = {
- 'name': True,
- 'ref': True,
- 'lang': True,
- 'website': True,
- 'address': RES_PARTNER_ADDRESS_EDI_STRUCT
-}
-
class res_partner(osv.osv, EDIMixin):
_inherit = "res.partner"
@@ -55,9 +50,6 @@ class res_partner(osv.osv, EDIMixin):
edi_struct or dict(RES_PARTNER_EDI_STRUCT),
context=context)
-class res_partner_address(osv.osv, EDIMixin):
- _inherit = "res.partner.address"
-
def _get_bank_type(self, cr, uid, context=None):
# first option: the "normal" bank type, installed by default
res_partner_bank_type = self.pool.get('res.partner.bank.type')
@@ -65,7 +57,6 @@ class res_partner_address(osv.osv, EDIMixin):
return self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'bank_normal', context=context).code
except ValueError:
pass
-
# second option: create a new custom type for EDI or use it if already created, as IBAN type is
# not always appropriate: we need a free-form bank type for max flexibility (users can correct
# data manually after import)
@@ -78,19 +69,14 @@ class res_partner_address(osv.osv, EDIMixin):
'code': label})
return code
- def edi_export(self, cr, uid, records, edi_struct=None, context=None):
- return super(res_partner_address,self).edi_export(cr, uid, records,
- edi_struct or dict(RES_PARTNER_ADDRESS_EDI_STRUCT),
- context=context)
-
def edi_import(self, cr, uid, edi_document, context=None):
# handle bank info, if any
edi_bank_ids = edi_document.pop('bank_ids', None)
- address_id = super(res_partner_address,self).edi_import(cr, uid, edi_document, context=context)
+ contact_id = super(res_partner,self).edi_import(cr, uid, edi_document, context=context)
if edi_bank_ids:
- address = self.browse(cr, uid, address_id, context=context)
+ contact = self.browse(cr, uid, contact_id, context=context)
import_ctx = dict((context or {}),
- default_partner_id=address.partner_id.id,
+ default_partner_id = contact.id,
default_state=self._get_bank_type(cr, uid, context))
for ext_bank_id, bank_name in edi_bank_ids:
try:
@@ -101,5 +87,7 @@ class res_partner_address(osv.osv, EDIMixin):
logging.getLogger('edi.res_partner').warning('Failed to import bank account using'
'bank type: %s, ignoring', import_ctx['default_state'],
exc_info=True)
- return address_id
+ return contact_id
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/edi/static/src/css/edi.css b/addons/edi/static/src/css/edi.css
index 478985ee585..1601151ae1f 100644
--- a/addons/edi/static/src/css/edi.css
+++ b/addons/edi/static/src/css/edi.css
@@ -146,6 +146,14 @@ table.oe_edi_data, .oe_edi_doc_title {
font-style: italic;
font-size: 95%;
padding-left: 10px;
+
+ /* prevent wide notes from disrupting layout due to styling */
+ white-space: pre-line;
+ width: 90%;
+}
+.oe_edi_data_row .oe_edi_inner_note {
+ /* prevent wide notes from disrupting layout due to styling */
+ width: 25em;
}
.oe_edi_shade {
background: #e8e8e8;
diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js
index a93086bdcaa..995012cb3c5 100644
--- a/addons/edi/static/src/js/edi.js
+++ b/addons/edi/static/src/js/edi.js
@@ -108,7 +108,7 @@ openerp.edi.EdiView = openerp.web.OldWidget.extend({
});
openerp.edi.edi_view = function (db, token) {
- openerp.connection.bind().then(function () {
+ openerp.connection.session_bind().then(function () {
new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp'));
});
}
@@ -188,7 +188,7 @@ openerp.edi.EdiImport = openerp.web.OldWidget.extend({
});
openerp.edi.edi_import = function (url) {
- openerp.connection.bind().then(function () {
+ openerp.connection.session_bind().then(function () {
new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp'));
});
}
diff --git a/addons/edi/static/src/xml/edi.xml b/addons/edi/static/src/xml/edi.xml
index 1f27c49ccdd..b9b385e9a07 100644
--- a/addons/edi/static/src/xml/edi.xml
+++ b/addons/edi/static/src/xml/edi.xml
@@ -11,7 +11,7 @@
diff --git a/addons/edi/static/src/xml/edi_account.xml b/addons/edi/static/src/xml/edi_account.xml
index dc6fb7f9754..3ce1daebf93 100644
--- a/addons/edi/static/src/xml/edi_account.xml
+++ b/addons/edi/static/src/xml/edi_account.xml
@@ -39,9 +39,9 @@
Your Reference |
- |
- |
- |
+ |
+ |
+ |
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index 6c1571c5630..86f136ca5b9 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -57,6 +57,8 @@ class email_template(osv.osv):
:param int res_id: id of the document record this mail is related to.
"""
if not template: return u""
+ if context is None:
+ context = {}
try:
template = tools.ustr(template)
record = None
@@ -145,7 +147,7 @@ class email_template(osv.osv):
help="Optional preferred server for outgoing mails. If not set, the highest "
"priority one will be used."),
'body_text': fields.text('Text contents', translate=True, help="Plaintext version of the message (placeholders may be used here)"),
- 'body_html': fields.text('Rich-text contents', help="Rich-text/HTML version of the message (placeholders may be used here)"),
+ 'body_html': fields.text('Rich-text contents', translate=True, help="Rich-text/HTML version of the message (placeholders may be used here)"),
'message_id': fields.char('Message-Id', size=256, help="Message-ID SMTP header to use in outgoing messages based on this template. "
"Please note that this overrides the 'Resource Tracking' option, "
"so if you simply need to track replies to outgoing emails, enable "
@@ -338,7 +340,7 @@ class email_template(osv.osv):
attachments = {}
# Add report as a Document
if template.report_template:
- report_name = template.report_name
+ report_name = self.render_template(cr, uid, template.report_name, template.model, res_id, context=context)
report_service = 'report.' + report_xml_pool.browse(cr, uid, template.report_template.id, context).report_name
# Ensure report is rendered using template's language
ctx = context.copy()
@@ -374,6 +376,7 @@ class email_template(osv.osv):
was executed for this message only.
:returns: id of the mail.message that was created
"""
+ if context is None: context = {}
mail_message = self.pool.get('mail.message')
ir_attachment = self.pool.get('ir.attachment')
values = self.generate_email(cr, uid, template_id, res_id, context=context)
@@ -390,9 +393,10 @@ class email_template(osv.osv):
'res_model': mail_message._name,
'res_id': msg_id,
}
- if context.has_key('default_type'):
- del context['default_type']
+ context.pop('default_type', None)
attachment_ids.append(ir_attachment.create(cr, uid, attachment_data, context=context))
+ if attachment_ids:
+ mail_message.write(cr, uid, msg_id, {'attachment_ids': [(6, 0, attachment_ids)]}, context=context)
if force_send:
mail_message.send(cr, uid, [msg_id], context=context)
return msg_id
diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py
index ef4572429a1..a4fd749979c 100644
--- a/addons/email_template/wizard/mail_compose_message.py
+++ b/addons/email_template/wizard/mail_compose_message.py
@@ -95,7 +95,7 @@ class mail_compose_message(osv.osv_memory):
for fname, fcontent in attachment.iteritems():
data_attach = {
'name': fname,
- 'datas': base64.b64encode(fcontent),
+ 'datas': fcontent,
'datas_fname': fname,
'description': fname,
'res_model' : self._name,
diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py
index 06252001c83..ea0e4316ef5 100644
--- a/addons/event/__openerp__.py
+++ b/addons/event/__openerp__.py
@@ -53,6 +53,7 @@ Note that:
],
'demo_xml': ['event_demo.xml'],
'test': ['test/process/event_draft2done.yml'],
+ 'css': ['static/src/css/event.css'],
'installable': True,
'application': True,
'auto_install': False,
diff --git a/addons/event/board_association_view.xml b/addons/event/board_association_view.xml
index 0a4755ab105..96db3db6781 100644
--- a/addons/event/board_association_view.xml
+++ b/addons/event/board_association_view.xml
@@ -62,8 +62,10 @@
form