diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 3e86c4963b7..35afac5a508 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -391,29 +391,33 @@ class account_invoice(osv.osv):
'''
This function opens a window to compose an email, with the edi invoice template message loaded by default
'''
- mod_obj = self.pool.get('ir.model.data')
- template = mod_obj.get_object_reference(cr, uid, 'account', 'email_template_edi_invoice')
- template_id = template and template[1] or False
- res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')
- res_id = res and res[1] or False
+ assert len(ids) == 1, 'This option should only be used for a single id at a time.'
+ ir_model_data = self.pool.get('ir.model.data')
+ try:
+ template_id = ir_model_data.get_object_reference(cr, uid, 'account', 'email_template_edi_invoice')[1]
+ except ValueError:
+ template_id = False
+ try:
+ compose_form_id = ir_model_data.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
+ except ValueError:
+ compose_form_id = False
ctx = dict(context)
ctx.update({
'default_model': 'account.invoice',
'default_res_id': ids[0],
- 'default_use_template': True,
+ 'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
})
return {
+ 'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
- 'views': [(res_id, 'form')],
- 'view_id': res_id,
- 'type': 'ir.actions.act_window',
+ 'views': [(compose_form_id, 'form')],
+ 'view_id': compose_form_id,
'target': 'new',
'context': ctx,
- 'nodestroy': True,
}
def confirm_paid(self, cr, uid, ids, context=None):
diff --git a/addons/account/edi/invoice.py b/addons/account/edi/invoice.py
index 751eb8656f7..3e27bc5ea99 100644
--- a/addons/account/edi/invoice.py
+++ b/addons/account/edi/invoice.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Business Applications
-# Copyright (c) 2011 OpenERP S.A.
% endif
+ % if object.user_id:
Your contact: ${object.user_id.name}
+ % endif
- You can view the invoice document, download it and pay online using the following link: -
- View Invoice - % if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'): <% comp_name = quote(object.company_id.name) diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml index 52c8c8daaa9..4bfd3697d89 100644 --- a/addons/account/res_config_view.xml +++ b/addons/account/res_config_view.xml @@ -227,7 +227,7 @@Hello,
+I am interested in your company's products and I plan to buy a new laptop having latest technologies as well as an affordable price.
+Could you please send me the product catalog?
]]>Best regards,
]]>After our phonecall and discussion with our technical experts, here is the offer of YourCompany. We believe it will meet every requirement you had in mind. Please feel free to contact me for any detail or technical detail that is not clear enough for you.
+Notice that as agreed on phone, we offer you a 10% discount on the hardware!
+Best regards,
]]>styling */ - white-space: pre-line; - width: 90%; -} -.oe_edi_data_row .oe_edi_inner_note { - /* prevent wide notes from disrupting layout due tostyling */ - width: 25em; -} -.oe_edi_shade { - background: #e8e8e8; -} -.oe_edi_company_name { - text-transform: uppercase; - font-weight: bold; -} -.oe_edi_address_from { - float: left; -} -.oe_edi_address_to { - float: right; - margin-top: 25px; - margin-bottom: 30px; -} -.oe_edi_company_block_title { - width: 375px; - margin: 0px; - padding: 2px 14px; - background-color: #252525; - border-top-left-radius: 5px 5px; - border-top-right-radius: 5px 5px; - background-repeat: repeat no-repeat; -} -.oe_edi_company_block_title .oe_edi_company_name { - margin: 0px; - font-size: 1em; - color: #FFF; -} -.oe_edi_company_block_body { - width: 375px; - margin: 0px; - padding: 5px 14px; - line-height: 16px; - background-color: rgb(242, 242, 242); -} -.oe_edi_company_block_body p { - color: #222; - margin: 5px 0px; -} -.oe_edi_summary_label { - float: left; -} -.oe_edi_summary_value { - float: right; -} - - -/** Python code highlighting **/ -/* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann - (http://qbnz.com/highlighter/ and http://geshi.org/) */ -.python .de1, .python .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;} -.python {font-family:monospace;} -.python .imp {font-weight: bold; color: red;} -.python li, .python .li1 {background: #ffffff; list-style: none;} -.python .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;} -.python .li2 {background: #f8f8f8;} -.python .kw1 {color: #ff7700;font-weight:bold;} -.python .kw2 {color: #008000;} -.python .kw3 {color: #dc143c;} -.python .kw4 {color: #0000cd;} -.python .co1 {color: #808080; font-style: italic;} -.python .coMULTI {color: #808080; font-style: italic;} -.python .es0 {color: #000099; font-weight: bold;} -.python .br0 {color: black;} -.python .sy0 {color: #66cc66;} -.python .st0 {color: #483d8b;} -.python .nu0 {color: #ff4500;} -.python .me1 {color: black;} -.python span.xtra { display:block; } -.python ol { padding: 0px; } diff --git a/addons/edi/static/src/img/pdf.png b/addons/edi/static/src/img/pdf.png deleted file mode 100644 index d35dfd20c2d..00000000000 Binary files a/addons/edi/static/src/img/pdf.png and /dev/null differ diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js index a9c6981c6be..ee4ddbb5e87 100644 --- a/addons/edi/static/src/js/edi.js +++ b/addons/edi/static/src/js/edi.js @@ -1,119 +1,9 @@ -openerp.edi = function(openerp) { -openerp.edi = {} +openerp.edi = function(instance) { +var _t = instance.web._t; +instance.edi = {} -openerp.edi.EdiView = openerp.web.Widget.extend({ - init: function(parent, db, token) { - this._super(); - this.db = db; - this.token = token; - this.session = openerp.session; - this.template = "EdiEmpty"; - this.content = ""; - this.sidebar = ""; - }, - start: function() { - this._super(); - var self = this; - var param = {"db": self.db, "token": self.token}; - return self.rpc('/edi/get_edi_document', param).done(this.on_document_loaded).fail(this.on_document_failed); - }, - on_document_loaded: function(docs){ - this.doc = docs[0]; - var template_content = "Edi." + this.doc.__model + ".content"; - var template_sidebar = "Edi." + this.doc.__model + ".sidebar"; - var param = {"widget":this, "doc":this.doc}; - if (openerp.web.qweb.templates[template_sidebar]) { - this.sidebar = openerp.web.qweb.render(template_sidebar, param); - } - if (openerp.web.qweb.templates[template_content]) { - this.content = openerp.web.qweb.render(template_content, param); - } - this.$el.html(openerp.web.qweb.render("EdiView", param)); - this.$el.find('button.oe_edi_action_print').bind('click', this.do_print); - this.$el.find('button#oe_edi_import_existing').bind('click', this.do_import_existing); - this.$el.find('button#oe_edi_import_create').bind('click', this.do_import_create); - this.$el.find('button#oe_edi_download').bind('click', this.do_download); - this.$el.find('.oe_edi_import_choice, .oe_edi_import_choice_label').bind('click', this.toggle_choice('import')); - this.$el.find('.oe_edi_pay_choice, .oe_edi_pay_choice_label').bind('click', this.toggle_choice('pay')); - this.$el.find('#oe_edi_download_show_code').bind('click', this.show_code); - }, - on_document_failed: function(response) { - var self = this; - var params = { - error: response, - //TODO: should this be _t() wrapped? - message: "Sorry, this document cannot be located. Perhaps the link you are using has expired?" - } - $(openerp.web.qweb.render("DialogWarning", params)).dialog({ - title: "Document not found", - modal: true, - }); - }, - show_code: function($event) { - $('#oe_edi_download_code').toggle(); - }, - get_download_url: function() { - var l = window.location; - var url_prefix = l.protocol + '//' + l.host; - return url_prefix +'/edi/download?db=' + this.db + '&token=' + this.token; - }, - get_paypal_url: function(document_type, ref_field) { - var comp_name = encodeURIComponent(this.doc.company_id[1]); - var doc_ref = encodeURIComponent(this.doc[ref_field]); - var paypal_account = encodeURIComponent(this.doc.company_address.paypal_account); - var amount = encodeURIComponent(this.doc.amount_total); - var cur_code = encodeURIComponent(this.doc.currency.code); - var paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick" + - "&business=" + paypal_account + - "&item_name=" + document_type + "%20" + comp_name + "%20" + doc_ref + - "&invoice=" + doc_ref + - "&amount=" + amount + - "¤cy_code=" + cur_code + - "&button_subtype=services&no_note=1&bn=OpenERP_PayNow_" + cur_code; - return paypal_url; - }, - toggle_choice: function(mode) { - return function($e) { - $('.oe_edi_nested_block_'+mode).hide(); - $('.'+$e.target.id+'_nested').show(); - return true; - } - }, - do_print: function(e){ - var l = window.location; - window.location = l.protocol + '//' + l.host + "/edi/download_attachment?db=" + this.db + "&token=" + this.token; - }, - do_import_existing: function(e) { - var url_download = this.get_download_url(); - var $edi_text_server_input = this.$el.find('#oe_edi_txt_server_url'); - var server_url = $edi_text_server_input.val(); - $edi_text_server_input.removeClass('invalid'); - if (!server_url) { - $edi_text_server_input.addClass('invalid'); - return false; - } - var protocol = "http://"; - if (server_url.toLowerCase().lastIndexOf('http', 0) == 0 ) { - protocol = ''; - } - window.location = protocol + server_url + '/edi/import_url?url=' + encodeURIComponent(url_download); - }, - do_import_create: function(e){ - var url_download = this.get_download_url(); - window.location = "https://cc.my.openerp.com/odms/create_edi?url=" + encodeURIComponent(url_download); - }, - do_download: function(e){ - window.location = this.get_download_url(); - } -}); +instance.edi.EdiImport = instance.web.Widget.extend({ -openerp.edi.edi_view = function (db, token) { - openerp.session.session_bind().done(function () { - new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp')); - }); -} - -openerp.edi.EdiImport = openerp.web.Widget.extend({ init: function(parent,url) { this._super(); this.url = url; @@ -137,7 +27,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ show_login: function() { this.destroy_content(); - this.login = new openerp.web.Login(this); + this.login = new instance.web.Login(this); this.login.appendTo(this.$el); }, @@ -167,18 +57,18 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ window.location = "/"; } } - }).html('The document has been successfully imported!'); + }).html(_t('The document has been successfully imported!')); } }, on_imported_error: function(response){ var self = this; - var msg = "Sorry, the document could not be imported."; + var msg = _t("Sorry, the document could not be imported."); if (response.data.fault_code) { - msg += "\n Reason:" + response.data.fault_code; + msg += "\n " + _t("Reason:") + response.data.fault_code; } var params = {error: response, message: msg}; - $(openerp.web.qweb.render("CrashManagerWarning", params)).dialog({ - title: "Document Import Notification", + $(instance.web.qweb.render("CrashManager.warning", params)).dialog({ + title: _t("Document Import Notification"), modal: true, buttons: { Ok: function() { $(this).dialog("close"); } @@ -187,9 +77,9 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ } }); -openerp.edi.edi_import = function (url) { - openerp.session.session_bind().done(function () { - new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp')); +instance.edi.edi_import = function (url) { + instance.session.session_bind().done(function () { + new instance.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 deleted file mode 100644 index 111cb6d9d26..00000000000 --- a/addons/edi/static/src/xml/edi.xml +++ /dev/null @@ -1,93 +0,0 @@ - -- - -- -- - - diff --git a/addons/edi/static/src/xml/edi_account.xml b/addons/edi/static/src/xml/edi_account.xml deleted file mode 100644 index 3ce1daebf93..00000000000 --- a/addons/edi/static/src/xml/edi_account.xml +++ /dev/null @@ -1,163 +0,0 @@ - --
-- -- - -- -- --
-- -- -- -
- - -- - --- -
- -
-
- -- - --- -
- -- - --- OpenERP's Electronic Data Interchange documents are based on a generic and language - independent JSON serialization of the document's attribute. - It is usually very quick and straightforward to create a small plug-in for your preferred - application that will be capable of importing any OpenERP EDI document. - You can find out more details about how to do this and what the content of OpenERP EDI documents - is like in the OpenERP documentation. -
-
- To get started immediately, see is all it takes to use this EDI document in Python. ---
- -
import urllib2, simplejson- -
edi_document = urllib2.urlopen('').read() - -
document_data = simplejson.loads(edi_document)[0]- -
print "Amount: ", document_data['amount_total']- You can download the raw EDI document here:
- -
- - ---- - -- - -- -------- ---
-- -
--
-- ----- ---
-- -
--
-- Invoice
-: -
- -- -Description -Date -Your Reference -- -- - - -
-- -Product Description -Quantity -Unit Price -Discount -Price -- -- -- - - --- - - - - -- - -- Net Total: ----- - -- - -- Taxes: ----- - -- - -- Total: ----- - --
-- -Tax -Base Amount -Amount -- - -- -- - - - -Notes:
--- - diff --git a/addons/edi/static/src/xml/edi_sale_purchase.xml b/addons/edi/static/src/xml/edi_sale_purchase.xml deleted file mode 100644 index 8d6bab67761..00000000000 --- a/addons/edi/static/src/xml/edi_sale_purchase.xml +++ /dev/null @@ -1,169 +0,0 @@ - -- -- - -- -- - --- You may directly pay this invoice online via Paypal's secure payment gateway:
-
- - - -- -- - --- Please transfer
-to - (postal address on the invoice header) - using one of the following bank accounts. Be sure to mention the invoice - reference on the transfer: -
--
-- -- -
- ----- ---- ---
-- -
--
-- -- ---- ---
-- -
--
-- - -Quotation
-: - -Request for Quotation
-: - - -Order
-: -
- -- -Your Reference -Date -Salesperson -Payment terms -- -- - - - -- -
-- -Product Description -Quantity -Unit Price -Discount(%) -Price -- -- -- - - --- -- - - - - -- - -- Net Total: ----- - -- - -- Taxes: ----- - -- - -- Total: ----- - -Notes:
--- -- -- - -- -- - --- You may directly pay this order online via Paypal's secure payment gateway:
-
- - - -- -- - --- Please transfer
-to - (postal address on the order header) - using one of the following bank accounts. Be sure to mention the document - reference on the transfer: -
--
-- -- -
- -- - - diff --git a/addons/edi/test/edi_partner_test.yml b/addons/edi/test/edi_partner_test.yml index 9fc523bf84f..97ae669e52e 100644 --- a/addons/edi/test/edi_partner_test.yml +++ b/addons/edi/test/edi_partner_test.yml @@ -6,11 +6,10 @@ with an attached file, check the result, the alter the data and reimport it. - - !python {model: edi.document}: | + !python {model: edi.edi}: | import json - partner_obj = self.pool.get('res.partner') - tokens = self.export_edi(cr, uid, [partner_obj.browse(cr, uid, ref('base.res_partner_2'))]) - doc = self.get_document(cr, uid, tokens[0], context=context) + res_partner = self.pool.get('res.partner') + doc = self.generate_edi(cr, uid, [res_partner.browse(cr, uid, ref('base.res_partner_2'))]) edi_doc, = json.loads(doc) # check content of the document @@ -36,8 +35,7 @@ "Expected (%r,> %r) after import 1, got %r" % ('res.partner', ref('base.res_partner_2'), result) # export the same partner we just created, and see if the output matches the input - tokens = self.export_edi(cr, uid, [partner_obj.browse(cr, uid, result[1])]) - doc_output = self.get_document(cr, uid, tokens[0], context=context) + doc_output = self.generate_edi(cr, uid, [res_partner.browse(cr, uid, result[1])]) edi_doc_output, = json.loads(doc_output) for attribute in ('__model', '__module', '__id', 'name', '__attachments'): assert edi_doc_output.get(attribute) == edi_doc.get(attribute), \ diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 0ca92d8effa..a9bee623f66 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -345,6 +345,7 @@ class email_template(osv.osv): values = self.generate_email(cr, uid, template_id, res_id, context=context) assert 'email_from' in values, 'email_from is missing or empty after template rendering, send_mail() cannot proceed' attachments = values.pop('attachments') or {} + del values['email_recipients'] # TODO Properly use them. msg_id = mail_mail.create(cr, uid, values, context=context) # link attachments attachment_ids = [] diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py index 7c69295ce9f..8837796bf9f 100644 --- a/addons/email_template/tests/test_mail.py +++ b/addons/email_template/tests/test_mail.py @@ -100,25 +100,27 @@ class test_message_compose(test_mail_mockup.TestMailMockups): # ---------------------------------------- # 1. Comment on pigs - compose_id = mail_compose.create(cr, uid, - {'subject': 'Forget me subject', 'body': 'Dummy body'}, - {'default_composition_mode': 'comment', - 'default_model': 'mail.group', - 'default_res_id': self.group_pigs_id, - 'default_use_template': False, - 'default_template_id': email_template_id, - 'active_ids': [self.group_pigs_id, self.group_bird_id]}) - compose = mail_compose.browse(cr, uid, compose_id) - - # 2. Perform 'toggle_template', to set use_template and use template_id - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) + context = { + 'default_composition_mode': 'comment', + 'default_model': 'mail.group', + 'default_res_id': self.group_pigs_id, + 'default_use_template': False, + 'default_template_id': email_template_id, + 'active_ids': [self.group_pigs_id, self.group_bird_id] + } + compose_id = mail_compose.create(cr, uid, {'subject': 'Forget me subject', 'body': 'Dummy body'}, context) + compose = mail_compose.browse(cr, uid, compose_id, context) + onchange_res = compose.onchange_template_id(email_template_id, 'comment', 'mail.group', self.group_pigs_id)['value'] + onchange_res['partner_ids'] = [(4, partner_id) for partner_id in onchange_res.pop('partner_ids', [])] + onchange_res['attachment_ids'] = [(4, attachment_id) for attachment_id in onchange_res.pop('attachment_ids', [])] + compose.write(onchange_res) compose.refresh() + message_pids = [partner.id for partner in compose.partner_ids] partner_ids = self.res_partner.search(cr, uid, [('email', 'in', ['b@b.b', 'c@c.c', 'd@d.d'])]) - # Test: mail.compose.message: subject, body, content_subtype, partner_ids + # Test: mail.compose.message: subject, body, partner_ids self.assertEqual(compose.subject, _subject1, 'mail.compose.message subject incorrect') self.assertEqual(compose.body, _body_html1, 'mail.compose.message body incorrect') - self.assertEqual(compose.content_subtype, 'html', 'mail.compose.message content_subtype incorrect') self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect') # Test: mail.compose.message: attachments # Test: mail.message: attachments @@ -128,41 +130,34 @@ class test_message_compose(test_mail_mockup.TestMailMockups): self.assertIn((attach.name, base64.b64decode(attach.datas)), _attachments_test, 'mail.message attachment name / data incorrect') - # 3. Perform 'toggle_template': template is not set anymore - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) - compose.refresh() - # Test: subject, body, partner_ids - self.assertEqual(compose.subject, False, 'mail.compose.message subject incorrect') - self.assertEqual(compose.body, '', 'mail.compose.message body incorrect') - # ---------------------------------------- # CASE3: mass_mail with template # ---------------------------------------- # 1. Mass_mail on pigs and bird, with a default_partner_ids set to check he is correctly added - compose_id = mail_compose.create(cr, uid, - {'subject': 'Forget me subject', 'body': 'Dummy body'}, - {'default_composition_mode': 'mass_mail', - 'default_model': 'mail.group', - 'default_res_id': self.group_pigs_id, - 'default_use_template': False, - 'default_template_id': email_template_id, - 'default_partner_ids': [p_a_id], - 'active_ids': [self.group_pigs_id, self.group_bird_id]}) - compose = mail_compose.browse(cr, uid, compose_id) - - # 2. Perform 'toggle_template', to set use_template and use template_id - mail_compose.toggle_template(cr, uid, [compose_id], {'default_composition_mode': 'comment', 'default_model': 'mail.group'}) + context = { + 'default_composition_mode': 'mass_mail', + 'default_model': 'mail.group', + 'default_res_id': self.group_pigs_id, + 'default_template_id': email_template_id, + 'default_partner_ids': [p_a_id], + 'active_ids': [self.group_pigs_id, self.group_bird_id] + } + compose_id = mail_compose.create(cr, uid, {'subject': 'Forget me subject', 'body': 'Dummy body'}, context) + compose = mail_compose.browse(cr, uid, compose_id, context) + onchange_res = compose.onchange_template_id(email_template_id, 'mass_mail', 'mail.group', self.group_pigs_id)['value'] + onchange_res['partner_ids'] = [(4, partner_id) for partner_id in onchange_res.pop('partner_ids', [])] + onchange_res['attachment_ids'] = [(4, attachment_id) for attachment_id in onchange_res.pop('attachment_ids', [])] + compose.write(onchange_res) compose.refresh() + message_pids = [partner.id for partner in compose.partner_ids] partner_ids = [p_a_id] - # Test: mail.compose.message: subject, body, content_subtype, partner_ids self.assertEqual(compose.subject, '${object.name}', 'mail.compose.message subject incorrect') self.assertEqual(compose.body, '${object.description}', 'mail.compose.message body incorrect') - self.assertEqual(compose.content_subtype, 'html', 'mail.compose.message content_subtype incorrect') self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect') - # 3. Post the comment, get created message + # 2. Post the comment, get created message mail_compose.send_mail(cr, uid, [compose_id], {'default_res_id': -1, 'active_ids': [self.group_pigs_id, self.group_bird_id]}) group_pigs.refresh() group_bird.refresh() diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 9a995985687..168d93cdbe5 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -19,11 +19,8 @@ # ############################################################################## -import tools - -from osv import osv -from osv import fields - +from openerp import tools +from openerp.osv import osv, fields def _reopen(self, res_id, model): return {'type': 'ir.actions.act_window', @@ -39,7 +36,6 @@ def _reopen(self, res_id, model): }, } - class mail_compose_message(osv.TransientModel): _inherit = 'mail.compose.message' @@ -60,37 +56,19 @@ class mail_compose_message(osv.TransientModel): record_ids = email_template_obj.search(cr, uid, [('model', '=', model)], context=context) return email_template_obj.name_get(cr, uid, record_ids, context) + [(False, '')] - def default_get(self, cr, uid, fields, context=None): - if context is None: - context = {} - result = super(mail_compose_message, self).default_get(cr, uid, fields, context=context) - result['template_id'] = context.get('default_template_id', context.get('mail.compose.template_id', False)) - - # pre-render the template if any - if result.get('use_template') and result.get('template_id'): - onchange_res = self.onchange_use_template(cr, uid, [], result.get('use_template'), result.get('template_id'), - result.get('composition_mode'), result.get('model'), result.get('res_id'), context=context) - result.update(onchange_res['value']) - return result - _columns = { - 'use_template': fields.boolean('Use Template'), # incredible hack of the day: size=-1 means we want an int db column instead of an str one 'template_id': fields.selection(_get_templates, 'Template', size=-1), } - _defaults = { - 'use_template': True, - } - - def onchange_template_id(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None): - """ - use_template not set: return default_get - - use_template set in mass_mailing: we cannot render, so return the template values - - use_template set: return rendered values """ - if use_template and template_id and composition_mode == 'mass_mail': + def onchange_template_id(self, cr, uid, ids, template_id, composition_mode, model, res_id, context=None): + """ - mass_mailing: we cannot render, so return the template values + - normal mode: return rendered values """ + if template_id and composition_mode == 'mass_mail': values = self.pool.get('email.template').read(cr, uid, template_id, ['subject', 'body_html'], context) values.pop('id') - elif use_template and template_id: + elif template_id: + # FIXME odo: change the mail generation to avoid attachment duplication values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context) # transform attachments into attachment_ids values['attachment_ids'] = [] @@ -102,38 +80,16 @@ class mail_compose_message(osv.TransientModel): 'datas_fname': attach_fname, 'res_model': model, 'res_id': res_id, + 'type': 'binary', # override default_type from context, possibly meant for another model! } values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context)) else: - values = self.default_get(cr, uid, ['body', 'body_html', 'subject', 'partner_ids', 'attachment_ids'], context=context) + values = self.default_get(cr, uid, ['body', 'subject', 'partner_ids', 'attachment_ids'], context=context) if values.get('body_html'): values['body'] = values.pop('body_html') - values.update(use_template=use_template, template_id=template_id) return {'value': values} - def toggle_template(self, cr, uid, ids, context=None): - """ hit toggle template mode button: calls onchange_use_template to - emulate an on_change, then writes the values to update the form. """ - for record in self.browse(cr, uid, ids, context=context): - onchange_res = self.onchange_use_template(cr, uid, ids, not record.use_template, - record.template_id, record.composition_mode, record.model, record.res_id, context=context).get('value', {}) - # update partner_ids and attachment_ids - onchange_res['partner_ids'] = [(4, partner_id) for partner_id in onchange_res.pop('partner_ids', [])] - onchange_res['attachment_ids'] = [(4, attachment_id) for attachment_id in onchange_res.pop('attachment_ids', [])] - record.write(onchange_res) - return _reopen(self, record.id, record.model) - - def onchange_use_template(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None): - """ onchange_use_template (values: True or False). If use_template is - False, we do as an onchange with template_id False for values """ - values = self.onchange_template_id(cr, uid, ids, use_template, - template_id, composition_mode, model, res_id, context=context) - # force html when using templates - if use_template: - values['value']['content_subtype'] = 'html' - return values - def save_as_template(self, cr, uid, ids, context=None): """ hit save as template button: current form value will be a new template attached to the current document. """ @@ -154,7 +110,7 @@ class mail_compose_message(osv.TransientModel): 'attachment_ids': [(6, 0, [att.id for att in record.attachment_ids])] } template_id = email_template.create(cr, uid, values, context=context) - record.write(record.onchange_template_id(True, template_id, record.composition_mode, record.model, record.res_id)['value']) + record.write(record.onchange_template_id(template_id, record.composition_mode, record.model, record.res_id)['value']) return _reopen(self, record.id, record.model) #------------------------------------------------------ @@ -166,7 +122,7 @@ class mail_compose_message(osv.TransientModel): mail.compose.message, transform email_cc and email_to into partner_ids """ template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context) # filter template values - fields = ['body', 'body_html', 'subject', 'email_to', 'email_recipients', 'email_cc', 'attachments'] + fields = ['body_html', 'subject', 'email_to', 'email_recipients', 'email_cc', 'attachments'] values = dict((field, template_values[field]) for field in fields if template_values.get(field)) values['body'] = values.pop('body_html', '') # transform email_to, email_cc into partner_ids diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml index 5afaf9745e1..34a2112e1ac 100644 --- a/addons/email_template/wizard/mail_compose_message_view.xml +++ b/addons/email_template/wizard/mail_compose_message_view.xml @@ -7,25 +7,17 @@- mail.compose.message - - diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 8eb1baba760..bed4cd872fa 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -227,7 +227,6 @@- -- - - +- -Use template -- -- + + +Use template ++ ++ fleet.vehicle.tree fleet.vehicle -1 diff --git a/addons/fleet/security/ir.model.access.csv b/addons/fleet/security/ir.model.access.csv index 0c50a6fbee3..823b3cb2945 100644 --- a/addons/fleet/security/ir.model.access.csv +++ b/addons/fleet/security/ir.model.access.csv @@ -8,4 +8,6 @@ fleet_vehicle_access_right,fleet_vehicle_access_right,model_fleet_vehicle,,1,1,1 fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fleet_vehicle_log_fuel,,1,1,1,1 fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1 fleet_vehicle_log_contract_access_right,fleet_vehicle_log_contract_access_right,model_fleet_vehicle_log_contract,,1,1,1,1 -fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 \ No newline at end of file +fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1 +access_fleet_vehicle_cost,access_fleet_vehicle_cost,model_fleet_vehicle_cost,,1,1,1,1 +access_fleet_contract_state,access_fleet_contract_state,model_fleet_contract_state,,1,1,1,1 diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 155f20daf4d..de1539da55a 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -356,7 +356,8 @@ class hr_applicant(base_stage, osv.Model): """ if isinstance(ids, (str, int, long)): ids = [ids] - if update_vals is None: vals = {} + if update_vals is None: + update_vals = {} update_vals.update({ 'description': msg.get('body'), @@ -373,12 +374,12 @@ class hr_applicant(base_stage, osv.Model): } for line in msg.get('body', '').split('\n'): line = line.strip() - res = tools.misc.command_re.match(line) + res = tools.command_re.match(line) if res and maps.get(res.group(1).lower(), False): key = maps.get(res.group(1).lower()) update_vals[key] = res.group(2).lower() - return super(hr_applicant, self).message_update(cr, uids, ids, update_vals=update_vals, context=context) + return super(hr_applicant, self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context) def create(self, cr, uid, vals, context=None): obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context) @@ -420,7 +421,7 @@ class hr_applicant(base_stage, osv.Model): self.write(cr, uid, [applicant.id], {'emp_id': emp_id}, context=context) self.case_close(cr, uid, [applicant.id], context) else: - raise osv.except_osv(_('Warning!'),_('You must define Applied Job for this applicant.')) + raise osv.except_osv(_('Warning!'), _('You must define Applied Job for this applicant.')) action_model, action_id = model_data.get_object_reference(cr, uid, 'hr', 'open_view_employee_list') dict_act_window = act_window.read(cr, uid, action_id, []) @@ -433,13 +434,13 @@ class hr_applicant(base_stage, osv.Model): """Overrides cancel for crm_case for setting probability """ res = super(hr_applicant, self).case_cancel(cr, uid, ids, context) - self.write(cr, uid, ids, {'probability' : 0.0}) + self.write(cr, uid, ids, {'probability': 0.0}) return res def case_pending(self, cr, uid, ids, context=None): """Marks case as pending""" res = super(hr_applicant, self).case_pending(cr, uid, ids, context) - self.write(cr, uid, ids, {'probability' : 0.0}) + self.write(cr, uid, ids, {'probability': 0.0}) return res def case_reset(self, cr, uid, ids, context=None): @@ -452,7 +453,7 @@ class hr_applicant(base_stage, osv.Model): def set_priority(self, cr, uid, ids, priority, *args): """Set applicant priority """ - return self.write(cr, uid, ids, {'priority' : priority}) + return self.write(cr, uid, ids, {'priority': priority}) def set_high_priority(self, cr, uid, ids, *args): """Set applicant priority to high @@ -475,7 +476,7 @@ class hr_applicant(base_stage, osv.Model): return self.message_post(cr, uid, ids, body=_("Stage changed to %s.") % (stage_name), context=context) def case_get_note_msg_prefix(self, cr, uid, id, context=None): - return 'Applicant' + return 'Applicant' def case_open_send_note(self, cr, uid, ids, context=None): message = _("Applicant has been set in progress.") diff --git a/addons/hr_timesheet/i18n/de.po b/addons/hr_timesheet/i18n/de.po index e60d95cb75f..a1ac73f5d7a 100644 --- a/addons/hr_timesheet/i18n/de.po +++ b/addons/hr_timesheet/i18n/de.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev_rc3\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-02-08 00:36+0000\n" -"PO-Revision-Date: 2012-05-10 17:22+0000\n" -"Last-Translator: Ferdinand-camptocamp \n" +"PO-Revision-Date: 2012-11-18 00:40+0000\n" +"Last-Translator: Felix Schubert \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-30 05:11+0000\n" -"X-Generator: Launchpad (build 16206)\n" +"X-Launchpad-Export-Date: 2012-11-19 04:37+0000\n" +"X-Generator: Launchpad (build 16278)\n" #. module: hr_timesheet #: code:addons/hr_timesheet/report/user_timesheet.py:43 @@ -37,7 +37,7 @@ msgstr "Kein Mitarbeiter für diesen Benutzer definiert!" #. module: hr_timesheet #: view:hr.analytic.timesheet:0 msgid "Group By..." -msgstr "Gruppierung..." +msgstr "Gruppieren nach" #. module: hr_timesheet #: model:ir.actions.act_window,help:hr_timesheet.action_hr_timesheet_sign_in @@ -66,7 +66,7 @@ msgstr "Analytisches Journal" #. module: hr_timesheet #: view:hr.sign.out.project:0 msgid "Stop Working" -msgstr "Beende Arbeit" +msgstr "Arbeitsende" #. module: hr_timesheet #: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_employee @@ -172,13 +172,13 @@ msgstr "Warnung !" #: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:132 #, python-format msgid "UserError" -msgstr "BenutzerFehler" +msgstr "Benutzer Fehler" #. module: hr_timesheet #: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:77 #, python-format msgid "No cost unit defined for this employee !" -msgstr "Keine Kosten Einheit für diesen Mitarbeiter definiert!" +msgstr "Kein Stundensatz für diesen Mitarbeiter definiert!" #. module: hr_timesheet #: code:addons/hr_timesheet/report/user_timesheet.py:43 @@ -254,7 +254,7 @@ msgstr "Juli" #: field:hr.sign.in.project,date:0 #: field:hr.sign.out.project,date_start:0 msgid "Starting Date" -msgstr "Anfangsdatum" +msgstr "Start Datum" #. module: hr_timesheet #: view:hr.employee:0 @@ -271,8 +271,8 @@ msgstr "" #: help:hr.employee,product_id:0 msgid "Specifies employee's designation as a product with type 'service'." msgstr "" -"Spezifiziere ein Produkt mit dem Typ 'Dienstleistungen' bei den " -"Mitarbeitereinstellungen auf dem Aktenreiter 'Zeiterfassung'." +"Definiert ein Produkt mit dem Typ \"Dienstleistung\" in den Einstellungen " +"für den Mitarbeiter" #. module: hr_timesheet #: view:hr.analytic.timesheet:0 @@ -318,7 +318,7 @@ msgstr "Aufgabenbeschreibung" #. module: hr_timesheet #: view:account.analytic.account:0 msgid "Invoice Analysis" -msgstr "Statistik Rechnungen" +msgstr "Rechnungsanalyse" #. module: hr_timesheet #: model:ir.actions.report.xml,name:hr_timesheet.report_user_timesheet @@ -334,7 +334,7 @@ msgstr "Anmelden / Abmelden bei Projekt" #. module: hr_timesheet #: model:ir.actions.act_window,name:hr_timesheet.action_define_analytic_structure msgid "Define your Analytic Structure" -msgstr "Definieren Sie die Strukture der Analysekonten" +msgstr "Definiere die Struktur der Analytischen Konten" #. module: hr_timesheet #: view:hr.sign.in.project:0 @@ -348,14 +348,14 @@ msgid "" "Analytic journal is not defined for employee %s \n" "Define an employee for the selected user and assign an analytic journal!" msgstr "" -"Analytisches Journal ist für diesen Mitarbeiter nicht definiert: %s\n" -"Definiere einen Mitarbeiter für den ausgewählten Benutzer und weise dann " -"noch ein analytisches Konto zu!" +"Es wurde kein Analytisches Journal für diesen Mitarbeiter definiert: %s\n" +"Weise einen Mitarbeiter dem ausgewählten Benutzer und ein analytisches Konto " +"zu!" #. module: hr_timesheet #: view:hr.sign.in.project:0 msgid "(Keep empty for current time)" -msgstr "(Leer lassen für aktuelle Zeit)" +msgstr "(Frei lassen für den aktuellen Zeitpunkt)" #. module: hr_timesheet #: view:hr.employee:0 @@ -369,9 +369,9 @@ msgid "" "analyse costs and revenues. In OpenERP, analytic accounts are also used to " "track customer contracts." msgstr "" -"Um Erlöse und Kosten zu analysiren, benötigen Sie einen strukturierte " -"Analyse Kontenplan. In OpenERP wird damit auch die Entwicklung der " -"Kundenkontrakte verfolgt." +"Um Erlöse und Kosten zu analysieren, sollten Sie einen strukturierte " +"analytischen Kontenplan erstellen. In OpenERP können damit auch " +"Kundenverträge verfolgt werden." #. module: hr_timesheet #: field:hr.analytic.timesheet,line_id:0 @@ -424,7 +424,7 @@ msgstr "" #. module: hr_timesheet #: field:hr.sign.out.project,date:0 msgid "Closing Date" -msgstr "Ende Datum" +msgstr "Enddatum" #. module: hr_timesheet #: code:addons/hr_timesheet/report/user_timesheet.py:40 @@ -475,12 +475,12 @@ msgstr "Mitarbeiter Nr." #. module: hr_timesheet #: view:hr.sign.out.project:0 msgid "General Information" -msgstr "Grundinformation" +msgstr "Allgemeine Informationen" #. module: hr_timesheet #: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_my msgid "My Current Timesheet" -msgstr "" +msgstr "Meine Zeiterfassung" #. module: hr_timesheet #: code:addons/hr_timesheet/report/user_timesheet.py:40 @@ -524,8 +524,8 @@ msgid "" "Through this menu you can register and follow your workings hours by project " "every day." msgstr "" -"Mit diesem Menüpunkt können Sie sich registrieren und die Arbeitsstunden je " -"Projekt und Tage verfoglen." +"Mit diesem Menüpunkt können Sie die Arbeitsstunden pro Projekt und Tage " +"verfolgen." #. module: hr_timesheet #: field:hr.sign.in.project,server_date:0 @@ -561,12 +561,12 @@ msgstr "Mai" #. module: hr_timesheet #: view:hr.analytic.timesheet:0 msgid "Total time" -msgstr "Gesamtzeit" +msgstr "Gesamtdauer" #. module: hr_timesheet #: view:hr.sign.in.project:0 msgid "(local time on the server side)" -msgstr "(Ortszeit auf dem Server)" +msgstr "(Ortszeit auf Serverseite)" #. module: hr_timesheet #: model:ir.model,name:hr_timesheet.model_hr_sign_in_project @@ -585,7 +585,7 @@ msgstr "Februar" #. module: hr_timesheet #: model:ir.model,name:hr_timesheet.model_hr_sign_out_project msgid "Sign Out By Project" -msgstr "Anmelden / Abmelden Projekte" +msgstr "Anmelden / Abmelden Projekt" #. module: hr_timesheet #: view:hr.analytical.timesheet.users:0 @@ -617,7 +617,7 @@ msgid "" "No analytic account defined on the project.\n" "Please set one or we can not automatically fill the timesheet." msgstr "" -"Kein Analytisches Konto für Projekt definiert.\n" +"Kein Analytisches Konto für das Projekt definiert.\n" "Bitte definieren Sie ein Konto, damit wir automatisch die Zeiterfassung " "buchen können." @@ -630,12 +630,12 @@ msgstr "Benutzer" #. module: hr_timesheet #: view:hr.sign.in.project:0 msgid "Start Working" -msgstr "Beginne Arbeit" +msgstr "Arbeitsbeginn" #. module: hr_timesheet #: view:account.analytic.account:0 msgid "Stats by user" -msgstr "Arbeitszeiten nach Mitarbeitern" +msgstr "Auswertung nach Mitarbeiter" #. module: hr_timesheet #: code:addons/hr_timesheet/wizard/hr_timesheet_print_employee.py:42 diff --git a/addons/l10n_be_hr_payroll/i18n/de.po b/addons/l10n_be_hr_payroll/i18n/de.po new file mode 100644 index 00000000000..6c95585909e --- /dev/null +++ b/addons/l10n_be_hr_payroll/i18n/de.po @@ -0,0 +1,163 @@ +# German translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 00:36+0000\n" +"PO-Revision-Date: 2012-11-18 21:44+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-11-19 04:37+0000\n" +"X-Generator: Launchpad (build 16278)\n" + +#. module: l10n_be_hr_payroll +#: help:hr.employee,disabled_spouse_bool:0 +msgid "if recipient spouse is declared disabled by law" +msgstr "" +"Wenn Ehepartner des Empfängers gesetzlich als Behindert anerkannt wurde" + +#. module: l10n_be_hr_payroll +#: help:hr.employee,disabled_children_bool:0 +msgid "if recipient children is/are declared disabled by law" +msgstr "" +"Wenn Kind(er) des Empfängers gesetzlich als behindert anerkannt ist (sind)" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,misc_onss_deduction:0 +msgid "Miscellaneous exempt ONSS " +msgstr "Diverse Ausnahmen (ONSS) " + +#. module: l10n_be_hr_payroll +#: model:ir.model,name:l10n_be_hr_payroll.model_hr_employee +msgid "Employee" +msgstr "Angestellte/r" + +#. module: l10n_be_hr_payroll +#: field:hr.employee,disabled_spouse_bool:0 +msgid "Disabled Spouse" +msgstr "Als Behindert anerkannter Ehepartner" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,retained_net_amount:0 +msgid "Net retained " +msgstr "Einbehalten Netto " + +#. module: l10n_be_hr_payroll +#: field:hr.employee,resident_bool:0 +msgid "Nonresident" +msgstr "Im Ausland wohnhaft" + +#. module: l10n_be_hr_payroll +#: help:hr.employee,resident_bool:0 +msgid "if recipient lives in a foreign country" +msgstr "Wenn Empfänger in anderem Land wohnhaft ist" + +#. module: l10n_be_hr_payroll +#: view:hr.employee:0 +msgid "if spouse has professionnel income or not" +msgstr "Ob Ehepartner berufliches Einkommen hat oder nicht" + +#. module: l10n_be_hr_payroll +#: view:hr.contract:0 +msgid "Miscellaneous" +msgstr "Verschiedenes" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,insurance_employee_deduction:0 +msgid "Insurance Group - by worker " +msgstr "Vericherungsgruppe nach Mitarbeiter " + +#. module: l10n_be_hr_payroll +#: selection:hr.employee,spouse_fiscal_status:0 +msgid "With Income" +msgstr "Mit Einkommen" + +#. module: l10n_be_hr_payroll +#: selection:hr.employee,spouse_fiscal_status:0 +msgid "Without Income" +msgstr "Ohne Einkommen" + +#. module: l10n_be_hr_payroll +#: field:hr.employee,disabled_children_number:0 +msgid "Number of disabled children" +msgstr "Anzahl behinderter Kinder" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,additional_net_amount:0 +msgid "Net supplements" +msgstr "Netto-Zulagen" + +#. module: l10n_be_hr_payroll +#: constraint:hr.employee:0 +msgid "Error ! You cannot create recursive Hierarchy of Employees." +msgstr "" +"Fehler ! Sie können keine rekursive Hierachie bei Mitarbeitern definieren." + +#. module: l10n_be_hr_payroll +#: field:hr.contract,car_company_amount:0 +msgid "Company car employer" +msgstr "Firmenfahrzeug des Arbeitgebers" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,misc_advantage_amount:0 +msgid "Benefits of various nature " +msgstr "Geldwerte Vorteile verschiedener Art " + +#. module: l10n_be_hr_payroll +#: field:hr.contract,car_employee_deduction:0 +msgid "Company Car Deduction for Worker" +msgstr "Abzüge beim Mitarbeiter für Firmenfahrzeug" + +#. module: l10n_be_hr_payroll +#: field:hr.employee,disabled_children_bool:0 +msgid "Disabled Children" +msgstr "Behinderte Kinder" + +#. module: l10n_be_hr_payroll +#: model:ir.model,name:l10n_be_hr_payroll.model_hr_contract +msgid "Contract" +msgstr "Vertrag" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,meal_voucher_amount:0 +msgid "Check Value Meal " +msgstr "Verköstigungswert prüfen " + +#. module: l10n_be_hr_payroll +#: field:hr.contract,travel_reimbursement_amount:0 +msgid "Reimbursement of travel expenses" +msgstr "Erstattung von Reisespesen" + +#. module: l10n_be_hr_payroll +#: constraint:hr.contract:0 +msgid "Error! contract start-date must be lower then contract end-date." +msgstr "" +"Fehler! Datum des Vertragsbeginns muss zeitlich vor dem Datum des " +"Vertragsendes sein." + +#. module: l10n_be_hr_payroll +#: field:hr.employee,spouse_fiscal_status:0 +msgid "Tax status for spouse" +msgstr "Steuerklasse des Ehepartners" + +#. module: l10n_be_hr_payroll +#: view:hr.contract:0 +msgid "by Worker" +msgstr "nach Mitarbeiter" + +#. module: l10n_be_hr_payroll +#: view:hr.employee:0 +msgid "number of dependent children declared as disabled" +msgstr "Anzahl anhängiger, als behindert anerkannter Kinder" + +#. module: l10n_be_hr_payroll +#: field:hr.contract,meal_voucher_employee_deduction:0 +msgid "Check Value Meal - by worker " +msgstr "Verköstigungswerte - nach Mitarbeitern " diff --git a/addons/l10n_multilang/i18n/ar.po b/addons/l10n_multilang/i18n/ar.po new file mode 100644 index 00000000000..6ff075befb6 --- /dev/null +++ b/addons/l10n_multilang/i18n/ar.po @@ -0,0 +1,172 @@ +# Arabic translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2012-02-08 01:06+0000\n" +"PO-Revision-Date: 2012-11-16 19:54+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-11-17 04:37+0000\n" +"X-Generator: Launchpad (build 16278)\n" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_fiscal_position_template +msgid "Template for Fiscal Position" +msgstr "قوالب للمركز المالي" + +#. module: l10n_multilang +#: sql_constraint:account.account:0 +msgid "The code of the account must be unique per company !" +msgstr "يجب ان يكون كود الحساب فريداً لكل شركة !" + +#. module: l10n_multilang +#: constraint:account.account.template:0 +msgid "" +"Configuration Error!\n" +"You can not define children to an account with internal type different of " +"\"View\"! " +msgstr "" +"خطأ في الإعدادات!\n" +" لاتستطيع تعريف أطفال لحساب من نوع داخلي مختلف ل\"العرض\"! " + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_analytic_journal +msgid "Analytic Journal" +msgstr "يومية تحليلية" + +#. module: l10n_multilang +#: constraint:account.account.template:0 +msgid "Error ! You can not create recursive account templates." +msgstr "خطأ ! لا يمكنك انشاء قوالب الحاسب العودية." + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_journal +msgid "Journal" +msgstr "يومية" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_chart_template +msgid "Templates for Account Chart" +msgstr "القوالب لجدول الحساب" + +#. module: l10n_multilang +#: sql_constraint:account.tax:0 +msgid "The description must be unique per company!" +msgstr "وصف لكل شركة يجب ان تكون فريد!" + +#. module: l10n_multilang +#: constraint:account.tax.code.template:0 +msgid "Error ! You can not create recursive Tax Codes." +msgstr "خطأ ! لايمكنك إنشاء اكواد ضريبية متداخلة." + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_tax_template +msgid "account.tax.template" +msgstr "account.tax.template" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_tax +msgid "account.tax" +msgstr "account.tax" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_account +msgid "Account" +msgstr "حساب" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_wizard_multi_charts_accounts +msgid "wizard.multi.charts.accounts" +msgstr "wizard.multi.charts.accounts" + +#. module: l10n_multilang +#: constraint:account.journal:0 +msgid "" +"Configuration error! The currency chosen should be shared by the default " +"accounts too." +msgstr "" +"خطأ في الإعدادات! يجب أن تكون العملة المختارة مشتركة للحسابات الإفتراضية " +"أيضأً." + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_account_template +msgid "Templates for Accounts" +msgstr "قوالب للحسابات" + +#. module: l10n_multilang +#: help:account.chart.template,spoken_languages:0 +msgid "" +"State here the languages for which the translations of templates could be " +"loaded at the time of installation of this localization module and copied in " +"the final object when generating them from templates. You must provide the " +"language codes separated by ';'" +msgstr "" + +#. module: l10n_multilang +#: constraint:account.account:0 +msgid "Error ! You can not create recursive accounts." +msgstr "خطأ ! لا يمكن إنشاء حسابات تكرارية." + +#. module: l10n_multilang +#: constraint:account.account:0 +msgid "" +"Configuration Error! \n" +"You can not select an account type with a deferral method different of " +"\"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! " +msgstr "" +"التكوين الخطأ!\n" +"لا يمكنك اختيار نوع الحساب باستخدام طريقة التأجيل المختلفه \"عدم " +"المساواه\" للحسابات من النوع الداخلي \"الدفع / القبض\" " + +#. module: l10n_multilang +#: sql_constraint:account.journal:0 +msgid "The name of the journal must be unique per company !" +msgstr "يجب ان يكون الاسم لليومية فريد لكل شركة!" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_analytic_account +msgid "Analytic Account" +msgstr "حسابات تحليلية" + +#. module: l10n_multilang +#: sql_constraint:account.journal:0 +msgid "The code of the journal must be unique per company !" +msgstr "يجب ان يكون الكود لليومية فريد لكل شركة !" + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_fiscal_position +msgid "Fiscal Position" +msgstr "الوضع المالي" + +#. module: l10n_multilang +#: constraint:account.account:0 +msgid "" +"Configuration Error! \n" +"You can not define children to an account with internal type different of " +"\"View\"! " +msgstr "" +"خطأ في الإعدادات!\n" +"لا يمكنك تحديد فرع لحساب مع نوع داخلي مختلف من \"عرض\"! " + +#. module: l10n_multilang +#: constraint:account.analytic.account:0 +msgid "Error! You can not create recursive analytic accounts." +msgstr "خطأ! لا يمكنك إنشاء حسابات تحليلية متكررة." + +#. module: l10n_multilang +#: model:ir.model,name:l10n_multilang.model_account_tax_code_template +msgid "Tax Code Template" +msgstr "قالب رمز الضريبة" + +#. module: l10n_multilang +#: field:account.chart.template,spoken_languages:0 +msgid "Spoken Languages" +msgstr "اللغات المنطوقة" diff --git a/addons/l10n_pe/i18n/ar.po b/addons/l10n_pe/i18n/ar.po new file mode 100644 index 00000000000..90dcc9a47f6 --- /dev/null +++ b/addons/l10n_pe/i18n/ar.po @@ -0,0 +1,47 @@ +# Arabic translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2012-11-16 18:58+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Arabic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-11-17 04:37+0000\n" +"X-Generator: Launchpad (build 16278)\n" + +#. module: l10n_pe +#: model:ir.module.module,description:l10n_pe.module_meta_information +msgid "" +"\n" +" Peruvian Accounting : chart of Account\n" +" " +msgstr "" + +#. module: l10n_pe +#: model:ir.module.module,shortdesc:l10n_pe.module_meta_information +msgid "Peruvian Chart of Account" +msgstr "" + +#. module: l10n_pe +#: model:ir.actions.todo,note:l10n_pe.config_call_account_template_in_minimal +msgid "" +"Generate Chart of Accounts from a Chart Template. You will be asked to pass " +"the name of the company, the chart template to follow, the no. of digits to " +"generate the code for your accounts and Bank account, currency to create " +"Journals. Thus,the pure copy of chart Template is generated.\n" +"\tThis is the same wizard that runs from Financial " +"Management/Configuration/Financial Accounting/Financial Accounts/Generate " +"Chart of Accounts from a Chart Template." +msgstr "" +"إعداد شجرة الحسابات من قالب. ستم سؤالك عن اسم المنشأة، القالب المتبع، و " +"إعداد أكواد الحسابات و البنوك، بالإضافة إلي يوميات العملة. و لذلك سيكون هناك " +"قالب جديد. \n" +"\tهذه لإعداد الحسابات." diff --git a/addons/lunch/lunch_demo.xml b/addons/lunch/lunch_demo.xml index a9b03137bf2..7488208fd42 100644 --- a/addons/lunch/lunch_demo.xml +++ b/addons/lunch/lunch_demo.xml @@ -21,12 +21,10 @@ Coin gourmand -True Pizza Inn -True @@ -102,31 +100,28 @@ - + new -1 - + confirmed -1 - + - cancelled -1 +partially - + new @@ -136,7 +131,7 @@- + confirmed @@ -146,7 +141,7 @@- ++ cancelled @@ -155,9 +150,18 @@+ + + + confirmed ++ +Salad +Tomatoes +Eggs ++ - + Pizza Italiana -7.40 @@ -166,7 +170,16 @@- + ++ + + Chicken curry +-2.60 ++ order ++ Payment: 5 lunch tickets (6€) 30 @@ -175,7 +188,6 @@diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index 32b978dfab0..ea9356bddc5 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -12,7 +12,6 @@ Lunch must be ordered before 10h30 am -days Search lunch.order.line -search @@ -34,7 +33,6 @@ lunch employee payment lunch.cashmove -search @@ -49,7 +47,6 @@ lunch cashmove lunch.cashmove -search @@ -65,7 +62,6 @@ lunch orders lunch.order -search @@ -79,7 +75,6 @@ Search lunch.alert -search @@ -243,7 +238,6 @@ Product category Form lunch.product.category -form
Pigs rules' + _body = 'Pigs rule' + _reply_subject = 'Re: Pigs' _attachments = [ {'name': 'First', 'datas_fname': 'first.txt', 'datas': 'My first attachment'.encode('base64')}, {'name': 'Second', 'datas_fname': 'second.txt', 'datas': 'My second attachment'.encode('base64')} @@ -462,9 +461,9 @@ class test_mail(test_mail_mockup.TestMailMockups): # 1. Comment group_pigs with body_text and subject compose_id = mail_compose.create(cr, uid, - {'subject': _subject, 'body_text': _body_text, 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, + {'subject': _subject, 'body': _body, 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id, - 'default_content_subtype': 'plaintext'}) + 'default_content_subtype': 'plaintext'}) compose = mail_compose.browse(cr, uid, compose_id) # Test: mail.compose.message: composition_mode, model, res_id self.assertEqual(compose.composition_mode, 'comment', 'mail.compose.message incorrect composition_mode') @@ -476,8 +475,8 @@ class test_mail(test_mail_mockup.TestMailMockups): group_pigs.refresh() message = group_pigs.message_ids[0] # Test: mail.message: subject, body inside pre - self.assertEqual(message.subject, False, 'mail.message incorrect subject') - self.assertEqual(message.body, _msg_body, 'mail.message incorrect body') + self.assertEqual(message.subject, _subject, 'mail.message incorrect subject') + self.assertEqual(message.body, _body, 'mail.message incorrect body') # Test: mail.message: notified_partner_ids = entries in mail.notification: group_pigs fans (a, b) + mail.compose.message partner_ids (c, d) msg_pids = [partner.id for partner in message.notified_partner_ids] test_pids = [p_b_id, p_c_id, p_d_id] @@ -495,21 +494,18 @@ class test_mail(test_mail_mockup.TestMailMockups): {'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])]}, {'default_composition_mode': 'reply', 'default_model': 'mail.thread', 'default_res_id': self.group_pigs_id, 'default_parent_id': message.id}) compose = mail_compose.browse(cr, uid, compose_id) - # Test: model, res_id, parent_id, content_subtype + # Test: model, res_id, parent_id self.assertEqual(compose.model, 'mail.group', 'mail.compose.message incorrect model') self.assertEqual(compose.res_id, self.group_pigs_id, 'mail.compose.message incorrect res_id') self.assertEqual(compose.parent_id.id, message.id, 'mail.compose.message incorrect parent_id') - self.assertEqual(compose.content_subtype, 'html', 'mail.compose.message incorrect content_subtype') # Test: mail.message: subject as Re:.., body in html, parent_id - self.assertEqual(compose.subject, _msg_reply, 'mail.message incorrect subject') + self.assertEqual(compose.subject, _reply_subject, 'mail.message incorrect subject') # self.assertIn('Administrator wrote:
', compose.body, 'mail.message body is incorrect') self.assertEqual(compose.parent_id and compose.parent_id.id, message.id, 'mail.message parent_id incorrect') # Test: mail.message: attachments for attach in compose.attachment_ids: - self.assertEqual(attach.res_model, 'mail.group', 'mail.message attachment res_model incorrect') - self.assertEqual(attach.res_id, self.group_pigs_id, 'mail.message attachment res_id incorrect') self.assertIn((attach.datas_fname, attach.datas.decode('base64')), _attachments_test, 'mail.message attachment name / data incorrect') - + # ---------------------------------------- # CASE3: mass_mail on Pigs and Bird # ---------------------------------------- @@ -520,8 +516,6 @@ class test_mail(test_mail_mockup.TestMailMockups): {'default_composition_mode': 'mass_mail', 'default_model': 'mail.group', 'default_res_id': False, 'active_ids': [self.group_pigs_id, group_bird_id]}) compose = mail_compose.browse(cr, uid, compose_id) - # Test: content_subtype is html - self.assertEqual(compose.content_subtype, 'html', 'mail.compose.message content_subtype incorrect') # 2. Post the comment, get created message for each group mail_compose.send_mail(cr, uid, [compose_id], diff --git a/addons/mail/tests/test_mail_access_rights.py b/addons/mail/tests/test_mail_access_rights.py index ec08d257efe..1b2f7f85d71 100644 --- a/addons/mail/tests/test_mail_access_rights.py +++ b/addons/mail/tests/test_mail_access_rights.py @@ -20,7 +20,8 @@ ############################################################################## from openerp.addons.mail.tests import test_mail_mockup -from osv.orm import except_orm +from openerp.osv.orm import except_orm +from openerp.tools import mute_logger class test_mail_access_rights(test_mail_mockup.TestMailMockups): @@ -51,6 +52,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): self.user_raoul = self.res_users.browse(cr, uid, self.user_raoul_id) self.partner_raoul_id = self.user_raoul.partner_id.id + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_00_mail_message_search_access_rights(self): """ Test mail_message search override about access rights. """ cr, uid, group_pigs_id = self.cr, self.uid, self.group_pigs_id @@ -84,6 +86,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): msg_ids = self.mail_message.search(cr, uid, [('subject', 'like', '_Test')]) self.assertEqual(set([msg_id1, msg_id2, msg_id3, msg_id4, msg_id5, msg_id6, msg_id7, msg_id8]), set(msg_ids), 'mail_message search failed') + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_05_mail_message_read_access_rights(self): """ Test basic mail_message read access rights. """ cr, uid = self.cr, self.uid @@ -131,6 +134,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): self.assertRaises(except_orm, self.mail_message.read, cr, user_bert_id, message_id) + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_10_mail_flow_access_rights(self): """ Test a Chatter-looks alike flow. """ cr, uid = self.cr, self.uid @@ -178,14 +182,14 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): # Do: Bert create a mail.compose.message record, because he uses the wizard compose_id = mail_compose.create(cr, user_bert_id, - {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': []}, + {'subject': 'Subject', 'body': 'Body text', 'partner_ids': []}, # {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_jobs_id}) mail_compose.send_mail(cr, user_bert_id, [compose_id]) self.user_demo_id = self.registry('ir.model.data').get_object_reference(self.cr, self.uid, 'base', 'user_demo')[1] compose_id = mail_compose.create(cr, self.user_demo_id, - {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': []}, + {'subject': 'Subject', 'body': 'Body text', 'partner_ids': []}, # {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_jobs_id}) mail_compose.send_mail(cr, self.user_demo_id, [compose_id]) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 839a3a6970e..58066c6f2c2 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -81,7 +81,7 @@ class mail_compose_message(osv.TransientModel): elif composition_mode == 'comment' and model and res_id: vals = self.get_record_data(cr, uid, model, res_id, context=context) elif composition_mode == 'mass_mail' and model and active_ids: - vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'} + vals = {'model': model, 'res_id': res_id} else: vals = {'model': model, 'res_id': res_id} if composition_mode: @@ -102,20 +102,14 @@ class mail_compose_message(osv.TransientModel): 'partner_ids': fields.many2many('res.partner', 'mail_compose_message_res_partner_rel', 'wizard_id', 'partner_id', 'Additional contacts'), - 'attachment_ids': fields.one2many('ir.attachment', 'res_id', - domain=lambda self: [('res_model', '=', self._name)], - string='Attachments'), + 'attachment_ids': fields.many2many('ir.attachment', + 'mail_compose_message_ir_attachments_rel', + 'wizard_id', 'attachment_id', 'Attachments'), 'filter_id': fields.many2one('ir.filters', 'Filters'), - 'body_text': fields.text('Plain-text Contents'), - 'content_subtype': fields.char('Message content subtype', size=32, readonly=1, - help="Type of message, usually 'html' or 'plain', used to select "\ - "plain-text or rich-text contents accordingly"), } _defaults = { 'composition_mode': 'comment', - 'content_subtype': lambda self, cr, uid, ctx={}: 'html', - 'body_text': lambda self, cr, uid, ctx={}: False, 'body': lambda self, cr, uid, ctx={}: '', 'subject': lambda self, cr, uid, ctx={}: False, 'partner_ids': lambda self, cr, uid, ctx={}: [], @@ -172,32 +166,9 @@ class mail_compose_message(osv.TransientModel): 'parent_id': message_data.id, 'subject': reply_subject, 'partner_ids': partner_ids, - 'content_subtype': 'html', } return result - def toggle_content_subtype(self, cr, uid, ids, context=None): - """ toggle content_subtype: calls onchange_formatting to emulate an - on_change, then writes the value to update the form. """ - for record in self.browse(cr, uid, ids, context=context): - content_st_new_value = 'plain' if record.content_subtype == 'html' else 'html' - onchange_res = self.onchange_content_subtype(cr, uid, ids, content_st_new_value, record.model, record.res_id, context=context) - self.write(cr, uid, [record.id], onchange_res['value'], context=context) - return True - - def onchange_content_subtype(self, cr, uid, ids, value, model, res_id, context=None): - """ This onchange allows to have some specific behavior when switching - between text or html mode. This method can be overridden. - :param values: 'plain' or 'html' - """ - return {'value': {'content_subtype': value}} - - def dummy(self, cr, uid, ids, context=None): - """ TDE: defined to have buttons that do basically nothing. It is - currently impossible to have buttons that do nothing special - in views (if type not specified, considered as 'object'). """ - return True - #------------------------------------------------------ # Wizard validation and send #------------------------------------------------------ @@ -218,8 +189,8 @@ class mail_compose_message(osv.TransientModel): for res_id in res_ids: # default values, according to the wizard options post_values = { - 'subject': wizard.subject if wizard.content_subtype == 'html' else False, - 'body': wizard.body if wizard.content_subtype == 'html' else 'Pigs rules
%s' % tools.ustr(wizard.body_text), + 'subject': wizard.subject, + 'body': wizard.body, 'parent_id': wizard.parent_id and wizard.parent_id.id, 'partner_ids': [(4, partner.id) for partner in wizard.partner_ids], 'attachments': [(attach.datas_fname or attach.name, base64.b64decode(attach.datas)) for attach in wizard.attachment_ids], diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index 86b1be6562f..57fc0aaf729 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -12,7 +12,6 @@