[CLEAN] review the code and some screens
bzr revid: mva@openerp.com-20120116135802-nzjllqh55mvpijnz
This commit is contained in:
@@ -45,6 +45,7 @@ class event_event(osv.osv):
|
||||
_name = 'event.event'
|
||||
_description = __doc__
|
||||
_order = 'date_begin'
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
""" Copy record of Given id
|
||||
@@ -196,7 +197,7 @@ class event_event(osv.osv):
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Origin', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'name': fields.char('name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'parent_id': fields.many2one('event.event', 'Parent Event', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sale Team', readonly=False, states={'done': [('readonly', True)]}),
|
||||
@@ -279,7 +280,8 @@ class event_registration(osv.osv):
|
||||
"""Event Registration"""
|
||||
_name= 'event.registration'
|
||||
_description = __doc__
|
||||
_inherit = 'mail.thread'
|
||||
_inherit = ['mail.thread','res.partner.address']
|
||||
|
||||
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
@@ -541,6 +543,7 @@ class event_registration(osv.osv):
|
||||
"""
|
||||
Send email to user with email_template
|
||||
"""
|
||||
mail_message = self.pool.get('email.template')
|
||||
for registration in self.browse(cr, uid, ids, context=context):
|
||||
subject = registration.event_id.email_confirmation_id.subject
|
||||
reply_to = registration.event_id.email_confirmation_id.reply_to
|
||||
@@ -548,7 +551,7 @@ class event_registration(osv.osv):
|
||||
email_to =registration.event_id.email_confirmation_id.email_to
|
||||
body = registration.event_id.email_confirmation_id.body_html
|
||||
if subject or body:
|
||||
mail_message.schedule_with_attach(cr, uid, src, email_to, subject, body, model='event.registration', email_cc=email_cc, res_id=registration.id)
|
||||
mail_message.schedule_with_attach(cr, uid, reply_to, email_to, subject, body, model='event.registration', email_cc=email_cc, res_id=registration.id)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
+10
-13
@@ -325,15 +325,19 @@
|
||||
<page string="Registration">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="partner" colspan="4"/>
|
||||
<field name="partner_id_address" attrs="{'readonly':[('state','!=', 'draft')]}" required="1" on_change="onchange_partner_id(partner_id_address,event_id)" />
|
||||
|
||||
|
||||
<field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id_address,event_id)" />
|
||||
<field name="city"/>
|
||||
<field name="street"/>
|
||||
<field name="email"/>
|
||||
<field name="mobile"/>
|
||||
<field name="phone"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Registration Cost" colspan="4"/>
|
||||
<field name="nb_register" invisible="1"/>
|
||||
<field name="nb_register"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="price_subtotal" invisible="1"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="invoice_id"/>
|
||||
</group>
|
||||
|
||||
<separator string="" colspan="4"/>
|
||||
@@ -344,11 +348,6 @@
|
||||
<button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string='invoice'>
|
||||
<field name="event_product" attrs="{'required':[('tobe_invoiced','=',True)]}"/>
|
||||
<field name="partner_invoice_id" attrs="{'required':[('tobe_invoiced','=',True)]}" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
|
||||
<field name="invoice_id"/>
|
||||
</page>
|
||||
<page string="Extra Info">
|
||||
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
@@ -385,9 +384,7 @@
|
||||
name="%(mail.action_email_compose_message_wizard)d"
|
||||
icon="terp-mail-message-new" type="action"/>
|
||||
</page>
|
||||
<page string="Note">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user