[ADD] review some bugs and some views

bzr revid: mva@openerp.com-20120110140826-bi7t0afmyzb92hka
This commit is contained in:
MVA 2012-01-10 15:08:26 +01:00
parent debfe254dd
commit e6eeabd862
5 changed files with 27 additions and 22 deletions

View File

@ -21,7 +21,7 @@
<field name="name">Events Filling Status</field>
<field name="res_model">report.event.registration</field>
<field name="view_type">form</field>
<field name="domain">[('state','not in',('cancel','done'))]</field>
<field name="domain">[('event_state','not in',('cancel','done'))]</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_event_reg_graph"/>
</record>

View File

@ -203,7 +203,7 @@ class event_event(osv.osv):
return res
_columns = {
'name': fields.char('Summary', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
'name': fields.char('Origin', 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)]}),
@ -298,7 +298,7 @@ class event_registration(osv.osv):
_columns = {
'id': fields.integer('ID'),
'name': fields.char('Summary', size=124, readonly=True, states={'draft': [('readonly', False)]}),
'name': fields.char('Origin', size=124, readonly=True, states={'draft': [('readonly', False)]}),
'email_cc': fields.text('CC', size=252, readonly=False, states={'done': [('readonly', True)]}, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'nb_register': fields.integer('Quantity', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Number of Registrations or Tickets"),
'event_id': fields.many2one('event.event', 'Event', required=True, readonly=True, states={'draft': [('readonly', False)]}),

View File

@ -315,7 +315,8 @@
<form string="Registration">
<group col="6" colspan="4">
<field name="event_id" on_change="onchange_event(event_id, partner_invoice_id)" domain="[('state','in',('draft','confirm'))]"/>
<field name="create_date" string="Registration Date"/>
<field name="date" />
<field name="date_deadline" />
<field name="name"/>
<field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" required="1" on_change="onchange_partner_id(partner_id,event_id)" />
<field name="user_id" attrs="{'readonly':[('state','!=', 'draft')]}" />
@ -323,13 +324,12 @@
</group>
<notebook colspan="4">
<page string="Registration">
<field name="date" />
<field name="date_deadline" />
<group colspan="2" col="2">
<separator string="Registration Cost" colspan="4"/>
<field name="nb_register"/>
<field name="nb_register" invisible="1"/>
<field name="unit_price"/>
<field name="price_subtotal"/>
<field name="price_subtotal" invisible="1"/>
</group>
<group colspan="2" col="2" attrs="{'invisible':[('tobe_invoiced','=',False)]}">
<separator string="Invoice" colspan="4"/>
@ -337,8 +337,8 @@
<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>
<separator string="Description" colspan="4"/>
<field name="description" colspan="4" nolabel="1"/>
<separator string="" colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1" colspan="2"/>
@ -348,7 +348,10 @@
</group>
</page>
<page string="Extra Info">
<field name="create_date" string="Registration Date"/>
<separator string="Contact" colspan="4"/>
<field name="contact_id" on_change="onchange_contact_id(contact_id, partner_id)" />
<field name="email_from"/>
<field name="badge_ids" colspan="4" nolabel="1">
@ -396,6 +399,9 @@
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>

View File

@ -41,7 +41,7 @@ class report_event_registration(osv.osv):
'confirm_state': fields.integer(' # No of Confirmed Registrations', size=20),
'register_max': fields.integer('Maximum Registrations'),
'nbevent': fields.integer('Number Of Events'),
'type': fields.many2one('event.type', 'Event Type'),
'event_type': fields.many2one('event.type', 'Event Type'),
'registration_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True),
'event_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True),
'user_id': fields.many2one('res.users', 'Responsible', readonly=True),
@ -63,7 +63,6 @@ class report_event_registration(osv.osv):
CREATE OR REPLACE view report_event_registration AS (
SELECT
event_id,
r.id,
e.date_begin AS event_date,
e.user_id AS user_id,
@ -82,7 +81,7 @@ class report_event_registration(osv.osv):
CASE WHEN r.state IN ('done') THEN r.price_subtotal ELSE 0 END AS total,
e.type AS type,
e.type AS event_type,
r.price_subtotal,
AVG(r.price_subtotal) AS average_subtotal,
e.register_max AS register_max,
@ -102,18 +101,18 @@ class report_event_registration(osv.osv):
r.id,
registration_state,
r.nb_register,
e.type, e.id, e.date_begin, e.main_speaker_id,
e.register_max, e.type, e.state,event_id, e.user_id,e.company_id,e.product_id,e.section_id, r.price_subtotal,
event_type, e.id, e.date_begin, e.main_speaker_id,
e.register_max,event_id, e.user_id,e.company_id,e.product_id,e.section_id, r.price_subtotal,
e.user_id,
e.section_id,
event_state,
e.company_id,
e.product_id,
e.main_speaker_id,
year,
month,
e.type,
e.register_max,
e.state
e.register_max
)
""")

View File

@ -16,7 +16,7 @@
<field name="month" invisible="1"/>
<field name="event_id" invisible="1"/>
<field name="event_state" invisible="1"/>
<field name="type" invisible="1"/>
<field name="event_type" invisible="1"/>
<field name="nbevent"/>
<field name="draft_state" invisible="context.get('no_of_draft_invisible', False)"/>
<field name="confirm_state"/>
@ -96,7 +96,7 @@
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="type" widget="selection"/>
<field name="event_type" widget="selection"/>
<field name="event_date"/>
</group>
<newline/>
@ -109,7 +109,7 @@
<filter string="Event" name="event" icon="terp-crm" context="{'group_by':'event_id', 'max_reg_event_visible':0}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by': 'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Event Type" icon="terp-crm" context="{'group_by':'type'}"/>
<filter string="Event Type" icon="terp-crm" context="{'group_by':'event_type'}"/>
<filter string="event_state" icon="terp-stock_effects-object-colorize" context="{'group_by':'event_state'}" help="Events States"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
@ -124,7 +124,7 @@
<newline/>
<group expand="1" string="Group By Registration...">
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'registration_state'}" help="Events States"/>
<filter string="user" icon="terp-stock_effects-object-colorize" context="{'group_by':'user_id_registration'}" help="Events States"/>
<filter string="user" icon="terp-personal" context="{'group_by':'user_id_registration'}" help="Events States"/>
</group>
</search>