[MERGE] merge with main branch
bzr revid: mra@mra-laptop-20100715102334-ntl341dzrs8o4a1h
This commit is contained in:
@@ -38,10 +38,11 @@ class account_journal_select(osv.osv_memory):
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
|
||||
result = act_obj.read(cr, uid, [id])[0]
|
||||
cr.execute('select journal_id, period_id from account_journal_period where id=%s', (context['active_id'],))
|
||||
journal_id, period_id = cr.fetchone()
|
||||
|
||||
result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
|
||||
result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
journal_id, period_id = res
|
||||
result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
|
||||
result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'base_contact_view.xml',
|
||||
# 'base_contact_installer_view.xml',
|
||||
'base_contact_installer_view.xml',
|
||||
'process/base_contact_process.xml'
|
||||
],
|
||||
'demo_xml': ['base_contact_demo.xml'],
|
||||
|
||||
@@ -83,8 +83,8 @@ Create dashboard for CRM that includes:
|
||||
'wizard/crm_opportunity_to_phonecall_view.xml',
|
||||
'wizard/crm_partner_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_forward_to_partner_view.xml',
|
||||
'wizard/crm_send_email_view.xml',
|
||||
'wizard/crm_forward_to_partner_view.xml',
|
||||
'wizard/crm_custom_create_menu_view.xml',
|
||||
|
||||
'crm_view.xml',
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import base64
|
||||
import itertools
|
||||
import time
|
||||
|
||||
import re
|
||||
from osv import osv, fields
|
||||
import tools
|
||||
from tools.translate import _
|
||||
@@ -31,6 +31,7 @@ from tools.translate import _
|
||||
class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
"""Forwards lead history"""
|
||||
_name = 'crm.lead.forward.to.partner'
|
||||
_inherit = "crm.send.mail"
|
||||
|
||||
_columns = {
|
||||
'name': fields.selection([('user', 'User'), ('partner', 'Partner'), \
|
||||
@@ -38,19 +39,12 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
'user_id': fields.many2one('res.users', "User"),
|
||||
'partner_id' : fields.many2one('res.partner', 'Partner'),
|
||||
'address_id' : fields.many2one('res.partner.address', 'Address'),
|
||||
'email_from' : fields.char('From', required=True, size=128),
|
||||
'email_to' : fields.char('To', required=True, size=128),
|
||||
'subject' : fields.char('Subject', required=True, size=128),
|
||||
'message' : fields.text('Message', required=True),
|
||||
'history': fields.selection([('latest', 'Latest email'), ('whole', 'Whole Story'), ('info', 'Case Information')], 'Send history', required=True),
|
||||
'add_cc': fields.boolean('Add as CC', required=False, help="Check this box if you want this address to be added in the CC list"\
|
||||
" for this case, in order to receive all future conversations"),
|
||||
'history': fields.selection([('info', 'Case Information'), ('latest', 'Latest email'), ('whole', 'Whole Story')], 'Send history', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'name' : 'email',
|
||||
'history': 'info',
|
||||
'add_cc': True,
|
||||
'history': 'latest',
|
||||
'email_from': lambda self, cr, uid, *a: self.pool.get('res.users')._get_email_from(cr, uid, uid)[uid]
|
||||
}
|
||||
|
||||
@@ -117,7 +111,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
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': {'message' : '\n\n' + msg_val}}
|
||||
res = {'value': {'body' : '\n\n' + msg_val}}
|
||||
return res
|
||||
|
||||
def _get_case_history(self, cr, uid, history_type, res_id, context=None):
|
||||
@@ -125,22 +119,23 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
return
|
||||
|
||||
msg_val = ''
|
||||
case_info = self.get_lead_details(cr, uid, res_id, context=context)
|
||||
model_pool = self.pool.get('crm.lead')
|
||||
|
||||
if history_type == 'info':
|
||||
msg_val = self.get_lead_details(cr, uid, res_id, context=context)
|
||||
msg_val = case_info
|
||||
|
||||
elif history_type == 'whole':
|
||||
log_ids = model_pool.browse(cr, uid, res_id, context=context).message_ids
|
||||
log_ids = [x.id for x in log_ids]
|
||||
if not log_ids:
|
||||
raise osv.except_osv('Warning!', 'There is no history to send')
|
||||
msg_val = self.get_whole_history(cr, uid, log_ids, context=context)
|
||||
msg_val = case_info + '\n\n' + self.get_whole_history(cr, uid, log_ids, context=context)
|
||||
|
||||
elif history_type == 'latest':
|
||||
log_ids = model_pool.browse(cr, uid, res_id, context=context).message_ids
|
||||
if not log_ids:
|
||||
raise osv.except_osv('Warning!', 'There is no history to send')
|
||||
msg_val = self.get_latest_history(cr, uid, log_ids[0].id, context=context)
|
||||
msg_val = case_info
|
||||
else:
|
||||
msg_val = case_info + '\n\n' + self.get_latest_history(cr, uid, log_ids[0].id, context=context)
|
||||
|
||||
return msg_val
|
||||
|
||||
@@ -186,13 +181,14 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
if not res_id or not model:
|
||||
return {}
|
||||
|
||||
email_re = r'([^ ,<@]+@[^> ,]+)'
|
||||
this = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
case_pool = self.pool.get(model)
|
||||
case = case_pool.browse(cr, uid, res_id, context=context)
|
||||
|
||||
emails = [this.email_to]
|
||||
body = case_pool.format_body(this.message)
|
||||
body = case_pool.format_body(this.body)
|
||||
email_from = this.email_from or False
|
||||
|
||||
# extract attachements from case and emails according to mode
|
||||
@@ -226,13 +222,19 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
|
||||
|
||||
if this.add_cc and (not case.email_cc or not this.email_to in case.email_cc):
|
||||
case_pool.write(cr, uid, case.id, {'email_cc' : case.email_cc and case.email_cc + ', ' + this.email_to or this.email_to})
|
||||
email_cc = re.findall(email_re, case.email_cc or '')
|
||||
new_cc = ''
|
||||
for to in this.email_to.split(','):
|
||||
email_to = re.findall(email_re, to)
|
||||
email_to = email_to and email_to[0] or ''
|
||||
if email_to not in email_cc:
|
||||
new_cc += ', ' + to
|
||||
case_pool.write(cr, uid, case.id, {'email_cc' : case.email_cc and case.email_cc + new_cc})
|
||||
|
||||
return {}
|
||||
|
||||
def get_lead_details(self, cr, uid, lead_id, context=None):
|
||||
message = []
|
||||
body = []
|
||||
lead_proxy = self.pool.get('crm.lead')
|
||||
lead = lead_proxy.browse(cr, uid, lead_id, context=context)
|
||||
if not lead.type or lead.type == 'lead':
|
||||
@@ -258,10 +260,10 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
else:
|
||||
value = lead[field_name]
|
||||
|
||||
message.append("%s: %s" % (field_definition.string, value or ''))
|
||||
body.append("%s: %s" % (field_definition.string, value or ''))
|
||||
elif lead.type == 'opportunity':
|
||||
pa = lead.partner_address_id
|
||||
message = [
|
||||
body = [
|
||||
"Partner: %s" % (lead.partner_id.name_get()[0][1]),
|
||||
"Contact: %s" % (pa.name or ''),
|
||||
"Title: %s" % (pa.title or ''),
|
||||
@@ -277,7 +279,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
"Fax: %s" % (pa.fax or ''),
|
||||
"Mobile: %s" % (pa.mobile or ''),
|
||||
]
|
||||
return "\n".join(message + ['---'])
|
||||
return "\n".join(body + ['---'])
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
@@ -295,10 +297,10 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
lead_proxy = self.pool.get('crm.lead')
|
||||
lead = lead_proxy.browse(cr, uid, active_id, context=context)
|
||||
|
||||
message = self._get_case_history(cr, uid, defaults.get('history', 'latest'), lead.id, context=context)
|
||||
body = self._get_case_history(cr, uid, defaults.get('history', 'latest'), lead.id, context=context)
|
||||
defaults.update({
|
||||
'subject' : '%s: %s' % (_('Fwd'), lead.name),
|
||||
'message' : message,
|
||||
'body' : body,
|
||||
})
|
||||
return defaults
|
||||
|
||||
|
||||
@@ -5,41 +5,45 @@
|
||||
<field name="name">crm_lead_forward_to_partner</field>
|
||||
<field name="model">crm.lead.forward.to.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="crm_send_new_mail_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Forward to Partner">
|
||||
<separator string="Sender" colspan="4" />
|
||||
<field name="email_from" colspan="2" />
|
||||
<field name="history" colspan="2" on_change="on_change_history(history, context)"/>
|
||||
<separator string="Recipient" colspan="4" />
|
||||
<field name="name" colspan="2" />
|
||||
<group col="2" colspan="2" attrs="{ 'invisible' : [('name','!=','user')]}">
|
||||
<field name="user_id"
|
||||
attrs="{ 'required' : [('name','=','user')]}"
|
||||
on_change="on_change_email(user_id)" />
|
||||
<field name="email_from" position="before">
|
||||
<separator string="Forward to Partner" colspan="4" />
|
||||
<group col="4" colspan="6">
|
||||
<field name="history" colspan="2" on_change="on_change_history(history, context)"/>
|
||||
<field name="name" colspan="2" />
|
||||
<group col="2" colspan="2" attrs="{ 'invisible' : [('name','!=','user')]}">
|
||||
<field name="user_id"
|
||||
attrs="{ 'required' : [('name','=','user')]}"
|
||||
on_change="on_change_email(user_id)" />
|
||||
</group>
|
||||
<group col="4" colspan="4" attrs="{'invisible' : [('name','!=','partner')]}">
|
||||
<field name="partner_id" attrs="{'required' : [('name','=','partner')]}" on_change="on_change_partner(partner_id)" colspan="2" />
|
||||
<field name="address_id" string="Contact" on_change="on_change_address(address_id)" colspan="2" />
|
||||
</group>
|
||||
</group>
|
||||
<group col="4" colspan="4" attrs="{'invisible' : [('name','!=','partner')]}">
|
||||
<field name="partner_id" attrs="{'required' : [('name','=','partner')]}" on_change="on_change_partner(partner_id)" colspan="2" />
|
||||
<field name="address_id" string="Contact" on_change="on_change_address(address_id)" colspan="2" />
|
||||
</group>
|
||||
<field colspan="2" name="email_to" attrs="{ 'required' : [('name','=','email')]}" />
|
||||
<field name="add_cc"/>
|
||||
<separator string="Message" colspan="4" />
|
||||
<field name="subject" colspan="4" />
|
||||
<field name="message" colspan="4" nolabel="1"/>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="2">
|
||||
<button name="action_cancel" special="cancel" string="Cancel" icon="gtk-cancel" type="object" />
|
||||
<button name="action_forward" string="Forward" icon="gtk-go-forward" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="crm_lead_forward_to_partner_form1">
|
||||
<field name="name">crm_lead_forward_to_partner1</field>
|
||||
<field name="model">crm.lead.forward.to.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="crm_send_new_mail_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_send" position="replace">
|
||||
<button name="action_forward" string="Forward" icon="gtk-go-forward" type="object" />
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="crm_lead_forward_to_partner_act">
|
||||
<field name="name">Forward to Partner</field>
|
||||
<field name="res_model">crm.lead.forward.to.partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="crm_lead_forward_to_partner_form1"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
'email_cc' : fields.char('CC', size=512, help="Carbon Copy: list of recipients that will receive"\
|
||||
" a copy of this mail, and future communication related to this case"),
|
||||
'subject': fields.char('Subject', size=512, required=True),
|
||||
'text': fields.text('Message', required=True),
|
||||
'body': fields.text('Message Body', required=True),
|
||||
'state': fields.selection(crm.AVAILABLE_STATES, string='Set New State To', required=True),
|
||||
'attachment_ids' : fields.one2many('crm.send.mail.attachment', 'wizard_id'),
|
||||
}
|
||||
@@ -68,10 +68,10 @@ class crm_send_new_email(osv.osv_memory):
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
if not context.get('model'):
|
||||
if not context.get('active_model'):
|
||||
raise osv.except_osv(_('Error'), _('Can not send mail!'))
|
||||
|
||||
model = context.get('model')
|
||||
model = context.get('active_model')
|
||||
case_pool = self.pool.get(model)
|
||||
res_id = context and context.get('active_id', False) or False
|
||||
|
||||
@@ -91,16 +91,16 @@ class crm_send_new_email(osv.osv_memory):
|
||||
hist = hist_obj.browse(cr, uid, res_id)
|
||||
message_id = hist.message_id
|
||||
model = hist.model
|
||||
model_pool = self.pool.get(model)
|
||||
case_pool = self.pool.get(model)
|
||||
res_id = hist.res_id
|
||||
ref_id = hist.ref_id
|
||||
case = model_pool.browse(cr, uid, res_id)
|
||||
case = case_pool.browse(cr, uid, res_id)
|
||||
emails = [obj.email_to]
|
||||
email_cc = obj.email_cc and obj.email_cc.split(',') or ''
|
||||
emails = filter(None, emails)
|
||||
body = obj.text
|
||||
body = obj.body
|
||||
|
||||
body = case_pool.format_body(body)
|
||||
body = body and tools.ustr(body) or ''
|
||||
email_from = getattr(obj, 'email_from', False)
|
||||
x_headers = {}
|
||||
if message_id:
|
||||
@@ -124,7 +124,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
case_pool.history(cr, uid, [case], _('Send'), history=True, \
|
||||
email=obj.email_to, details=body, \
|
||||
subject=obj.subject, email_from=email_from, \
|
||||
email_cc=email_cc, message_id=message_id, \
|
||||
email_cc=', '.join(email_cc), message_id=message_id, \
|
||||
references=ref_id or message_id, attach=attach)
|
||||
if obj.state == 'unchanged':
|
||||
pass
|
||||
@@ -145,7 +145,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
if not context.get('model'):
|
||||
if not context.get('active_model'):
|
||||
raise osv.except_osv(_('Error'), _('Can not send mail!'))
|
||||
|
||||
res = super(crm_send_new_email, self).default_get(cr, uid, fields, context=context)
|
||||
@@ -154,7 +154,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
res.update(self.get_reply_defaults(cr, uid, fields, context=context))
|
||||
return res
|
||||
|
||||
model = context.get('model')
|
||||
model = context.get('active_model')
|
||||
mod_obj = self.pool.get(model)
|
||||
res_id = context and context.get('active_ids', []) or []
|
||||
|
||||
@@ -172,8 +172,8 @@ class crm_send_new_email(osv.osv_memory):
|
||||
res.update({'subject': tools.ustr(context.get('subject', case.name) or '')})
|
||||
if 'email_cc' in fields:
|
||||
res.update({'email_cc': tools.ustr(case.email_cc or '')})
|
||||
if 'text' in fields:
|
||||
res.update({'text': u'\n'+(tools.ustr(case.user_id.signature or ''))})
|
||||
if 'body' in fields:
|
||||
res.update({'body': u'\n'+(tools.ustr(case.user_id.signature or ''))})
|
||||
if 'state' in fields:
|
||||
res.update({'state': u'pending'})
|
||||
|
||||
@@ -209,7 +209,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
signature = u'\n' + (tools.ustr(case.user_id.signature or '')) + u'\n'
|
||||
original = [signature]
|
||||
|
||||
if include_original == True and 'text' in fields:
|
||||
if include_original == True and 'body' in fields:
|
||||
header = u'-------- Original Message --------'
|
||||
sender = u'From: %s' %(tools.ustr(hist.email_from or ''))
|
||||
to = u'To: %s' % (tools.ustr(hist.email_to or ''))
|
||||
@@ -218,10 +218,14 @@ class crm_send_new_email(osv.osv_memory):
|
||||
|
||||
original = [signature, header, sender, to, sentdate, desc]
|
||||
|
||||
res['text']= u'\n' + u'\n'.join(original)
|
||||
res['body']= u'\n' + u'\n'.join(original)
|
||||
|
||||
if 'subject' in fields:
|
||||
res.update({u'subject': u'Re: %s' %(tools.ustr(hist.name or ''))})
|
||||
if 'email_cc' in fields:
|
||||
res.update({'email_cc': case.email_cc and tools.ustr(case.email_cc) or False})
|
||||
if 'reply_to' in fields:
|
||||
res.update({'reply_to': case.section_id.reply_to})
|
||||
if 'state' in fields:
|
||||
res['state'] = u'pending'
|
||||
return res
|
||||
@@ -239,7 +243,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
if not context.get('model'):
|
||||
if not context.get('active_model'):
|
||||
raise osv.except_osv(_('Error'), _('Can not send mail!'))
|
||||
return True
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="model">crm.send.mail</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Send New Mail" col="4">
|
||||
<form string="Send Mail" col="4">
|
||||
<group colspan="4" col="2">
|
||||
<field name="email_from"/>
|
||||
<field name="reply_to"/>
|
||||
@@ -19,7 +19,7 @@
|
||||
</group>
|
||||
<notebook colspan="6">
|
||||
<page string="Message">
|
||||
<field name="text" nolabel="1" colspan="4" default_focus="1"/>
|
||||
<field name="body" nolabel="1" colspan="4" default_focus="1"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" nolabel="1">
|
||||
@@ -46,7 +46,7 @@
|
||||
<!-- Send New Mail action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_crm_send_mail">
|
||||
<field name="name">Send New Mail</field>
|
||||
<field name="name">Send Mail</field>
|
||||
<field name="res_model">crm.send.mail</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
@@ -77,7 +77,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
<separator string="" colspan="4"/>
|
||||
<field name="text" nolabel="1" colspan="4"/>
|
||||
<field name="body" nolabel="1" colspan="4"/>
|
||||
<separator string=" " colspan="4"/>
|
||||
<group colspan="4" col="3" >
|
||||
<label string=" " />
|
||||
|
||||
@@ -11,12 +11,19 @@
|
||||
<form position="attributes">
|
||||
<attribute name="string">Configure Calendars for CRM Sections</attribute>
|
||||
</form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<label colspan="4" align="0.0"
|
||||
string="OpenERP can create and pre-configure a series of integrated calendar for you."/>
|
||||
<separator string="Create Pre-Configured Calendars"
|
||||
colspan="4"/>
|
||||
<newline/>
|
||||
<separator string="title" position="attributes">
|
||||
<attribute name="string"
|
||||
>Create Pre-Configured Calendars</attribute>
|
||||
</separator>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">OpenERP can create and pre-configure a series of integrated calendar for you.</attribute>
|
||||
<attribute name="width">200</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='rowspan'>15</attribute>
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<field name="meeting"/>
|
||||
<field name="opportunity"/>
|
||||
<field name="phonecall"/>
|
||||
@@ -27,8 +34,6 @@
|
||||
<field name="jobs"/>
|
||||
<field name="fund"/>
|
||||
</group>
|
||||
<xpath expr='//button[@name="action_skip"]'
|
||||
position='replace'/>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
@@ -43,7 +48,7 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
register configuration wizard
|
||||
<record id="config_wizard_step_case_section_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_view_document_ics_config_directories"/>
|
||||
</record>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2">
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="To Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no"/>
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel"/>
|
||||
|
||||
@@ -17,13 +17,33 @@
|
||||
<field name="name"/>
|
||||
<field name="project_id"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="planned_hours"/>
|
||||
<field name="effective_hours"/>
|
||||
<field name="priority"/>
|
||||
<field name="planned_hours" widget="float_time"/>
|
||||
<field name="effective_hours" widget="float_time"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_delegated_task_tree" model="ir.ui.view">
|
||||
<field name="name">project.task.delegated.tree</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">tree</field>
|
||||
<field eval="99" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:date_deadline<current_date;blue:date_deadline==current_date;black:date_deadline>current_date" string="My Delegated Tasks">
|
||||
<field name="user_id"/>
|
||||
<field name="name"/>
|
||||
<field name="project_id"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="total_hours" widget="float_time"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="type_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_view_task_tree" model="ir.actions.act_window">
|
||||
<field name="name">My Open Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
@@ -38,8 +58,8 @@
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">['|',('parent_ids.user_id','=',uid),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="project.view_task_tree2"/>
|
||||
<field name="domain">[('parent_ids.user_id','=',uid),('state', 'in', ('draft','open','pending'))]</field>
|
||||
<field name="view_id" ref="view_delegated_task_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="action_view_task_tree_deadline" model="ir.actions.act_window">
|
||||
|
||||
+10
-10
@@ -359,7 +359,7 @@ class task(osv.osv):
|
||||
'description': fields.text('Description'),
|
||||
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
|
||||
'type': fields.many2one('project.task.type', 'Stage',),
|
||||
'type_id': fields.many2one('project.task.type', 'Stage',),
|
||||
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
|
||||
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
|
||||
\n If the task is over, the states is set to \'Done\'.'),
|
||||
@@ -549,25 +549,25 @@ class task(osv.osv):
|
||||
return True
|
||||
|
||||
def next_type(self, cr, uid, ids, *args):
|
||||
for typ in self.browse(cr, uid, ids):
|
||||
typeid = typ.type.id
|
||||
types = map(lambda x:x.id, typ.project_id.type_ids or [])
|
||||
for task in self.browse(cr, uid, ids):
|
||||
typeid = task.type_id.id
|
||||
types = map(lambda x:x.id, task.project_id.type_ids or [])
|
||||
if types:
|
||||
if not typeid:
|
||||
self.write(cr, uid, typ.id, {'type': types[0]})
|
||||
self.write(cr, uid, task.id, {'type_id': types[0]})
|
||||
elif typeid and typeid in types and types.index(typeid) != len(types)-1 :
|
||||
index = types.index(typeid)
|
||||
self.write(cr, uid, typ.id, {'type': types[index+1]})
|
||||
self.write(cr, uid, task.id, {'type_id': types[index+1]})
|
||||
return True
|
||||
|
||||
def prev_type(self, cr, uid, ids, *args):
|
||||
for typ in self.browse(cr, uid, ids):
|
||||
typeid = typ.type.id
|
||||
types = map(lambda x:x.id, typ.project_id.type_ids)
|
||||
for task in self.browse(cr, uid, ids):
|
||||
typeid = task.type_id.id
|
||||
types = map(lambda x:x.id, task.project_id.type_ids)
|
||||
if types:
|
||||
if typeid and typeid in types:
|
||||
index = types.index(typeid)
|
||||
self.write(cr, uid, typ.id, {'type': index and types[index-1] or False})
|
||||
self.write(cr, uid, task.id, {'type_id': index and types[index-1] or False})
|
||||
return True
|
||||
|
||||
task()
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
<field name="partner_id"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
|
||||
<group col="4" colspan="2">
|
||||
<field name="type" widget="selection" readonly="1"/>
|
||||
<field name="type_id" widget="selection" readonly="1"/>
|
||||
<button name="prev_type" string="Previous" type="object" icon="gtk-go-back" help="Change to Previous Stage"/>
|
||||
<button name="next_type" string="Next" type="object" icon="gtk-go-forward" help="Change to Next Stage"/>
|
||||
</group>
|
||||
@@ -354,7 +354,7 @@
|
||||
icon="gtk-go-forward"
|
||||
groups="base.group_extended"
|
||||
help="Change Type"/>
|
||||
<field name="type" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
|
||||
<field name="type_id" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
|
||||
<field name="date_start" invisible="1"/>
|
||||
<field name="date_end" invisible="1"/>
|
||||
<field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
|
||||
@@ -441,7 +441,7 @@
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="Users" name="group_user_id" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Project" name="group_project_id" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'type'}"/>
|
||||
<filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="State" name="group_state" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Deadline" icon="terp-gnome-cpu-frequency-applet+" domain="[]" context="{'group_by':'date_deadline'}"/>
|
||||
@@ -659,4 +659,4 @@
|
||||
<act_window domain="[('project_id', '=', active_id)]" id="act_project_messages" name="Messages" res_model="project.message" src_model="project.project"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -83,7 +83,7 @@ class report_project_task_user(osv.osv):
|
||||
t.name as name,
|
||||
t.company_id,
|
||||
t.partner_id,
|
||||
t.type,
|
||||
t.type_id,
|
||||
remaining_hours as remaining_hours,
|
||||
total_hours as total_hours,
|
||||
t.delay_hours as hours_delay,
|
||||
@@ -115,7 +115,7 @@ class report_project_task_user(osv.osv):
|
||||
name,
|
||||
t.company_id,
|
||||
t.partner_id,
|
||||
t.type
|
||||
t.type_id
|
||||
|
||||
""")
|
||||
|
||||
|
||||
@@ -39,18 +39,18 @@
|
||||
<field name="name">Long Term</field>
|
||||
<field name="icon">terp-project</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="project.project_task_116" model="project.task">
|
||||
<field name="planned_hours">38.0</field>
|
||||
<field name="remaining_hours">38.0</field>
|
||||
<field name="timebox_id" ref="timebox_daily"/>
|
||||
<field name="context_id" ref="context_office"/>
|
||||
<field name="type" ref="project.project_tt_development"/>
|
||||
<field name="type_id" ref="project.project_tt_development"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="project_id" ref="project.project_project_22"/>
|
||||
<field name="name">Specific adaptation to MRP</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="project.project_task_201" model="project.task">
|
||||
<field name="sequence">40</field>
|
||||
<field name="planned_hours">32.0</field>
|
||||
@@ -71,19 +71,19 @@
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="project_id" ref="project.project_project_22"/>
|
||||
<field name="name">Validation + latest modifications.</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<record id="project.project_task_116" model="project.task">
|
||||
<field name="planned_hours">38.0</field>
|
||||
<field name="remaining_hours">38.0</field>
|
||||
<field name="timebox_id" ref="timebox_daily"/>
|
||||
<field name="context_id" ref="context_office"/>
|
||||
<field name="type" ref="project.project_tt_development"/>
|
||||
<field name="type_id" ref="project.project_tt_development"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="project_id" ref="project.project_project_22"/>
|
||||
<field name="name">Specific adaptation to MRP</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="project.project_task_201" model="project.task">
|
||||
<field name="sequence">40</field>
|
||||
<field name="planned_hours">32.0</field>
|
||||
@@ -104,7 +104,7 @@
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="project_id" ref="project.project_project_22"/>
|
||||
<field name="name">Validation + latest modifications.</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user