diff --git a/mail_quotation/__init__.py b/mail_quotation/__init__.py new file mode 100644 index 00000000000..5dcefef281c --- /dev/null +++ b/mail_quotation/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + diff --git a/mail_quotation/__openerp__.py b/mail_quotation/__openerp__.py new file mode 100644 index 00000000000..4d958cbd98b --- /dev/null +++ b/mail_quotation/__openerp__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2012 Savoir-faire Linux (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + "name" : "Mail quotation", + "version" : "0.1", + "author" : "Savoir-faire Linux", + "website" : "http://www.savoirfairelinux.com", + "license" : "AGPL-3", + "category" : "Mail", + "description" : """ +This module adds a server action, an email template and a button on the sales order form to +send quotation by email. + """, + "images" : [], + "depends" : ["sale"], + "demo" : [], + "test" : [], + "data" : [ + "quotation_action_data.xml", + "sale_order_view.xml", + ], + "installable": True, + "complexity": "easy", +} diff --git a/mail_quotation/quotation_action_data.xml b/mail_quotation/quotation_action_data.xml new file mode 100644 index 00000000000..45c66454071 --- /dev/null +++ b/mail_quotation/quotation_action_data.xml @@ -0,0 +1,142 @@ + + + + + + if not object.partner_id.opt_out: object.edi_export_and_email(template_ext_id='mail_quotation.email_template_edi_quotation', context=context) + code + ir.actions.server + + True + Email quotations + + + + + + + + + + + Quotation Mail + ${object.user_id.user_email or ''} + ${object.company_id.name} Quotation (Ref ${object.name or 'n/a' }) + ${object.partner_invoice_id.email} + + + ${object.name or 'Quotation'} + + ${object.partner_id.lang} + + +

Hello${object.partner_order_id.name and ' ' or ''}${object.partner_order_id.name or ''},

+ +

Here is your quotation for ${object.partner_id.name}:

+ +

+   REFERENCES
+   Quotation number: ${object.name}
+   Quotation total: ${object.amount_total} ${object.pricelist_id.currency_id.name}
+   Quotation date: ${object.date_order}
+ % if object.origin: +   Quotation reference: ${object.origin}
+ % endif + % if object.client_order_ref: +   Your reference: ${object.client_order_ref}
+ % endif +   Your contact: ${object.user_id.name} +

+ +

+ You can view the quotation document and download it using the following link: +

+ View Quotation + +
+

If you have any question, do not hesitate to contact us.

+

Thank you for choosing ${object.company_id.name or 'us'}!

+
+
+
+

+ ${object.company_id.name}

+
+
+ + % if object.company_id.street: + ${object.company_id.street}
+ % endif + % if object.company_id.street2: + ${object.company_id.street2}
+ % endif + % if object.company_id.city or object.company_id.zip: + ${object.company_id.zip} ${object.company_id.city}
+ % endif + % if object.company_id.country_id: + ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
+ % endif +
+ % if object.company_id.phone: +
+ Phone:  ${object.company_id.phone} +
+ % endif + % if object.company_id.website: + + %endif +

+
+ + ]]>
+ + % endif + | Your contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''} + +You can view the quotation and download it using the following link: + ${ctx.get('edi_web_url_view') or 'n/a'} + +If you have any question, do not hesitate to contact us. + +Thank you for choosing ${object.company_id.name}! +-- +${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''} +${object.company_id.name} +% if object.company_id.street: +${object.company_id.street or ''} +% endif +% if object.company_id.street2: +${object.company_id.street2} +% endif +% if object.company_id.city or object.company_id.zip: +${object.company_id.zip or ''} ${object.company_id.city or ''} +% endif +% if object.company_id.country_id: +${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''} +% endif +% if object.company_id.phone: +Phone: ${object.company_id.phone} +% endif +% if object.company_id.website: +${object.company_id.website or ''} +% endif + ]]> +
+
+
diff --git a/mail_quotation/sale_order_view.xml b/mail_quotation/sale_order_view.xml new file mode 100644 index 00000000000..5d4946d0a95 --- /dev/null +++ b/mail_quotation/sale_order_view.xml @@ -0,0 +1,27 @@ + + + + + + sale.order.form.mail_quotation + sale.order + + form + + + + +