@@ -38,7 +38,7 @@ months = {
|
||||
|
||||
def get_recurrent_dates(rrulestring, exdate, startdate=None):
|
||||
def todate(date):
|
||||
val = parser.parse(''.join((re.compile('\d')).findall(date)) + 'Z')
|
||||
val = parser.parse(''.join((re.compile('\d')).findall(date)))
|
||||
return val
|
||||
if not startdate:
|
||||
startdate = datetime.now()
|
||||
@@ -778,13 +778,15 @@ rule or repeating pattern for anexception to a recurrence set"),
|
||||
|
||||
def modify_this(self, cr, uid, ids, defaults, context=None, *args):
|
||||
datas = self.read(cr, uid, ids[0], context=context)
|
||||
date = datas.get('date')
|
||||
defaults.update({
|
||||
'recurrent_uid': base_calendar_id2real_id(datas['id']),
|
||||
'recurrent_id': defaults.get('date'),
|
||||
'rrule_type': 'none',
|
||||
'rrule': ''
|
||||
})
|
||||
exdate = datas['exdate'] and datas['exdate'].split(',') or []
|
||||
exdate.append(defaults.get('date'))
|
||||
self.write(cr, uid, ids, {'exdate': ','.join(exdate)}, context=context)
|
||||
new_id = self.copy(cr, uid, ids[0], default=defaults, context=context)
|
||||
return new_id
|
||||
|
||||
|
||||
+23
-13
@@ -248,15 +248,15 @@ class CalDAV(object):
|
||||
data[map_field], ical, context=context)
|
||||
elif data[map_field]:
|
||||
if map_type in ("char", "text"):
|
||||
vevent.add(field).value = tools.ustr(data[map_field])
|
||||
elif map_type in ('datetime', 'date') and data[map_field]:
|
||||
if field in ('exdate'):
|
||||
vevent.add(field).value = [parser.parse(data[map_field])]
|
||||
vevent.add(field).value = map(parser.parse, (data[map_field]).split(','))
|
||||
else:
|
||||
dtfield = vevent.add(field)
|
||||
dtfield.value = parser.parse(data[map_field])
|
||||
if tzval:
|
||||
dtfield.params['TZID'] = [tzval.title()]
|
||||
vevent.add(field).value = tools.ustr(data[map_field])
|
||||
elif map_type in ('datetime', 'date') and data[map_field]:
|
||||
dtfield = vevent.add(field)
|
||||
dtfield.value = parser.parse(data[map_field])
|
||||
if tzval:
|
||||
dtfield.params['TZID'] = [tzval.title()]
|
||||
elif map_type == "timedelta":
|
||||
vevent.add(field).value = timedelta(hours=data[map_field])
|
||||
elif map_type == "many2one":
|
||||
@@ -275,11 +275,13 @@ class CalDAV(object):
|
||||
def check_import(self, cr, uid, vals, context={}):
|
||||
ids = []
|
||||
model_obj = self.pool.get(context.get('model'))
|
||||
recur_pool = {}
|
||||
try:
|
||||
for val in vals:
|
||||
exists, r_id = uid2openobjectid(cr, val['id'], context.get('model'), \
|
||||
val.get('recurrent_id'))
|
||||
if val.has_key('create_date'): val.pop('create_date')
|
||||
u_id = val.get('id', None)
|
||||
val.pop('id')
|
||||
if exists and r_id:
|
||||
val.update({'recurrent_uid': exists})
|
||||
@@ -289,8 +291,14 @@ class CalDAV(object):
|
||||
model_obj.write(cr, uid, [exists], val)
|
||||
ids.append(exists)
|
||||
else:
|
||||
event_id = model_obj.create(cr, uid, val)
|
||||
ids.append(event_id)
|
||||
if u_id in recur_pool and val.get('recurrent_id'):
|
||||
val.update({'recurrent_uid': recur_pool[u_id]})
|
||||
revent_id = model_obj.create(cr, uid, val)
|
||||
ids.append(revent_id)
|
||||
else:
|
||||
event_id = model_obj.create(cr, uid, val)
|
||||
recur_pool[u_id] = event_id
|
||||
ids.append(event_id)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(('Error !'), (str(e)))
|
||||
return ids
|
||||
@@ -369,6 +377,7 @@ class Calendar(CalDAV, osv.osv):
|
||||
def import_cal(self, cr, uid, content, data_id=None, context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
vals = []
|
||||
ical_data = base64.decodestring(content)
|
||||
parsedCal = vobject.readOne(ical_data)
|
||||
if not data_id:
|
||||
@@ -385,11 +394,12 @@ class Calendar(CalDAV, osv.osv):
|
||||
})
|
||||
self.__attribute__ = get_attribute_mapping(cr, uid, child.name.lower(), context=context)
|
||||
val = self.parse_ics(cr, uid, child, cal_children=cal_children, context=context)
|
||||
vals.append(val)
|
||||
obj = self.pool.get(cal_children[child.name.lower()])
|
||||
if hasattr(obj, 'check_import'):
|
||||
obj.check_import(cr, uid, [val], context=context)
|
||||
else:
|
||||
self.check_import(cr, uid, [val], context=context)
|
||||
if hasattr(obj, 'check_import'):
|
||||
obj.check_import(cr, uid, vals, context=context)
|
||||
else:
|
||||
self.check_import(cr, uid, vals, context=context)
|
||||
return {}
|
||||
Calendar()
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Funds Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="name" string="Funds"/>
|
||||
<field name="name" string="Fund Description"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="type_id" string="Payment Mode"/>
|
||||
<field name="planned_cost" string="Amount"/>
|
||||
@@ -197,7 +197,7 @@
|
||||
<filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Funds"/>
|
||||
<filter icon="gtk-media-pause" domain="[('state','=','pending')]" help="Pending Funds"/>
|
||||
</field>
|
||||
<field name="name" select='1'/>
|
||||
<field name="name" select='1' string="Fund Description"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
<field name="section_id" select="1" widget="selection" string="Section" default="context.get('section_id', False)">
|
||||
<filter icon="terp-crm"
|
||||
|
||||
@@ -39,8 +39,8 @@ class crm_fundraising(osv.osv):
|
||||
'partner_name2': fields.char('Employee Email', size=64),
|
||||
'partner_phone': fields.char('Phone', size=32),
|
||||
'partner_mobile': fields.char('Mobile', size=32),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id)]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', domain="[('section_id','=',section_id)]"),
|
||||
'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.fundraising')]"),
|
||||
'type_id': fields.many2one('crm.case.resource.type', 'Fundraising Type', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.fundraising')]"),
|
||||
'duration': fields.float('Duration'),
|
||||
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
|
||||
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
|
||||
@@ -23,11 +23,10 @@ from osv import fields, osv
|
||||
from crm import crm
|
||||
from caldav import caldav
|
||||
from base_calendar import base_calendar
|
||||
|
||||
class crm_meeting(osv.osv):
|
||||
_inherit = 'crm.meeting'
|
||||
|
||||
|
||||
|
||||
def export_cal(self, cr, uid, ids, context={}):
|
||||
ids = map(lambda x: base_calendar.base_calendar_id2real_id(x), ids)
|
||||
event_data = self.read(cr, uid, ids)
|
||||
@@ -39,29 +38,7 @@ class crm_meeting(osv.osv):
|
||||
event_obj = self.pool.get('basic.calendar.event')
|
||||
vals = event_obj.import_cal(cr, uid, data, context=context)
|
||||
return self.check_import(cr, uid, vals, context=context)
|
||||
|
||||
def check_import(self, cr, uid, vals, context={}):
|
||||
ids = []
|
||||
for val in vals:
|
||||
exists, r_id = caldav.uid2openobjectid(cr, val['id'], \
|
||||
self._name, val.get('recurrent_id'))
|
||||
if val.has_key('create_date'): val.pop('create_date')
|
||||
val['base_calendar_url'] = context.get('url') or ''
|
||||
val.pop('id')
|
||||
if exists and r_id:
|
||||
val.update({'recurrent_uid': exists})
|
||||
self.write(cr, uid, [r_id], val)
|
||||
ids.append(r_id)
|
||||
elif exists:
|
||||
self.write(cr, uid, [exists], val)
|
||||
ids.append(exists)
|
||||
else:
|
||||
event_id = self.create(cr, uid, val)
|
||||
ids.append(event_id)
|
||||
return ids
|
||||
|
||||
crm_meeting()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -134,9 +134,6 @@ class project(osv.osv):
|
||||
'warn_customer': fields.boolean('Warn Partner', help="If you check this, the user will have a popup when closing a task that propose a message to send by email to the customer."),
|
||||
'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."),
|
||||
'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."),
|
||||
# 'state': fields.selection([('template', 'Template'), ('open', 'Running'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', required=True, readonly=True,
|
||||
# help='The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
|
||||
# \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
|
||||
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'),
|
||||
}
|
||||
_order = "sequence"
|
||||
|
||||
@@ -402,8 +402,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Task Edition">
|
||||
<group col="20" colspan="4">
|
||||
<filter string="TODO" domain="[('state','in',('open','draft'))]" help="Draft and Open Tasks" icon="terp-project" default="1"/>
|
||||
<filter string="Current" domain="[('state','in',('open','draft','pending'))]" help="Draft, Open and Pending Tasks" icon="terp-project" default="1"/>
|
||||
<filter string="Current" domain="[('state','in',('open','draft'))]" help="Draft, Open and Pending Tasks" icon="terp-project" default="1"/>
|
||||
<filter string="In Progress" domain="[('state','=','open')]" help="Open Tasks" icon="terp-project"/>
|
||||
<filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-project"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
@@ -85,13 +85,5 @@
|
||||
<field name="act_window_id" ref="action_order_report_tree_all"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.next_id_64" name="Reporting" parent="base.menu_base_partner" sequence="8"/>
|
||||
|
||||
<menuitem id="sale_reporting_menu" name="Sale" parent="base.next_id_64" sequence="8"/>
|
||||
|
||||
<menuitem action="action_sale_order_report_all" id="menu_report_sale_order_all" parent="sale.sale_reporting_menu" sequence="3"/>
|
||||
|
||||
<menuitem action="action_order_report_tree_all" id="menu_report_order_product_all1" parent="sale.sale_reporting_menu" sequence="4"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Tasks">
|
||||
<field colspan="4" name="tasks_id" nolabel="1" widget="one2many_list"/>
|
||||
<field colspan="4" name="tasks_id" nolabel="1" widget="one2many_list" context="{'default_project_id':project_id, 'default_sprint_id':sprint_id, 'default_product_backlog_id':active_id}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="7" colspan="4">
|
||||
@@ -103,7 +103,7 @@
|
||||
<filter default="1"
|
||||
icon="terp-project"
|
||||
string="Current"
|
||||
domain="[('sprint_id.date_start','<=',time.strftime('%%Y-%%m-%%d')), ('sprint_id.date_stop','>=',time.strftime('%%Y-%%m-%%d')), ('state','in',['draft','open'])]"
|
||||
domain="['|','&',('sprint_id.date_start','<=',time.strftime('%%Y-%%m-%%d')), ('sprint_id.date_stop','>=',time.strftime('%%Y-%%m-%%d')), ('state','in',['draft','open'])]"
|
||||
help="Current Backlogs"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-project" string="Draft" domain="[('state','=','draft')]" help="Draft Backlogs"/>
|
||||
@@ -184,17 +184,17 @@
|
||||
<notebook colspan="4">
|
||||
<page string="Sprint Info">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Owners"/>
|
||||
<separator string="Owners" colspan="2"/>
|
||||
<field name="product_owner_id"/>
|
||||
<field name="scrum_master_id"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Dates"/>
|
||||
<separator string="Dates" colspan="2"/>
|
||||
<field name="date_start" select="1"/>
|
||||
<field name="date_stop"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Planning"/>
|
||||
<separator string="Planning" colspan="2"/>
|
||||
<field name="planned_hours" widget="float_time"/>
|
||||
<field name="expected_hours" widget="float_time"/>
|
||||
<field name="effective_hours" widget="float_time"/>
|
||||
@@ -456,7 +456,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="project_id" position="after">
|
||||
<field name="sprint_id" widget="selection" context="{'sprint_invisible':False}">
|
||||
<filter icon="terp-project" string="Current" context="{'sprint_invisible':False}" domain="[('state','=','open')]" help="Current Sprints"/>
|
||||
<filter icon="terp-project" string="Current" context="{'sprint_invisible':False}" domain="[('sprint_id.state','in',('draft','open'))]" help="Current Sprints"/>
|
||||
</field>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -48,7 +48,7 @@ def _do_create(self, cr, uid, data, context):
|
||||
'name': backlog.name,
|
||||
'description': backlog.note,
|
||||
'project_id': backlog.project_id.id,
|
||||
'user_id': (backlog.user_id and backlog.user_id.id) or uid,
|
||||
'user_id': data['form']['user_id'] or (backlog.user_id and backlog.user_id.id) or uid,
|
||||
'planned_hours': backlog.planned_hours
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user