[MERGE]
bzr revid: mra@mra-laptop-20100715032011-p7q2b4d3jrv5hklg
This commit is contained in:
@@ -42,7 +42,7 @@ write({'state':'open'})</field>
|
||||
</record>
|
||||
<record model="workflow.activity" id="act_open_test">
|
||||
<field name="wkf_id" ref="wkf"/>
|
||||
<field name="name">open</field>
|
||||
<field name="name">re-open</field>
|
||||
<field name="action">write({'state':'open'})</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
@@ -124,7 +124,15 @@ write({'state':'cancel'})</field>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">invoice_cancel</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="open_test_to_paid" model="workflow.transition">
|
||||
<field name="act_from" ref="act_open_test"/>
|
||||
<field name="act_to" ref="act_paid"/>
|
||||
<field name="trigger_model">account.move.line</field>
|
||||
<field name="trigger_expr_id">move_line_id_payment_get()</field>
|
||||
<field name="condition">test_paid()</field>
|
||||
</record>
|
||||
|
||||
<record id="draft_to_pro2" model="workflow.transition">
|
||||
<field name="act_from" ref="account.act_draft"/>
|
||||
<field name="act_to" ref="act_proforma2"/>
|
||||
|
||||
@@ -892,6 +892,7 @@ class account_invoice(osv.osv):
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name})
|
||||
self.pool.get('account.move').post(cr, uid, [move_id])
|
||||
self._log_event(cr, uid, ids)
|
||||
|
||||
return True
|
||||
|
||||
def line_get_convert(self, cr, uid, x, part, date, context=None):
|
||||
@@ -916,12 +917,12 @@ class account_invoice(osv.osv):
|
||||
}
|
||||
|
||||
def action_number(self, cr, uid, ids, *args):
|
||||
cr.execute('SELECT id, type, number, move_id, reference ' \
|
||||
'FROM account_invoice ' \
|
||||
'WHERE id IN %s',
|
||||
(tuple(ids),))
|
||||
obj_inv = self.browse(cr, uid, ids)[0]
|
||||
for (id, invtype, number, move_id, reference) in cr.fetchall():
|
||||
for obj_inv in self.browse(cr, uid, ids):
|
||||
id = obj_inv.id
|
||||
invtype = obj_inv.type
|
||||
number = obj_inv.number
|
||||
move_id = obj_inv.move_id and obj_inv.move_id.id or False
|
||||
reference = obj_inv.reference
|
||||
if not number:
|
||||
if obj_inv.journal_id.invoice_sequence_id:
|
||||
sid = obj_inv.journal_id.invoice_sequence_id.id
|
||||
@@ -946,6 +947,8 @@ class account_invoice(osv.osv):
|
||||
'WHERE account_move_line.move_id = %s ' \
|
||||
'AND account_analytic_line.move_id = account_move_line.id',
|
||||
(ref, move_id))
|
||||
message = _('Invoice ') + " '" + number + "' "+ _("is confirm")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def action_cancel(self, cr, uid, ids, *args):
|
||||
|
||||
@@ -366,6 +366,10 @@ class account_voucher(osv.osv):
|
||||
'move_id': move_id,
|
||||
'move_ids':[(6, 0,line_ids)]
|
||||
}
|
||||
|
||||
message = _('Voucher ') + " '" + inv.name + "' "+ _("is confirm")
|
||||
self.log(cr, uid, inv.id, message)
|
||||
|
||||
self.write(cr, uid, [inv.id], rec)
|
||||
|
||||
return True
|
||||
|
||||
@@ -102,6 +102,7 @@ class account_voucher(osv.osv):
|
||||
|
||||
line_ids = []
|
||||
line_ids += [move_line_pool.create(cr, uid, move_line)]
|
||||
rec_ids = []
|
||||
for line in inv.payment_ids:
|
||||
amount=0.0
|
||||
move_line = {
|
||||
@@ -147,16 +148,23 @@ class account_voucher(osv.osv):
|
||||
line_ids += [move_line_id]
|
||||
|
||||
if line.invoice_id:
|
||||
rec_ids = [move_line_id]
|
||||
rec_ids += [move_line_id]
|
||||
for move_line in line.invoice_id.move_id.line_id:
|
||||
if line.account_id.id == move_line.account_id.id:
|
||||
rec_ids += [move_line.id]
|
||||
move_line_pool.reconcile_partial(cr, uid, rec_ids)
|
||||
#move_line_pool.reconcile_partial(cr, uid, rec_ids)
|
||||
|
||||
if rec_ids:
|
||||
move_line_pool.reconcile_partial(cr, uid, rec_ids)
|
||||
|
||||
rec = {
|
||||
'move_id': move_id,
|
||||
'move_ids':[(6, 0,line_ids)]
|
||||
}
|
||||
|
||||
message = _('Voucher ') + " '" + inv.name + "' "+ _("is confirm")
|
||||
self.log(cr, uid, inv.id, message)
|
||||
|
||||
self.write(cr, uid, [inv.id], rec)
|
||||
|
||||
return True
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
<tree string="Functions and Addresses">
|
||||
<field name="sequence_contact" string="Seq."/>
|
||||
<field name="function"/>
|
||||
<field name="name"/>
|
||||
<field name="address_id"/>
|
||||
<field name="name" on_change="onchange_partner(name)"/>
|
||||
<field name="address_id" attrs="{'required': [('name', '!=', False)]}" on_change="onchange_address(address_id)"/>
|
||||
<field name="phone"/>
|
||||
<field name="fax"/>
|
||||
<field name="extension"/>
|
||||
|
||||
@@ -154,6 +154,8 @@ and users"),
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('history', '=', True),('model','=',_name)], readonly=True),
|
||||
'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)], readonly=True),
|
||||
'partner_assigned_id': fields.many2one('res.partner', 'Assigned Partner', help="Partner this case has been forwarded/assigned to.", select=True),
|
||||
'date_assign': fields.date('Assignation Date', help="Last date this case was forwarded/assigned to a partner"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -193,11 +193,10 @@
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.lead'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<button colspan="2" string="Forward to Partner"
|
||||
<button colspan="2" string="Forward"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -190,6 +190,21 @@
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Assignation" groups="base.group_extended">
|
||||
<group name="partner_assign_group" col="5" colspan="4">
|
||||
<separator string="Partner Assignation" colspan="5"/>
|
||||
<field name="partner_assigned_id"/>
|
||||
<field name="date_assign"/>
|
||||
<group colspan="1" col="1">
|
||||
<button string="Forward"
|
||||
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="gtk-go-forward" type="action"
|
||||
context="{'default_name': 'partner', 'default_partner_id': partner_assigned_id}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -26,11 +26,13 @@ class res_partner(osv.osv):
|
||||
_inherit = 'res.partner'
|
||||
_columns = {
|
||||
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
|
||||
'Leads and Opportunities'),
|
||||
'Leads and Opportunities'),
|
||||
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
|
||||
'Meetings'),
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
|
||||
'Phonecalls'),
|
||||
'Phonecalls'),
|
||||
'opportunity_assigned_ids': fields.one2many('crm.lead', 'partner_assigned_id',\
|
||||
'Assigned Opportunities'),
|
||||
}
|
||||
res_partner()
|
||||
|
||||
|
||||
@@ -44,6 +44,39 @@
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
<field name="opportunity_assigned_ids" colspan="4" nolabel="1">
|
||||
<tree string="Assigned Opportunities" colors="blue:state=='pending';grey:state=='cancel')">
|
||||
<field name="create_date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="stage_id"/>
|
||||
<button name="stage_previous" string="Previous"
|
||||
states="open,pending" type="object" icon="gtk-go-back" />
|
||||
<button name="stage_next" string="Next"
|
||||
states="open,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<field name="section_id"
|
||||
invisible="context.get('invisible_section', True)" />
|
||||
<field name="user_id" />
|
||||
<field name="state" />
|
||||
<button name="case_open" string="Open"
|
||||
states="draft,pending" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
<button name="case_close" string="Close"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-close" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="convert_opportunity"
|
||||
states="draft,open,pending" icon="gtk-index"
|
||||
type="object" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
states="open,draft,pending" type="object"
|
||||
icon="gtk-go-up" />
|
||||
<button name="case_cancel" string="Cancel"
|
||||
states="draft,open,pending" type="object"
|
||||
icon="gtk-cancel" />
|
||||
</tree>
|
||||
</field>
|
||||
<field name="meeting_ids" colspan="4" nolabel="1" >
|
||||
<tree string="Meetings" colors="gray:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="user_id" string="Responsible"/>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
import base64
|
||||
import itertools
|
||||
import time
|
||||
|
||||
from osv import osv, fields
|
||||
import tools
|
||||
@@ -218,6 +219,10 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
|
||||
if result:
|
||||
case_pool.history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, subject=this.subject, details=body, email_from=email_from, attach=attach)
|
||||
to_write = {'date_assign': time.strftime('%Y-%m-%d')}
|
||||
if (this.name == 'partner' and this.partner_id):
|
||||
to_write['partner_assigned_id'] = this.partner_id.id
|
||||
case_pool.write(cr, uid, case.id, to_write)
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<form string="Create a Partner">
|
||||
<field name="action"/>
|
||||
<group attrs="{'invisible':[('action','!=','exist')]}">
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_id" attrs="{'required':[('action','=','exist')]}" />
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group col="4" colspan="4">
|
||||
|
||||
+55
-60
@@ -118,7 +118,7 @@
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table11">
|
||||
<blockTableStyle id="Table8">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
@@ -126,7 +126,7 @@
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table12">
|
||||
<blockTableStyle id="Table9">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
@@ -135,7 +135,7 @@
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table13">
|
||||
<blockTableStyle id="Table10">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
@@ -185,14 +185,8 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_header">Production Order N° : [[ o.name ]]</para>
|
||||
<para style="terp_default_space">
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="193.0,83.0,122.0,129.0" style="Table3">
|
||||
@@ -264,11 +258,11 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="terp_default_Bold_8">
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Bold_8">Work Orders</para>
|
||||
<para style="terp_default_Bold_8">
|
||||
<para style="terp_default_Bold_8">Work Orders <font face="Helvetica" size="10.0">[[ o.workcenter_lines ==[] and removeParentNode('para')]]</font></para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="74.0,203.0,121.0,66.0,64.0" style="Table6">
|
||||
@@ -277,7 +271,7 @@
|
||||
<para style="terp_tblheader_General_Centre">Sequence</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Name </para>
|
||||
<para style="terp_tblheader_Details_Centre">Name <font face="Helvetica" size="10.0">[[ o.workcenter_lines ==[] and removeParentNode('blockTable')]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">WorkCenter</para>
|
||||
@@ -322,12 +316,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_Bold_9">Consumed Products [[ o.move_lines2 ==[] and removeParentNode('para')]]</para>
|
||||
<para style="terp_default_Bold_9">Products to Consume [[ o.move_lines ==[] and removeParentNode('para')]]</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="250.0,66.0,107.0,104.0" style="Table11">
|
||||
<blockTable colWidths="250.0,66.0,107.0,104.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Product </para>
|
||||
@@ -344,48 +333,54 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.move_lines,'line') ]]</para>
|
||||
<blockTable colWidths="250.0,42.0,23.0,109.0,104.0" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.product_id.code ]] [[ line.product_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang( line.product_qty) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[line.product_uom.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line.location_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line.location_dest_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_Bold_9">Products to Consume [[ o.move_lines ==[] and removeParentNode('section')]]</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.move_lines,'line') ]]</para>
|
||||
<blockTable colWidths="250.0,42.0,23.0,109.0,104.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line.product_id.code ]] [[ line.product_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang( line.product_qty) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[line.product_uom.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line.location_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line.location_dest_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.move_lines2,'line2') ]]</para>
|
||||
<blockTable colWidths="251.0,41.0,23.0,109.0,104.0" style="Table13">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line2.product_id.code ]] [[ line2.product_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang( line2.product_qty) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[line2.product_uom.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line2.location_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line2.location_dest_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_Bold_9">Consumed Products [[ o.move_lines2 ==[] and removeParentNode('section')]]</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.move_lines2,'line2') ]]</para>
|
||||
<blockTable colWidths="251.0,41.0,23.0,109.0,104.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line2.product_id.code ]] [[ line2.product_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang( line2.product_qty) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[line2.product_uom.name]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line2.location_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line2.location_dest_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
'category': 'Generic Modules/Production',
|
||||
'description': """
|
||||
This is the module used by OpenERP SA to redirect customers to his partners,
|
||||
based on geolocalisation.
|
||||
based on geolocalization.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['crm'],
|
||||
'update_xml': ['res_partner_view.xml'],
|
||||
'demo_xml': [],
|
||||
'data': [
|
||||
'res_partner_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': False,
|
||||
|
||||
@@ -39,14 +39,14 @@ def geo_find(addr):
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Network error'),
|
||||
_('Could not contact geolocation servers, please make sure you have a working internet connection (%s)') % e)
|
||||
|
||||
|
||||
|
||||
class res_partner(osv.osv):
|
||||
_inherit = "res.partner"
|
||||
_columns = {
|
||||
'partner_latitude': fields.float('Geo Latitude'),
|
||||
'partner_longitude': fields.float('Geo Longitude'),
|
||||
'date_assign': fields.date('Assignation Date'),
|
||||
'date_localization': fields.date('Geo Localization Date'),
|
||||
'partner_weight': fields.integer('Weight',
|
||||
help="Gives the probability to assign a lead to this partner. (0 means no assignation.)"),
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class res_partner(osv.osv):
|
||||
self.write(cr, uid, [partner.id], {
|
||||
'partner_latitude': result[0],
|
||||
'partner_longitude': result[1],
|
||||
'date_assign': time.strftime('%Y-%m-%d')
|
||||
'date_localization': time.strftime('%Y-%m-%d')
|
||||
}, context=context)
|
||||
return True
|
||||
res_partner()
|
||||
@@ -74,33 +74,7 @@ class crm_lead(osv.osv):
|
||||
_columns = {
|
||||
'partner_latitude': fields.float('Geo Latitude'),
|
||||
'partner_longitude': fields.float('Geo Longitude'),
|
||||
'partner_assigned_id': fields.many2one('res.partner','Assigned Partner'),
|
||||
'date_assign': fields.date('Assignation Date')
|
||||
}
|
||||
def forward_to_partner(self, cr, uid, ids, context=None):
|
||||
fobj = self.pool.get('crm.lead.forward.to.partner')
|
||||
for lead in self.browse(cr, uid, ids, context=context):
|
||||
context = {'active_id': lead.id, 'active_ids': [lead.id], 'active_model': 'crm.lead'}
|
||||
if lead.partner_assigned_id:
|
||||
email = False
|
||||
if lead.partner_assigned_id.address:
|
||||
email = lead.partner_assigned_id.address[0].email
|
||||
if not email:
|
||||
raise osv.except_osv(_('Error !'), _('No email on the partner assigned to this opportunity'))
|
||||
|
||||
values = fobj.default_get(cr, uid, ['name', 'email_from'], context=context)
|
||||
if not values.get('email_from'):
|
||||
raise osv.except_osv(_('Error !'), _('Please set an email address in your user preferences'))
|
||||
values.update({
|
||||
'history': 'whole',
|
||||
'email_to': email,
|
||||
'message': fobj._get_case_history(cr, uid, 'whole', lead.id, context) or False,
|
||||
})
|
||||
forward = fobj.create(cr, uid, values, context)
|
||||
fobj.action_forward(cr, uid, [forward], context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('No partner assigned to this opportunity'))
|
||||
return True
|
||||
|
||||
def assign_partner(self, cr, uid, ids, context=None):
|
||||
ok = False
|
||||
|
||||
@@ -1,33 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_crm_opportunity_geo_assign_form" model="ir.ui.view">
|
||||
<field name="name">crm.lead.geo_assign.inherit</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Geo Assignation">
|
||||
<field name="partner_assigned_id"/>
|
||||
<newline/>
|
||||
<field name="partner_latitude"/>
|
||||
<field name="partner_longitude"/>
|
||||
<field name="date_assign"/>
|
||||
<label string="" colspan="1"/>
|
||||
<group colspan="1" col="2">
|
||||
<button string="Geo Assign" name="assign_partner" type="object" colspan="1"
|
||||
icon="gtk-apply"/>
|
||||
<button string="Forward"
|
||||
name="forward_to_partner" attrs="{'invisible':[('partner_assigned_id','=',False)]}"
|
||||
icon="gtk-apply"
|
||||
type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_crm_partner_geo_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.geo.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
@@ -35,7 +8,7 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Geo Location">
|
||||
<page string="Geo Localization">
|
||||
<field name="partner_weight"/>
|
||||
<label string="" colspan="1"/>
|
||||
<button
|
||||
@@ -46,11 +19,10 @@
|
||||
<newline/>
|
||||
<field name="partner_latitude"/>
|
||||
<field name="partner_longitude"/>
|
||||
<field name="date_assign"/>
|
||||
<field name="date_localization"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user