[MERGE] from lp:~openerp/openobject-addons/trunk/
bzr revid: hmo@tinyerp.com-20100317060145-grxjqr8b90u4nn5d
This commit is contained in:
commit
586a4ef79a
|
@ -668,7 +668,7 @@
|
|||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
|
||||
<wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Making Entries by Line"/>
|
||||
<wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Entries by Line"/>
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL" action="action_move_journal_line_form" id="menu_action_move_journal_line_form" parent="account.menu_finance_entries" type="wizard" sequence="5"/>
|
||||
|
||||
<!--
|
||||
|
@ -974,7 +974,7 @@
|
|||
<menuitem action="action_move_line_form" id="menu_action_move_line_form" parent="next_id_29"/>
|
||||
|
||||
<record id="action_move_line_form_encode_by_move" model="ir.actions.act_window">
|
||||
<field name="name">Making Entries by Move</field>
|
||||
<field name="name">Entries by Move</field>
|
||||
<field name="res_model">account.move</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
|
|
|
@ -1136,7 +1136,8 @@ class account_invoice_line(osv.osv):
|
|||
'invoice_line_tax_id': fields.many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]),
|
||||
'note': fields.text('Notes', translate=True),
|
||||
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
|
||||
'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
|
||||
'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
|
||||
'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
|
||||
}
|
||||
_defaults = {
|
||||
'quantity': lambda *a: 1,
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_account_analytic_line_tree"/>
|
||||
</record>
|
||||
<wizard id="action_account_analytic_line" menu="False" model="account.analytic.line" name="account.analytic.line" string="Making Entries by Line"/>
|
||||
<wizard id="action_account_analytic_line" menu="False" model="account.analytic.line" name="account.analytic.line" string="Entries by Line"/>
|
||||
<menuitem id="next_id_41" name="Analytic Entries" parent="account.menu_finance_entries"/>
|
||||
<menuitem type="wizard" icon="STOCK_JUSTIFY_FILL" action="action_account_analytic_line" id="account_entries_analytic_entries" parent="next_id_41"/>
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ def _action_open_window(self, cr, uid, data, context):
|
|||
id = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
|
||||
return {
|
||||
'name': _('Analytic Entries'),
|
||||
'name': _('Analytic Entries by line'),
|
||||
'view_type': 'form',
|
||||
"view_mode": 'tree,form',
|
||||
'res_model': 'account.analytic.line',
|
||||
|
@ -71,11 +71,11 @@ class account_analytic_line(wizard.interface):
|
|||
}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Entries','gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
|
|
|
@ -111,15 +111,19 @@ class base_module_record(osv.osv):
|
|||
return obj.module+'.'+obj.name, obj.noupdate
|
||||
|
||||
def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False):
|
||||
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
model_pool = self.pool.get(model)
|
||||
|
||||
record = doc.createElement('record')
|
||||
record.setAttribute("id", record_id)
|
||||
record.setAttribute("model", model)
|
||||
record_list = [record]
|
||||
lids = self.pool.get('ir.model.data').search(cr, uid, [('model','=',model)])
|
||||
res = self.pool.get('ir.model.data').read(cr, uid, lids[:1], ['module'])
|
||||
lids = data_pool.search(cr, uid, [('model','=',model)])
|
||||
res = data_pool.read(cr, uid, lids[:1], ['module'])
|
||||
if res:
|
||||
self.depends[res[0]['module']]=True
|
||||
fields = self.pool.get(model).fields_get(cr, uid)
|
||||
fields = model_pool.fields_get(cr, uid)
|
||||
for key,val in data.items():
|
||||
if not (val or (fields[key]['type']=='boolean')):
|
||||
continue
|
||||
|
@ -142,9 +146,11 @@ class base_module_record(osv.osv):
|
|||
id,update = self._get_id(cr, uid, fields[key]['relation'], val)
|
||||
noupdate = noupdate or update
|
||||
if not id:
|
||||
relation_pool = self.pool.get(fields[key]['relation'])
|
||||
|
||||
field.setAttribute("model", fields[key]['relation'])
|
||||
fld_nm = self.pool.get(fields[key]['relation'])._rec_name
|
||||
name = self.pool.get(fields[key]['relation']).read(cr, uid, val,[fld_nm])[fld_nm] or False
|
||||
fld_nm = relation_pool._rec_name
|
||||
name = relation_pool.read(cr, uid, val,[fld_nm])[fld_nm] or False
|
||||
field.setAttribute("search", str([(str(fld_nm) ,'=', name)]))
|
||||
else:
|
||||
field.setAttribute("ref", id)
|
||||
|
@ -152,10 +158,10 @@ class base_module_record(osv.osv):
|
|||
elif fields[key]['type'] in ('one2many',):
|
||||
for valitem in (val or []):
|
||||
if valitem[0] in (0,1):
|
||||
if key in self.pool.get(model)._columns:
|
||||
fname = self.pool.get(model)._columns[key]._fields_id
|
||||
if key in model_pool._columns:
|
||||
fname = model_pool._columns[key]._fields_id
|
||||
else:
|
||||
fname = self.pool.get(model)._inherit_fields[key][2]._fields_id
|
||||
fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
valitem[2][fname] = record_id
|
||||
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
if not newid:
|
||||
|
@ -190,14 +196,18 @@ class base_module_record(osv.osv):
|
|||
|
||||
def _create_yaml_record(self, cr, uid, model, data, record_id):
|
||||
record={'model': model, 'id': str(record_id)}
|
||||
lids = self.pool.get('ir.model.data').search(cr, uid, [('model','=',model)])
|
||||
res = self.pool.get('ir.model.data').read(cr, uid, lids[:1], ['module'])
|
||||
|
||||
model_pool = self.pool.get(model)
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
|
||||
lids = data_pool.search(cr, uid, [('model','=',model)])
|
||||
res = data_pool.read(cr, uid, lids[:1], ['module'])
|
||||
attrs={}
|
||||
if res:
|
||||
self.depends[res[0]['module']]=True
|
||||
fields = self.pool.get(model).fields_get(cr, uid)
|
||||
fields = model_pool.fields_get(cr, uid)
|
||||
defaults={}
|
||||
defaults[model] = self.pool.get(model).default_get(cr, uid, data)
|
||||
defaults[model] = model_pool.default_get(cr, uid, data)
|
||||
for key,val in data.items():
|
||||
if ((key in defaults[model]) and (val == defaults[model][key])) and not(fields[key].get('required',False)):
|
||||
continue
|
||||
|
@ -210,19 +220,19 @@ class base_module_record(osv.osv):
|
|||
elif fields[key]['type'] in ('integer','float'):
|
||||
attrs[key] = val
|
||||
elif fields[key]['type'] in ('many2one',):
|
||||
if type(val) in (type(''),type(u'')):
|
||||
if type(val) in (type(''), type(u'')):
|
||||
id = val
|
||||
else:
|
||||
id,update = self._get_id(cr, uid, fields[key]['relation'], val)
|
||||
id, update = self._get_id(cr, uid, fields[key]['relation'], val)
|
||||
attrs[key] = str(id)
|
||||
elif fields[key]['type'] in ('one2many',):
|
||||
items=[[]]
|
||||
for valitem in (val or []):
|
||||
if valitem[0] in (0,1):
|
||||
if key in self.pool.get(model)._columns:
|
||||
fname = self.pool.get(model)._columns[key]._fields_id
|
||||
if key in model_pool._columns:
|
||||
fname = model_pool._columns[key]._fields_id
|
||||
else:
|
||||
fname = self.pool.get(model)._inherit_fields[key][2]._fields_id
|
||||
fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
valitem[2][fname] = record_id
|
||||
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
if not newid:
|
||||
|
|
|
@ -65,7 +65,7 @@ class crm_lead(osv.osv):
|
|||
_columns = {
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Lead Source', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
|
||||
'partner_name': fields.char("Lead Name", size=64),
|
||||
'partner_name': fields.char("Contact Name", size=64),
|
||||
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
|
@ -78,6 +78,7 @@ class crm_lead(osv.osv):
|
|||
method=True, type="integer", store=True),
|
||||
'day_close': fields.function(_compute_closeday, string='Days to Close', \
|
||||
method=True, type="integer", store=True),
|
||||
'function_name' : fields.char('Function', size=64),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Leads Form">
|
||||
<group colspan="4" col="7">
|
||||
<field name="partner_name" required="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="priority"/>
|
||||
<field name="date_deadline"/>
|
||||
<button
|
||||
|
@ -57,7 +57,6 @@
|
|||
<field name="user_id"/>
|
||||
<field name="stage_id" widget="selection" readonly="1" domain="[('object_id.model', '=', 'crm.lead')]"/>
|
||||
<group col="2" colspan="1">
|
||||
|
||||
<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"/>
|
||||
</group>
|
||||
|
@ -66,10 +65,10 @@
|
|||
<page string="Lead">
|
||||
<group colspan="2" col="4">
|
||||
<separator string="Contact" colspan="4" col="4"/>
|
||||
<field name="name" string="Contact Name" colspan="4"/>
|
||||
<field name="partner_name" string="Contact Name" colspan="4"/>
|
||||
<newline/>
|
||||
<field domain="[('domain', '=', 'contact')]" name="title"/>
|
||||
<field name="function"/>
|
||||
<field name="function_name" />
|
||||
<field name="street" colspan="4"/>
|
||||
<field name="street2" colspan="4"/>
|
||||
<field name="zip"/>
|
||||
|
@ -79,14 +78,14 @@
|
|||
</group>
|
||||
<group colspan="2" col="3">
|
||||
<separator string="Communication" colspan="4" col="3"/>
|
||||
<field name="email_from" widget="email"/>
|
||||
<newline/>
|
||||
<field name="phone"/>
|
||||
<newline/>
|
||||
<field name="fax"/>
|
||||
<newline/>
|
||||
<field name="mobile"/>
|
||||
<newline/>
|
||||
<field name="email_from" widget="email"/>
|
||||
<newline/>
|
||||
<separator string="Links" colspan="4" col="3"/>
|
||||
<field name="partner_id"/>
|
||||
<button
|
||||
|
|
|
@ -56,10 +56,11 @@
|
|||
<form string="Opportunities">
|
||||
<group colspan="4" col="7">
|
||||
<field name="name" string="Opportunity"/>
|
||||
<group colspan="2" col="4">
|
||||
<field name="stage_id" readonly="1" on_change="onchange_stage_id(stage_id)" widget="selection" domain="[('object_id.model', '=', 'crm.opportunity')]"/>
|
||||
<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"/>
|
||||
<label string="Stage:" align="1.0"/>
|
||||
<group colspan="1" col="4">
|
||||
<field name="stage_id" nolabel="1" on_change="onchange_stage_id(stage_id)" widget="selection" domain="[('object_id.model', '=', 'crm.opportunity')]"/>
|
||||
<button name="stage_previous" states="open,pending" type="object" icon="gtk-go-back" string=""/>
|
||||
<button name="stage_next" states="open,pending" type="object" icon="gtk-go-forward" string=""/>
|
||||
</group>
|
||||
<field name="user_id"/>
|
||||
<button string="Schedule Meeting"
|
||||
|
|
|
@ -42,7 +42,7 @@ class crm_phonecall(osv.osv):
|
|||
'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d')
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
}
|
||||
crm_phonecall()
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
|
@ -29,14 +30,8 @@ import os
|
|||
import binascii
|
||||
import time, socket
|
||||
|
||||
email_re = re.compile(r"""
|
||||
([a-zA-Z][\w\.-]*[a-zA-Z0-9] # username part
|
||||
@ # mandatory @ sign
|
||||
[a-zA-Z0-9][\w\.-]* # domain must start with a letter ... Ged> why do we include a 0-9 then?
|
||||
\.
|
||||
[a-z]{2,3} # TLD
|
||||
)
|
||||
""", re.VERBOSE)
|
||||
|
||||
email_re = re.compile(r"([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6})")
|
||||
case_re = re.compile(r"\[([0-9]+)\]", re.UNICODE)
|
||||
command_re = re.compile("^Set-([a-z]+) *: *(.+)$", re.I + re.UNICODE)
|
||||
reference_re = re.compile("<.*-tinycrm-(\\d+)@(.*)>", re.UNICODE)
|
||||
|
@ -123,7 +118,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
|
|||
html += '\n\n'
|
||||
html += '[%s] %s\n' % (i+1, url)
|
||||
return html
|
||||
|
||||
|
||||
class rpc_proxy(object):
|
||||
def __init__(self, uid, passwd, host='localhost', port=8069, path='object', dbname='terp'):
|
||||
self.rpc = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/%s' % (host, port, path))
|
||||
|
@ -177,11 +172,7 @@ class email_parser(object):
|
|||
'user_id': False,
|
||||
'description': message['body'],
|
||||
}
|
||||
try:
|
||||
data.update(self.partner_get(self._decode_header(msg['From'])))
|
||||
except Exception, e:
|
||||
import netsvc
|
||||
netsvc.Logger().notifyChannel('mailgate', netsvc.LOG_ERROR, "%s" % e)
|
||||
data.update(self.partner_get(self._decode_header(msg['From'])))
|
||||
|
||||
try:
|
||||
id = self.rpc(self.model, 'create', data)
|
||||
|
@ -257,7 +248,6 @@ class email_parser(object):
|
|||
message['attachment'] = attachment
|
||||
#end for
|
||||
return message
|
||||
#end def
|
||||
|
||||
def msg_user(self, msg, id):
|
||||
body = self.msg_body_get(msg)
|
||||
|
@ -362,7 +352,7 @@ class email_parser(object):
|
|||
if msg.get('Subject', ''):
|
||||
del msg['Subject']
|
||||
msg['Subject'] = '['+str(case_id)+'] '+subject
|
||||
msg['Message-Id'] = '<'+str(time.time())+'-tinycrm-'+str(case_id)+'@'+socket.gethostname()+'>'
|
||||
msg['Message-Id'] = '<'+str(time.time())+'-openerpcrm-'+str(case_id)+'@'+socket.gethostname()+'>'
|
||||
|
||||
emails = self.rpc(self.model, 'emails_get', case_id)
|
||||
priority = emails[3]
|
||||
|
@ -385,9 +375,7 @@ class email_parser(object):
|
|||
|
||||
if __name__ == '__main__':
|
||||
import sys, optparse
|
||||
parser = optparse.OptionParser(
|
||||
usage='usage: %prog [options]',
|
||||
version='%prog v1.0')
|
||||
parser = optparse.OptionParser( usage='usage: %prog [options]', version='%prog v1.0')
|
||||
group = optparse.OptionGroup(parser, "Note",
|
||||
"This program parse a mail from standard input and communicate "
|
||||
"with the Open ERP server for case management in the CRM module.")
|
||||
|
@ -407,10 +395,6 @@ if __name__ == '__main__':
|
|||
|
||||
msg_txt = email.message_from_file(sys.stdin)
|
||||
|
||||
try :
|
||||
parser.parse(msg_txt)
|
||||
except Exception, e:
|
||||
if getattr(e, 'faultCode', '') and 'Connection unexpectedly closed' in e.faultCode:
|
||||
print e
|
||||
parser.parse(msg_txt)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -74,7 +74,7 @@ def _mass_mail_send(self, cr, uid, data, context):
|
|||
|
||||
case = case_pool.browse(cr,uid,data['ids'])[0]
|
||||
case_pool.write(cr, uid, [case.id], {
|
||||
'som': False,
|
||||
#'som': False,
|
||||
'canal_id': False,
|
||||
})
|
||||
emails = [data['form']['to']] + (data['form']['cc'] or '').split(',')
|
||||
|
|
|
@ -45,7 +45,7 @@ class ir_action_report_xml(osv.osv):
|
|||
res[data.get('id')] = False
|
||||
return res
|
||||
|
||||
def _model_search(self, cr, uid, obj, name, args):
|
||||
def _model_search(self, cr, uid, obj, name, args, context={}):
|
||||
if not len(args):
|
||||
return []
|
||||
model_id= args[0][2]
|
||||
|
|
|
@ -215,8 +215,8 @@ class document_directory(osv.osv):
|
|||
path.append(duri[0])
|
||||
duri = duri[1:]
|
||||
did = nid[0]
|
||||
|
||||
return (nodes.node_dir(path, nparent,ncontext,self.browse(cr,uid,did, context)), duri)
|
||||
root_node = did and self.browse(cr,uid,did, context) or False
|
||||
return (nodes.node_dir(path, nparent,ncontext, root_node), duri)
|
||||
|
||||
|
||||
nid = self.search(cr,uid,[('parent_id','=',did),('name','=',duri[0]),('type','=','ressource')], context=context)
|
||||
|
|
|
@ -49,18 +49,17 @@ class node_context(object):
|
|||
context """
|
||||
cached_roots = {}
|
||||
|
||||
def __init__(self, cr, uid, context=None):
|
||||
# we don't cache the cr!
|
||||
def __init__(self, cr, uid, context=None):
|
||||
self.dbname = cr.dbname
|
||||
self.uid = uid
|
||||
self.context = context
|
||||
self._dirobj = pooler.get_pool(cr.dbname).get('document.directory')
|
||||
assert self._dirobj
|
||||
self.rootdir = self._dirobj._get_root_directory(cr,uid,context)
|
||||
self.rootdir = False #self._dirobj._get_root_directory(cr,uid,context)
|
||||
|
||||
def get_uri(self, cr, uri):
|
||||
""" Although this fn passes back to doc.dir, it is needed since
|
||||
it is a potential caching point """
|
||||
it is a potential caching point """
|
||||
(ndir, duri) = self._dirobj._locate_child(cr,self.uid, self.rootdir,uri, None, self)
|
||||
while duri:
|
||||
ndir = ndir.child(cr, duri[0])
|
||||
|
@ -168,23 +167,23 @@ class node_dir(node_class):
|
|||
our_type = 'collection'
|
||||
def __init__(self,path, parent, context, dirr, dctx=None):
|
||||
super(node_dir,self).__init__(path, parent,context)
|
||||
self.dir_id = dirr.id
|
||||
self.dir_id = dirr and dirr.id or False
|
||||
#todo: more info from dirr
|
||||
self.mimetype = 'application/x-directory'
|
||||
# 'httpd/unix-directory'
|
||||
self.create_date = dirr.create_date
|
||||
self.domain = dirr.domain
|
||||
self.res_model = dirr.ressource_type_id and dirr.ressource_type_id.model or False
|
||||
self.create_date = dirr and dirr.create_date or False
|
||||
self.domain = dirr and dirr.domain or []
|
||||
self.res_model = dirr and dirr.ressource_type_id and dirr.ressource_type_id.model or False
|
||||
# TODO: the write date should be MAX(file.write)..
|
||||
self.write_date = dirr.write_date or dirr.create_date
|
||||
self.write_date = dirr and (dirr.write_date or dirr.create_date) or False
|
||||
self.content_length = 0
|
||||
if dctx:
|
||||
self.dctx.update(dctx)
|
||||
dc2 = self.context.context
|
||||
dc2.update(self.dctx)
|
||||
dc2['dir_id'] = self.dir_id
|
||||
self.displayname = dirr.name
|
||||
if dirr.dctx_ids:
|
||||
self.displayname = dirr and dirr.name or False
|
||||
if dirr and dirr.dctx_ids:
|
||||
for dfld in dirr.dctx_ids:
|
||||
try:
|
||||
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -43,7 +43,7 @@ def _create_duplicate(self, cr, uid, data, context):
|
|||
event_obj=pooler.get_pool(cr.dbname).get('event.event')
|
||||
project_obj = pooler.get_pool(cr.dbname).get('project.project')
|
||||
duplicate_project_id= project_obj.copy(cr, uid,data['form']['project_id'], {'active': True})
|
||||
project_obj.write(cr, uid, [duplicate_project_id], {'name': "copy of " + project_obj.browse(cr, uid, duplicate_project_id, context).name , 'date_start':time.strftime('%Y-%m-%d'),'date_end': event_obj.browse(cr, uid, [data['id']])[0].date_begin[0:10] })
|
||||
project_obj.write(cr, uid, [duplicate_project_id], {'name': "copy of " + project_obj.browse(cr, uid, duplicate_project_id, context).name , 'date_start':time.strftime('%Y-%m-%d'),'date': event_obj.browse(cr, uid, [data['id']])[0].date_begin[0:10] })
|
||||
event_obj.write(cr, uid, [data['id']], {'project_id': duplicate_project_id })
|
||||
return {}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
|
||||
<!--
|
||||
Resource: project.project
|
||||
-->
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="project_time_mode_id" ref="product.uom_hour"></field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Task Types -->
|
||||
<record id="project_tt_specification" model="project.task.type">
|
||||
<field name="sequence">1</field>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<field name="sequence">4</field>
|
||||
<field name="name">Merge</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Projects -->
|
||||
<record id="project_project_9" model="project.project">
|
||||
<field name="warn_manager">1</field>
|
||||
|
@ -39,7 +39,6 @@
|
|||
<field name="priority">10</field>
|
||||
<field name="parent_id" ref="project_project_9"/>
|
||||
<field name="name">Study + Prototype</field>
|
||||
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
|
||||
<field name="manager" ref="base.user_root"/>
|
||||
<field eval="[(6, 0, [ref('project_tt_specification'),ref('project_tt_development')])]" name="type_ids"/>
|
||||
</record>
|
||||
|
@ -47,7 +46,6 @@
|
|||
<field name="priority">20</field>
|
||||
<field name="parent_id" ref="project_project_9"/>
|
||||
<field name="name">Specific Developements</field>
|
||||
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
|
||||
<field name="manager" ref="base.user_root"/>
|
||||
<field eval="[(6, 0, [ref('project_tt_specification'), ref('project_tt_development')])]" name="type_ids"/>
|
||||
</record>
|
||||
|
@ -55,11 +53,10 @@
|
|||
<field name="priority">30</field>
|
||||
<field name="parent_id" ref="project_project_9"/>
|
||||
<field name="name">Install, data import, configuration</field>
|
||||
<field model="account.analytic.account" name="category_id" search="[('name','=', 'Seagate P1')]"/>
|
||||
<field name="manager" ref="base.user_root"/>
|
||||
<field eval="[(6, 0, [ref('project_tt_development')])]" name="type_ids"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tasks -->
|
||||
<record id="project_task_116" model="project.task">
|
||||
<field name="planned_hours">38.0</field>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,22 +15,22 @@
|
|||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
"name" : "Caldav task management",
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"category" : "Generic Modules/Others",
|
||||
"description": """ Synchronize between Project task and Caldav Vtodo.""",
|
||||
"depends" : ["project", "caldav"],
|
||||
"init_xml" : ["project_caldav_data.xml"],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["project_caldav_view.xml",
|
||||
"project_caldav_wizard.xml"],
|
||||
"active": False,
|
||||
"website": "http://www.openerp.com",
|
||||
"installable": True,
|
||||
"name" : "Caldav task management",
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"category" : "Generic Modules/Others",
|
||||
"description": """ Synchronize between Project task and Caldav Vtodo.""",
|
||||
"depends" : ["project", "caldav", "base_calendar"],
|
||||
"init_xml" : ["project_caldav_data.xml"],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["project_caldav_view.xml",
|
||||
"project_caldav_wizard.xml"],
|
||||
"active": False,
|
||||
"website": "http://www.openerp.com",
|
||||
"installable": True,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="view_project_caldav_task_form" model="ir.ui.view">
|
||||
<field name="name">project.task.caldav.form</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -46,8 +46,8 @@
|
|||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<record id="view_project_caldav_task_form1" model="ir.ui.view">
|
||||
<field name="name">project.task.caldav.form1</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -58,8 +58,8 @@
|
|||
<field name="class" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<record id="view_project_caldav_task_form2" model="ir.ui.view">
|
||||
<field name="name">project.task.caldav.form2</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -68,8 +68,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<field name="progress" position="after">
|
||||
<group colspan="2" col="3">
|
||||
<field name="rrule_type" string="Recurrency"
|
||||
<!-- <field name="rrule_type" string="Recurrency"
|
||||
on_change="onchange_rrule_type(rrule_type)" colspan="1" />
|
||||
--> <field name="rrule_type" string="Recurrency"
|
||||
colspan="1" />
|
||||
<button string="Custom" name="101"
|
||||
icon="gtk-save-as" type="action"
|
||||
context="{'model' : 'project.task'}"
|
||||
|
@ -78,7 +80,7 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_project_caldav_task_form3" model="ir.ui.view">
|
||||
<field name="name">project.task.caldav.form3</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -94,6 +96,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -30,7 +30,11 @@
|
|||
""",
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['crm','project'],
|
||||
'depends': [
|
||||
'crm',
|
||||
'project',
|
||||
'hr_timesheet_sheet',
|
||||
],
|
||||
'init_xml': [
|
||||
'project_issue_data.xml'
|
||||
],
|
||||
|
|
|
@ -76,8 +76,6 @@ class project_issue(osv.osv):
|
|||
_columns = {
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date': fields.datetime('Date'),
|
||||
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
|
||||
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
|
||||
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
|
||||
'planned_revenue': fields.float('Planned Revenue'),
|
||||
|
@ -95,12 +93,16 @@ class project_issue(osv.osv):
|
|||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('object_id.model', '=', 'project.issue')]"),
|
||||
'project_id':fields.many2one('project.project', 'Project'),
|
||||
'duration': fields.float('Duration'),
|
||||
'probability': fields.float('Probability (%)'),
|
||||
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"),
|
||||
'day_open': fields.function(_compute_openday, string='Days to Open', \
|
||||
method=True, type="integer", store=True),
|
||||
'day_close': fields.function(_compute_closeday, string='Days to Close', \
|
||||
method=True, type="integer", store=True),
|
||||
'assigned_to' : fields.many2one('res.users', 'Assigned to'),
|
||||
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
|
||||
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account',
|
||||
domain="[('partner_id', '=', partner_id)]",
|
||||
required=True),
|
||||
}
|
||||
|
||||
def _get_project(self, cr, uid, context):
|
||||
|
@ -134,11 +136,25 @@ class project_issue(osv.osv):
|
|||
return {'value':{'probability':stage.probability}}
|
||||
|
||||
_defaults = {
|
||||
'project_id':_get_project,
|
||||
'probability':lambda *a:0.0,
|
||||
'planned_cost':lambda *a:0.0,
|
||||
'planned_revenue':lambda *a:0.0,
|
||||
}
|
||||
'project_id':_get_project,
|
||||
}
|
||||
|
||||
project_issue()
|
||||
|
||||
class account_analytic_line(osv.osv):
|
||||
_inherit = 'account.analytic.line'
|
||||
_columns = {
|
||||
'create_date' : fields.datetime('Create Date', readonly=True),
|
||||
}
|
||||
|
||||
account_analytic_line()
|
||||
|
||||
class hr_analytic_issue(osv.osv):
|
||||
_inherit = 'hr.analytic.timesheet'
|
||||
|
||||
_columns = {
|
||||
'issue_id' : fields.many2one('project.issue', 'Issue'),
|
||||
}
|
||||
|
||||
hr_analytic_issue()
|
||||
|
||||
|
|
|
@ -1,308 +1,301 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="project_issue_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Issue Categories</field>
|
||||
<field name="res_model">crm.case.categ</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
|
||||
<field name="domain">[('object_id.model', '=', 'project.issue')]</field>
|
||||
<field name="context">{'object_id':'project.issue'}</field>
|
||||
</record>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Issue Categories
|
||||
# ------------------------------------------------------
|
||||
<record id="project_issue_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Issue Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_stage_tree"/>
|
||||
<field name="domain">[('object_id.model', '=', 'project.issue')]</field>
|
||||
<field name="context">{'object_id':'project.issue'}</field>
|
||||
</record>
|
||||
<menuitem action="project_issue_stage_act" id="menu_project_issue_stage_act" parent="crm.menu_crm_case_stage"/>
|
||||
|
||||
|
||||
<record id="project_issue_categ_action" model="ir.actions.act_window">
|
||||
<field name="name">Issue Categories</field>
|
||||
<field name="res_model">crm.case.categ</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
|
||||
<field name="domain">[('object_id.model', '=', 'project.issue')]</field>
|
||||
<field name="context">{'object_id':'project.issue'}</field>
|
||||
</record>
|
||||
# ------------------------------------------------------
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record id="project_issue_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Issue Stages</field>
|
||||
<field name="res_model">crm.case.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="crm.crm_case_stage_tree"/>
|
||||
<field name="domain">[('object_id.model', '=', 'project.issue')]</field>
|
||||
<field name="context">{'object_id':'project.issue'}</field>
|
||||
</record>
|
||||
<menuitem action="project_issue_stage_act" id="menu_project_issue_stage_act" parent="crm.menu_crm_case_stage"/>
|
||||
|
||||
<record model="ir.ui.view" id="project_issue_form_view">
|
||||
<field name="name">Project Issue Tracker Form</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Issue Tracker Form">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" string="Title" colspan="2"/>
|
||||
<field name="project_id" required="True"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<group col="3" colspan="2">
|
||||
<field name="task_id"/>
|
||||
<button string="Convert To Task"
|
||||
name="%(wizard_project_issue_task_set)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('task_id','!=',False)]}" />
|
||||
<record model="ir.ui.view" id="project_issue_form_view">
|
||||
<field name="name">Project Issue Tracker Form</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Issue Tracker Form">
|
||||
<group colspan="4" col="8">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="assigned_to" />
|
||||
<group colspan="2" col="4">
|
||||
<field name="stage_id" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]" widget="selection"/>
|
||||
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
|
||||
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
|
||||
</group>
|
||||
<field name="project_id" required="True"/>
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<field name="create_date"/>
|
||||
<field name="write_date" />
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<!-- <group colspan="4" col="5">
|
||||
<label string="" colspan="2"/>
|
||||
<button string="Convert To Feature Request"
|
||||
name="convert_to_feature"
|
||||
icon="gtk-convert" type="object" attrs="{'invisible':[('categ_id','=',ref('bug_categ'))]}"/>
|
||||
<button string="Convert To Bug"
|
||||
name="convert_to_bug"
|
||||
icon="gtk-convert" type="object" attrs="{'invisible':[('categ_id','=',ref('feature_request_categ'))]}"/>
|
||||
|
||||
|
||||
</group> -->
|
||||
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
<separator colspan="4" string="Communication"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" colspan="2"/>
|
||||
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)" colspan="1"/>
|
||||
<field name="email_from" colspan="2"/>
|
||||
<separator colspan="4" string="Status and Categorization"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="user_id" />
|
||||
<label string="Resolution: " align="1.0"/>
|
||||
<group colspan="1" col="3">
|
||||
<field name="stage_id" select="1" nolabel="1" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]"/>
|
||||
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
|
||||
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string= "Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" />
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<field name="id" select="1"/>
|
||||
<field name="active" />
|
||||
<separator colspan="4" string="Dates"/>
|
||||
<field name="create_date"/>
|
||||
<field name="date_closed"/>
|
||||
<field name="day_open"/>
|
||||
<field name="day_close"/>
|
||||
<separator colspan="4" string="Estimates"/>
|
||||
<field name="planned_revenue"/>
|
||||
<field name="planned_cost"/>
|
||||
<field name="probability"/>
|
||||
<separator colspan="4" string="References"/>
|
||||
<field name="ref" colspan="4"/>
|
||||
<field name="ref2" colspan="4"/>
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<form string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="som" />
|
||||
<field name="canal_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="7" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email"/>
|
||||
<field name="canal_id"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Communication"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
|
||||
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
|
||||
<field name="email_from"/>
|
||||
<field name="analytic_account_id" />
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4" string="Reply to Last Email" name="%(crm.wizard_crm_send_mail)d" context="{'mail':'reply'}" icon="gtk-undo" type="action"/>
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email" name="%(crm.wizard_crm_new_send_mail)d" context="{'mail':'new'}" icon="gtk-go-forward" type="action"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="project_issue_tree_view">
|
||||
<field name="name">Project Issue Tracker Tree</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Issue Tracker Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="stage_id" string="Resolution"/>
|
||||
<button icon="gtk-go-back" string=""
|
||||
name="stage_previous" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<button icon="gtk-go-forward" string=""
|
||||
name="stage_next" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<group col="3" colspan="2">
|
||||
<separator colspan="3" string="Status"/>
|
||||
<field name="type_id" colspan="3"/>
|
||||
<field name="priority" colspan="3"/>
|
||||
<field name="task_id" />
|
||||
<button string="Convert To Task"
|
||||
name="%(wizard_project_issue_task_set)d"
|
||||
icon="gtk-index" type="action"
|
||||
attrs="{'invisible':[('task_id','!=',False)]}" />
|
||||
</group>
|
||||
<separator string= "Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" />
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Date"/>
|
||||
<field name="date_closed"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="References" colspan="2"/>
|
||||
<field name="id"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<form string="Actions">
|
||||
<separator string="Action Information" colspan="4"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="canal_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
</group>
|
||||
<field name="history_line" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="7" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email"/>
|
||||
<field name="canal_id"/>
|
||||
<button
|
||||
string="Add a CC"
|
||||
name="%(crm.action_view_crm_email_add_cc_wizard)d"
|
||||
icon="gtk-add" type="action"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
<button colspan="4" string="Reply to Last Email" name="%(crm.wizard_crm_send_mail)d" context="{'mail':'reply'}" icon="gtk-undo" type="action"/>
|
||||
</form>
|
||||
<tree string="Communication history">
|
||||
<field name="description"/>
|
||||
<field name="email"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email" name="%(crm.wizard_crm_new_send_mail)d" context="{'mail':'new'}" icon="gtk-go-forward" type="action"/>
|
||||
</page>
|
||||
<page string="Worklogs">
|
||||
<separator string="Timesheets" colspan="4" />
|
||||
<field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : user_id, 'default_account_id' : analytic_account_id}">
|
||||
<tree editable="top" string="Timesheet">
|
||||
<field name="create_date" string="Date" />
|
||||
<field name="user_id" readonly="1" />
|
||||
<field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
|
||||
|
||||
<record id="view_project_issue_filter" model="ir.ui.view">
|
||||
<field name="name">Project Issue Tracker Search</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Issue Tracker Search">
|
||||
<group col="3" colspan="1">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's bugs"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Bugs during last 7 days"
|
||||
/>
|
||||
<field invisible="1" name="journal_id"/>
|
||||
<field invisible="1" name="product_id"/>
|
||||
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
|
||||
<field invisible="1" name="amount"/>
|
||||
<field invisible="1" name="general_account_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="project_issue_tree_view">
|
||||
<field name="name">Project Issue Tracker Tree</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Issue Tracker Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="stage_id" string="Resolution"/>
|
||||
<button icon="gtk-go-back" string=""
|
||||
name="stage_previous" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<button icon="gtk-go-forward" string=""
|
||||
name="stage_next" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="5" colspan="2">
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Bugs" default="1"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','in',('open','draft'))]" help="Current Bugs" default="1"/>
|
||||
<filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Bugs"/>
|
||||
</field>
|
||||
<field name="project_id" select="1" widget="selection" string="Project" default="context.get('project_id', False)">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('project_id','=',context.get('project_id',False))]"
|
||||
help="My Project"
|
||||
/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_project_issue_filter" model="ir.ui.view">
|
||||
<field name="name">Project Issue Tracker Search</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Issue Tracker Search">
|
||||
<group col="3" colspan="1">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's bugs"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Bugs during last 7 days"
|
||||
/>
|
||||
|
||||
<record model="ir.ui.view" id="project_issue_calendar_view">
|
||||
<field name="name">Project Issue Tracker Calendar</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Issues" date_start="date" color="user_id" date_delay="duration">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="5" colspan="2">
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Bugs" default="1"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','in',('open','draft'))]" help="Current Bugs" default="1"/>
|
||||
<filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Bugs"/>
|
||||
</field>
|
||||
<field name="project_id" select="1" widget="selection" string="Project" default="context.get('project_id', False)">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('project_id','=',context.get('project_id',False))]"
|
||||
help="My Project"
|
||||
/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Feature Requests
|
||||
# ------------------------------------------------------
|
||||
<record model="ir.ui.view" id="project_issue_calendar_view">
|
||||
<field name="name">Project Issue Tracker Calendar</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Issues" date_start="date" color="user_id" date_delay="duration">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="project_feature_tree_view">
|
||||
<field name="name">Project Issue- Feature Tracker Tree</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Feature Tracker Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Feature description"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="stage_id" string="Resolution"/>
|
||||
<button icon="gtk-go-back" string=""
|
||||
name="stage_previous" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<button icon="gtk-go-forward" string=""
|
||||
name="stage_next" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
# ------------------------------------------------------
|
||||
# Feature Requests
|
||||
# ------------------------------------------------------
|
||||
|
||||
<record id="view_project_feature_filter" model="ir.ui.view">
|
||||
<field name="name">Project Issue- Feature Tracker Search</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Feature Tracker Search">
|
||||
<group col="3" colspan="1">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's features"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Features during last 7 days"
|
||||
/>
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="5" colspan="2">
|
||||
<field name="name" select='1' string="Feature description"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Features" default="1"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','in',('open','draft'))]" help="Current Features" default="1"/>
|
||||
<filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Features"/>
|
||||
</field>
|
||||
<field name="project_id" select="1" widget="selection" string="Project" default="context.get('project_id', False)">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('project_id','=',context.get('project_id',False))]"
|
||||
help="My Project"
|
||||
/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="project_feature_tree_view">
|
||||
<field name="name">Project Issue- Feature Tracker Tree</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Feature Tracker Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Feature description"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
<field name="stage_id" string="Resolution"/>
|
||||
<button icon="gtk-go-back" string=""
|
||||
name="stage_previous" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<button icon="gtk-go-forward" string=""
|
||||
name="stage_next" type="object"
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
|
||||
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
|
||||
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
|
||||
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
|
||||
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
|
||||
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_feature_filter" model="ir.ui.view">
|
||||
<field name="name">Project Issue- Feature Tracker Search</field>
|
||||
<field name="model">project.issue</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Feature Tracker Search">
|
||||
<group col="3" colspan="1">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's features"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Features during last 7 days"
|
||||
/>
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group col="5" colspan="2">
|
||||
<field name="name" select='1' string="Feature description"/>
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Features" default="1"/>
|
||||
</field>
|
||||
<field name="state" select="1">
|
||||
<filter icon="gtk-new" domain="[('state','in',('open','draft'))]" help="Current Features" default="1"/>
|
||||
<filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Features"/>
|
||||
</field>
|
||||
<field name="project_id" select="1" widget="selection" string="Project" default="context.get('project_id', False)">
|
||||
<filter icon="terp-crm"
|
||||
domain="[('project_id','=',context.get('project_id',False))]"
|
||||
help="My Project"
|
||||
/>
|
||||
</field>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -29,12 +29,12 @@ class project_project(osv.osv):
|
|||
_description = 'project.project'
|
||||
|
||||
def write(self, cr, uid, ids,vals, *args, **kwargs):
|
||||
if 'date_end' in vals and vals['date_end']:
|
||||
if 'date' in vals and vals['date']:
|
||||
data_project = self.browse(cr,uid,ids)
|
||||
for prj in data_project:
|
||||
c= date(*time.strptime(vals['date_end'],'%Y-%m-%d')[:3])
|
||||
if prj.date_end:
|
||||
d= date(*time.strptime(prj.date_end,'%Y-%m-%d')[:3])
|
||||
c= date(*time.strptime(vals['date'],'%Y-%m-%d')[:3])
|
||||
if prj.date:
|
||||
d= date(*time.strptime(prj.date,'%Y-%m-%d')[:3])
|
||||
for task in prj.tasks:
|
||||
start_dt = (datetime(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:6])+(c-d)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
if task.date_deadline:
|
||||
|
@ -42,7 +42,7 @@ class project_project(osv.osv):
|
|||
self.pool.get('project.task').write(cr,uid,task.id,{'date_start':start_dt, 'date_deadline':deadline_dt})
|
||||
else:
|
||||
self.pool.get('project.task').write(cr,uid,task.id,{'date_start':start_dt})
|
||||
return super(project_project,self).write(cr, uid, ids,vals, *args, **kwargs)
|
||||
return super(project_project,self).write(cr, uid, ids, vals, *args, **kwargs)
|
||||
|
||||
project_project()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue