From afe9a79c28984542abb34df3b65f14366592cdad Mon Sep 17 00:00:00 2001 From: "Chirag Dodiya (OpenERP)" Date: Thu, 23 Jan 2014 14:37:13 +0530 Subject: [PATCH] [IMP]Improved template form view and set default value bzr revid: cod@tinyerp.com-20140123090713-v7rk0y9ot32nmmhs --- .../account_product.py | 14 ++++++++++++- .../account_product_view.xml | 21 +++++++++++++++++-- addons/mail/static/src/css/mail.css | 3 +++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/addons/account_product_template/account_product.py b/addons/account_product_template/account_product.py index 950357658b2..0eb88dfa543 100644 --- a/addons/account_product_template/account_product.py +++ b/addons/account_product_template/account_product.py @@ -25,7 +25,19 @@ class product_template(osv.osv): _columns = { 'email_template_id': fields.many2one('email.template','Product Email Template'), } - + +class email_template(osv.osv): + _inherit = 'email.template' + + def default_get(self, cr, uid, fields, context=None): + res = super(email_template, self).default_get(cr, uid, fields, context) + ir_model_obj = self.pool.get('ir.model') + if context.get('form_view_ref') == 'account_product_template.view_email_template_form_edit': + res['email_from'] = '${(user.email)|safe}' + res['partner_to'] = '${object.partner_id.id}' + res['model_id'] = ir_model_obj.search(cr, uid, [('model', '=', 'account.invoice')], context=context) + return res + class account_invoice(osv.Model): _inherit = 'account.invoice' diff --git a/addons/account_product_template/account_product_view.xml b/addons/account_product_template/account_product_view.xml index f1476ac05e6..5babe493c6d 100644 --- a/addons/account_product_template/account_product_view.xml +++ b/addons/account_product_template/account_product_view.xml @@ -1,14 +1,31 @@ - + + email.template.form + email.template + 100 + +
+ + + + + +

Body

+ + +
+
+
+
product.normal.procurement.locations.inherit product.product - + diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index bfae7571a9c..cdfed33aebb 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -757,4 +757,7 @@ .openerp .oe_sidebar_suggestion .oe_suggest_items:hover a.oe_suggestion_remove_item { visibility: visible; } +.openerp .oe_mail_expand { + font-size: 13px; +}