base_calandar,crm: Merge the freq option with rule

bzr revid: sbh@tinyerp.com-20101215073136-qhlcf7mqv3n7u38x
This commit is contained in:
Sbh (OpenERP)
2010-12-15 13:01:36 +05:30
parent c0509b23cc
commit 81f4edc981
2 changed files with 9 additions and 10 deletions
+4 -5
View File
@@ -1026,7 +1026,6 @@ class calendar_event(osv.osv):
qry = "UPDATE \"%s\" set rrule_type=%%s " % self._table
qry_args = [ rrule_type, ]
if rrule_type == 'custom':
new_val = val.copy()
for k, v in val.items():
@@ -1087,11 +1086,11 @@ class calendar_event(osv.osv):
if datas.get('rrule_type') == 'none':
result[event] = False
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
elif datas.get('rrule_type') == 'custom':
if datas.get('rrule_type') :
if datas.get('interval', 0) < 0:
raise osv.except_osv(_('Warning!'), _('Interval can not be Negative'))
if datas.get('count', 0) < 0:
raise osv.except_osv(_('Warning!'), _('Count can not be Negative'))
# if datas.get('count', 0) < 0:
# raise osv.except_osv(_('Warning!'), _('Count can not be Negative'))
rrule_custom = self.compute_rule_string(cr, uid, datas, \
context=context)
result[event] = rrule_custom
@@ -1368,7 +1367,7 @@ true, it will allow you to hide the event alarm information without removing it.
monthstring = ''
yearstring = ''
freq = datas.get('freq')
freq = datas.get('rrule_type')
if freq == 'None':
return ''
+5 -5
View File
@@ -174,12 +174,12 @@
</group>
<separator string="Recurrency Rule" colspan="8"/>
<group col="6" colspan="4">
<field name="freq" />
<!--<field name="freq" />-->
<field name="interval" string="Repeat Times" attrs="{'invisible': [('end_date','!=',False)]}"/>
<field name="end_date" attrs="{'invisible': [('interval','!=',False)]}"/>
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
attrs="{'invisible' : [('rrule_type','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
@@ -191,7 +191,7 @@
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
attrs="{'invisible' : [('rrule_type','!=','monthly'), ('rrule_type','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
@@ -208,10 +208,10 @@
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
attrs="{'invisible' : [('rrule_type','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
attrs="{'required' : [('rrule_type','=','yearly')]}" />
</group>
</group>
</group>