<para style="P2">Partners</para>
</td>
<td>
- <para style="P8">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]] [[ formatLang(data['form']['date1'],date=True) ]]</para>
+ <para style="P8">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not Due' ]] </para>
</td>
<td>
<para style="P8">[[ data['form']['4']['name'] ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
- <para style="terp_default_8">Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]]</para>
- <para style="terp_default_8">Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]]</para>
<para style="terp_default_8">VAT : [[ o.partner_id.vat or removeParentNode('para') ]]</para>
</td>
</tr>
for i in range(5)[::-1]:
stop = start - RelativeDateTime(days=period_length)
res[str(i)] = {
- 'name' : str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length),
+ 'name' : (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))),
'stop': start.strftime('%Y-%m-%d'),
- 'start' : stop.strftime('%Y-%m-%d'),
+ 'start' : (i!=0 and stop.strftime('%Y-%m-%d') or time.strftime('01-01-1900')),
}
start = stop - RelativeDateTime(days=1)
else:
account_aged_trial_balance()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
'filter_id':fields.many2one('ir.filters', 'Filter', required=False),
'act_email_from' : fields.char('Email From', size=64, required=False,
help="Use a python expression to specify the right field on which one than we will use for the 'From' field of the header"),
+ 'act_email_to' : fields.char('Email To', size=64, required=False,
+ help="Use a python expression to specify the right field on which one than we will use for the 'To' field of the header"),
}
_defaults = {
emails += (action.act_email_cc or '').split(',')
if action.act_mail_to_email:
emails += (action.act_mail_to_email or '').split(',')
+ import pdb
+ #pdb.set_trace()
+
+ locals_for_emails = {
+ 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
+ 'obj' : obj,
+ }
+
+ if action.act_email_to:
+ emails.append(safe_eval(action.act_email_to, {}, locals_for_emails))
+
emails = filter(None, emails)
+
if len(emails) and action.act_mail_body:
emails = list(set(emails))
- email_from = safe_eval(action.act_email_from, {}, {
- 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
- 'obj' : obj,
- })
+ email_from = safe_eval(action.act_email_from, {}, locals_for_emails)
self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_from)
return True
</group>
<separator colspan="4" string="Email Information"/>
<field name="act_email_from" />
+ <field name="act_email_to" />
<field name="act_mail_to_user"/>
<field colspan="4" name="act_mail_to_email"/>
<field name="act_mail_to_watchers"/>
CREATE OR REPLACE VIEW crm_lead_report AS (
SELECT
id,
- to_char(c.create_date, 'YYYY') as name,
- to_char(c.create_date, 'MM') as month,
- to_char(c.create_date, 'YYYY-MM-DD') as day,
+ to_char(c.date_deadline, 'YYYY') as name,
+ to_char(c.date_deadline, 'MM') as month,
+ to_char(c.date_deadline, 'YYYY-MM-DD') as day,
to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.partner_id,
c.country_id,
c.planned_revenue,
- c.planned_revenue*(c.probability/100) as probable_revenue,
+ c.planned_revenue*(c.probability/100) as probable_revenue,
1 as nbr,
0 as avg_answers,
0.0 as perc_done,
import tools
from tools.translate import _
+FWD_TEMPLATE="""Hello,
+
+OpenERP Leads are now forwarded to our trusted partners, through the CRM, we hope that they provide you with interesting projects, we know that they have shown keen interest in our software.
+Below is an interesting lead for you.
+
+Please let us know about the advancements of this lead or if you are not able to answer to its requests by replying to this email. This way, we can keep track of closed leads or forward them to other partners.
+Don't forget to propose our maintenance at the beginning of your implementation projects, together with your services quotation. The maintenance provides unlimited bugfixing that will avoid you waste time on bugs detected during the implementation. It also provides free migration services for the current stable version at the time of signature; otherwise if we released a new version during your implementation, the customer would not always be able to easily migrate to newer versions.
+
+Kind regards, OpenERP Team
+
+"""
+
class crm_lead_forward_to_partner(osv.osv_memory):
"""Forwards lead history"""
_name = 'crm.lead.forward.to.partner'
res_id = context.get('active_id')
msg_val = self._get_case_history(cr, uid, history_type, res_id, context=context)
if msg_val:
- res = {'value': {'body' : '\n\n' + msg_val}}
+ res = {'value': {'body' : FWD_TEMPLATE + '\n\n' + msg_val}}
return res
def _get_case_history(self, cr, uid, history_type, res_id, context=None):
body = self._get_case_history(cr, uid, defaults.get('history', 'latest'), lead.id, context=context)
defaults.update({
'subject' : '%s: %s' % (_('Fwd'), lead.name),
- 'body' : body,
+ 'body' : FWD_TEMPLATE + '\n\n' + body,
})
return defaults
return super(document_file, self).copy(cr, uid, id, default, context)
def write(self, cr, uid, ids, vals, context=None):
+ result = False
if not isinstance(ids, list):
ids = [ids]
res = self.search(cr, uid, [('id', 'in', ids)])
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
-
<record id="base.res_groups_email_template_admin" model="res.groups">
<field name="name">Marketing / User</field>
</record>
-
</data>
</openerp>
groups="group_mrp_user,group_mrp_manager,base.group_system" sequence="8"/>
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
- <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
+ <menuitem id="menu_mrp_manufacturing" name="Manufacturing" sequence="1"/> <!-- FIXME parent="base.menu_mrp_root" sequence="1"/>-->
<menuitem name="Master Data"
id="menu_mrp_bom"
<tr>
<td>
<para style="terp_default_Bold_9">Shipping address :</para>
- <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
- <para style="terp_default_9">[[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]]</para>
+ <para style="terp_default_9">[[ o.partner_id.title.name or '' ]] [[ o.partner_id.name ]]</para>
+ <para style="terp_default_9">[[ o.partner_shipping_id.title.name or '' ]] [[ o.partner_shipping_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.street ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.street2 or '' ]]</para>
<para style="terp_default_9">[[ o.partner_shipping_id.zip or '' ]] [[ o.partner_shipping_id.city or '' ]]</para>
<font color="white"> </font>
</para>
<para style="terp_default_Bold_9">Invoice address :</para>
- <para style="terp_default_9">[[ o.partner_invoice_id.title or '' ]] [[ o.partner_invoice_id.name or '' ]]</para>
+ <para style="terp_default_9">[[ o.partner_invoice_id.title.name or '' ]] [[ o.partner_invoice_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_invoice_id.street ]] [[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]]</para>
<para style="terp_default_9">[[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]]</para>
<para style="terp_default_9">[[ o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name or '' ]][[ o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '' ]]</para>
</para>
</td>
<td>
- <para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
- <para style="terp_default_9">[[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]]</para>
+ <para style="terp_default_9">[[ o.partner_id.title.name or '' ]] [[ o.partner_id.name ]]</para>
+ <para style="terp_default_9">[[ o.partner_order_id.title.name or '' ]] [[ o.partner_order_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_order_id.street ]]</para>
<para style="terp_default_9">[[ o.partner_order_id.street2 or '' ]]</para>
<para style="terp_default_9">[[ o.partner_order_id.zip or '' ]] [[ o.partner_order_id.city or '' ]]</para>