bzr revid: apa@tinyerp.com-20101013102715-br2f48p5okzywt75
This commit is contained in:
apa-tiny
2010-10-13 15:57:15 +05:30
2 changed files with 9 additions and 3 deletions
+9 -2
View File
@@ -211,7 +211,7 @@ class event_event(osv.osv):
'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current',
help="Total of Open and Done Registrations"),
'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect',
help="Total of Prospect Registrations"),
help="Total of Prospect Registrati./event/event.py:41:ons"),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'date_begin': fields.datetime('Beginning date', required=True, help="Beginning Date of Event", readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True, states={'draft': [('readonly', False)]}),
@@ -262,8 +262,15 @@ class event_event(osv.osv):
return True
def _check_closing_date(self, cr, uid, ids):
for event in self.browse(cr, uid, ids):
if event.date_end < event.date_begin:
return False
return True
_constraints = [
(_check_recursion, 'Error ! You cannot create recursive event.', ['parent_id'])
(_check_recursion, 'Error ! You cannot create recursive event.', ['parent_id']),
(_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']),
]
def do_team_change(self, cr, uid, ids, team_id, context=None):
@@ -22,7 +22,6 @@
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
<field name="amount" sum="Total cost" invisible="1"/>
<field name="general_account_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
</tree>
</field>
</record>