[IMP] Event: clean
bzr revid: hmo@tinyerp.com-20100716064714-ivuu3ux3sayo28fh
This commit is contained in:
parent
e3606ed329
commit
b651a55c71
|
@ -32,8 +32,6 @@
|
|||
* ...
|
||||
A dashboard for associations that includes:
|
||||
* Registration by Events (graph)
|
||||
* Next Events (list)
|
||||
* Unpaid Invoices (list)
|
||||
Note that:
|
||||
- You can define new types of events in
|
||||
Events / Configuration / Types of Events
|
||||
|
@ -42,15 +40,14 @@
|
|||
""",
|
||||
'author': 'Tiny',
|
||||
'depends': ['crm', 'base_contact', 'account'],
|
||||
'init_xml': ['event_data.xml'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/event_confirm_registration_view.xml',
|
||||
'wizard/event_confirm_view.xml',
|
||||
'event_view.xml',
|
||||
'report/report_event_registration_view.xml',
|
||||
'event_sequence.xml',
|
||||
'security/event_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/event_make_invoice_view.xml',
|
||||
'wizard/partner_event_registration_view.xml',
|
||||
'board_association_view.xml',
|
||||
|
|
|
@ -2,17 +2,6 @@
|
|||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!--
|
||||
Administrator shortcut
|
||||
Demo user startup menu
|
||||
-->
|
||||
<!-- <record model="ir.ui.view_sc" id="sc_association_dash">-->
|
||||
<!-- <field name="name">Dashboard</field>-->
|
||||
<!-- <field name="user_id" ref="base.user_root"/>-->
|
||||
<!-- <field name="resource">ir.ui.menu</field>-->
|
||||
<!-- <field name="sequence">1</field>-->
|
||||
<!-- <field name="res_id" ref="menu_board_associations_manager"/>-->
|
||||
<!-- </record>-->
|
||||
<record model="res.users" id="base.user_root">
|
||||
<field name="action_id" ref="open_board_associations_manager"/>
|
||||
</record>
|
||||
|
|
|
@ -51,11 +51,10 @@ class event_event(osv.osv):
|
|||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'),
|
||||
'state': 'draft'
|
||||
'state': 'draft',
|
||||
'registration_ids': False,
|
||||
})
|
||||
return super(event_event, self).copy(cr, uid, id, default=default, context=context)
|
||||
|
||||
def onchange_product(self, cr, uid, ids, product_id):
|
||||
"""This function returns value of product's unit price based on product id.
|
||||
@param self: The object pointer
|
||||
|
@ -219,7 +218,7 @@ class event_event(osv.osv):
|
|||
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Product which is provided cost of event. Invoice of event will be created with this Product."),
|
||||
'note': fields.text('Notes', help="Description or Summary of Event", readonly=False, states={'done': [('readonly', True)]}),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current event."),
|
||||
"unit_price": fields.float('Registration Cost', digits_compute= dp.get_precision('Event Price'), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'speaker_ids':fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}),
|
||||
|
@ -302,7 +301,7 @@ class event_registration(osv.osv):
|
|||
"unit_price": fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Event Price'), readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Event Price')),
|
||||
"badge_ids": fields.one2many('event.registration.badge', 'registration_id', 'Badges', readonly=False, states={'done': [('readonly', True)]}),
|
||||
"event_product": fields.char("Invoice Name", size=128, required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
"event_product": fields.char("Invoice Name", size=128, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
"tobe_invoiced": fields.boolean("To be Invoiced", readonly=True, states={'draft': [('readonly', False)]}),
|
||||
"invoice_id": fields.many2one("account.invoice", "Invoice", readonly=True),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
#
|
||||
# Sequences for crm.case.section
|
||||
#
|
||||
|
||||
<record model="ir.sequence.type" id="seq_section_code">
|
||||
<field name="name">Section Code</field>
|
||||
<field name="code">event.event</field>
|
||||
</record>
|
||||
<record model="ir.sequence" id="seq_section_code1">
|
||||
<field name="name">Section Code</field>
|
||||
<field name="code">event.event</field>
|
||||
<field name="prefix">C/</field>
|
||||
<field name="padding">3</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Marketing" id="menu_marketing_event_main" icon="terp-calendar" sequence="9"/>
|
||||
<menuitem name="Events Organisation" id="menu_event_main" parent="menu_marketing_event_main" />
|
||||
<menuitem name="Association" id="base.menu_association" icon="terp-calendar" sequence="9"/>
|
||||
<menuitem name="Events Organisation" id="menu_event_main" parent="base.menu_association" />
|
||||
|
||||
<!-- EVENTS -->
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
<field name="res_model">event.type</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem name="Configuration" id="menu_event_config" parent="menu_marketing_event_main" sequence="30" groups="base.group_extended"/>
|
||||
<menuitem name="Configuration" id="menu_event_config" parent="base.menu_association" sequence="30" groups="base.group_extended"/>
|
||||
<menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="menu_event_config" groups="base.group_extended,crm.group_crm_manager"/>
|
||||
|
||||
<!-- Events Organisation/CONFIGURATION/EVENTS -->
|
||||
|
@ -311,23 +311,24 @@
|
|||
<field name="date" string="Registration Date"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id,event_id)" />
|
||||
<field name="partner_invoice_id" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
|
||||
<field name="user_id"/>
|
||||
<field name="tobe_invoiced"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Registration">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Invoice" colspan="4"/>
|
||||
<field name="event_product"/>
|
||||
<field name="invoice_id"/>
|
||||
<field name="tobe_invoiced"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Registration Cost" colspan="4"/>
|
||||
<field name="nb_register"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="price_subtotal"/>
|
||||
</group>
|
||||
<group colspan="2" col="2" attrs="{'invisible':[('tobe_invoiced','=',False)]}">
|
||||
<separator string="Invoice" colspan="4"/>
|
||||
<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"/>
|
||||
</group>
|
||||
|
||||
<group col="8" colspan="4">
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
|
@ -485,6 +486,6 @@
|
|||
name="Registrations"
|
||||
id="menu_action_registration" parent="menu_event_main"
|
||||
action="action_registration"/>
|
||||
<menuitem name="Reporting" id="menu_report_event" parent="menu_marketing_event_main" sequence="20"/>
|
||||
<menuitem name="Reporting" id="menu_report_event" parent="base.menu_association" sequence="20"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -30,9 +30,16 @@
|
|||
</field>
|
||||
<field name="event_registration_ids" colspan="4" nolabel="1">
|
||||
<tree string="Events Registration">
|
||||
<field name="date" string="Date"/>
|
||||
<field name="event_id" />
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_invoice_id"/>
|
||||
<field name="nb_register"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="state"/>
|
||||
<button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
|
||||
<button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
|
|
@ -11,13 +11,6 @@
|
|||
<field name="name">EVENT / Subscriber</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="menu_event_config" model="ir.ui.menu">-->
|
||||
<!-- <field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager'), ref('base.group_extended')])]"/>-->
|
||||
<!-- </record>-->
|
||||
<!---->
|
||||
<!-- <record id="menu_report_event" model="ir.ui.menu">-->
|
||||
<!-- <field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager'), ref('base.group_extended')])]"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_event_confirm_registration"/>
|
||||
<field name="context">{'record_id' : active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_event_make_invoice"/>
|
||||
<field name="context">{'record_id' : active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ class partner_event_registration(osv.osv_memory):
|
|||
_columns = {
|
||||
'event_id': fields.many2one('event.event', 'Event'),
|
||||
'event_type': fields.many2one('event.type', 'Type', readonly=True),
|
||||
'unit_price': fields.float('Cost', readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'unit_price': fields.float('Registration Cost'),
|
||||
'start_date': fields.datetime('Start date', required=True, help="Beginning Date of Event", readonly=True),
|
||||
'end_date': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True),
|
||||
'nb_register': fields.integer('Number of Registration'),
|
||||
|
@ -50,7 +49,6 @@ class partner_event_registration(osv.osv_memory):
|
|||
"""This Function Open Registration For Given Event id and Partner.
|
||||
|
||||
"""
|
||||
|
||||
value = {}
|
||||
res_obj = self.pool.get('res.partner')
|
||||
job_obj = self.pool.get('res.partner.job')
|
||||
|
@ -83,14 +81,13 @@ class partner_event_registration(osv.osv_memory):
|
|||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
|
||||
for current in self.browse(cr, uid, ids, context=context):
|
||||
for reg in reg_obj.browse(cr, uid, record_ids, context=context):
|
||||
for partner in res_obj.browse(cr, uid, record_ids, context=context):
|
||||
new_case = reg_obj.create(cr, uid, {
|
||||
'name' : 'Registration',
|
||||
'event_id' : current.event_id and current.event_id.id or False,
|
||||
'unit_price' : current.event_id.unit_price,
|
||||
'currency_id' : current.event_id.currency_id and current.event_id.currency_id.id or False,
|
||||
'partner_id' : record_ids[0],
|
||||
'partner_invoice_id' : record_ids[0] or False,
|
||||
'unit_price' : current.unit_price,
|
||||
'partner_id' : partner.id,
|
||||
'partner_invoice_id' : partner.id,
|
||||
'event_product': current.event_id.product_id.name,
|
||||
'contact_id': contact_id,
|
||||
'email_from': email,
|
||||
|
@ -128,18 +125,27 @@ class partner_event_registration(osv.osv_memory):
|
|||
res.append((record['id'], event_id))
|
||||
return res
|
||||
|
||||
def onchange_event_id(self, cr, uid, ids, event_id, context={}):
|
||||
def onchange_event_id(self, cr, uid, ids, event_id, context=None):
|
||||
res = {}
|
||||
event_obj = self.pool.get('event.event')
|
||||
|
||||
product_obj = self.pool.get('product.product')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
if not context:
|
||||
context = {}
|
||||
partner_id = context.get('active_id', False)
|
||||
if event_id:
|
||||
event = event_obj.browse(cr, uid, event_id)
|
||||
pricelist_id = event.pricelist_id and event.pricelist_id.id or False
|
||||
if partner_id:
|
||||
partner = partner_obj.browse(cr, uid, partner_id, context=context)
|
||||
pricelist_id = pricelist_id or partner.property_product_pricelist.id
|
||||
unit_price = product_obj._product_price(cr, uid, [event.product_id.id], False, False, {'pricelist': pricelist_id})[event.product_id.id]
|
||||
|
||||
res['value'] = {
|
||||
'event_type': event.type and event.type.id or False,
|
||||
'start_date': event.date_begin,
|
||||
'end_date': event.date_end,
|
||||
'unit_price': event.unit_price,
|
||||
'currency_id': event.currency_id and event.currency_id.id or False
|
||||
'unit_price': unit_price,
|
||||
}
|
||||
return res
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@
|
|||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="event_type"/>
|
||||
<group colspan="2" col="3">
|
||||
<field name="unit_price"/>
|
||||
<field name="currency_id" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue