[MERGE]: Merged lp:~openerp-dev/openobject-addons/trunk-event_improvements-atp-event_pageview-nco with some changes
bzr revid: atp@tinyerp.com-20120429180729-nscqe9nix9am0367
This commit is contained in:
@@ -53,7 +53,7 @@ Note that:
|
||||
],
|
||||
'demo_xml': ['event_demo.xml'],
|
||||
'test': ['test/process/event_draft2done.yml'],
|
||||
'css': ['static/src/css/event.css'],
|
||||
'css': ['static/src/css/*.css'],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
|
||||
@@ -220,6 +220,8 @@ class event_event(osv.osv):
|
||||
'note': fields.text('Description', readonly=False, states={'done': [('readonly', True)]}),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
|
||||
'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'),
|
||||
'location_id': fields.many2one('res.partner','Organization Address', readonly=False, states={'done': [('readonly', True)]}),
|
||||
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -408,6 +410,5 @@ class event_registration(osv.osv):
|
||||
return {'value': data}
|
||||
|
||||
event_registration()
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
+84
-18
@@ -45,6 +45,39 @@
|
||||
<menuitem name="Configuration" id="base.menu_marketing_config_root" parent="event_main_menu" sequence="30"/>
|
||||
<menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="base.menu_marketing_config_root" groups="base.group_no_one"/>
|
||||
|
||||
|
||||
<!-- Event Item Tree view-->
|
||||
<record model="ir.ui.view" id="view_event_items_tree">
|
||||
<field name="name">Event Items Tree</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Event Items">
|
||||
<field name="product_id" string="Ticket Type" />
|
||||
<field name="uom_id"/>
|
||||
<field name="sales_end_date"/>
|
||||
<field name="price"/>
|
||||
<field name="qty"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Event Item Form View -->
|
||||
<record model="ir.ui.view" id="view_event_items_form">
|
||||
<field name="name">Event Items Form</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Event Items">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id)"/>
|
||||
<field name="price"/>
|
||||
<field name="qty"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="discount"/>
|
||||
<field name="sales_end_date"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Events Organisation/CONFIGURATION/EVENTS -->
|
||||
|
||||
<record model="ir.ui.view" id="view_event_form">
|
||||
@@ -52,20 +85,58 @@
|
||||
<field name="model">event.event</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Events">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="date_begin"/>
|
||||
<field name="date_end"/>
|
||||
<field name="type" on_change="onchange_event_type(type,context)"/>
|
||||
<field name="user_id"/>
|
||||
<field name="address_id" />
|
||||
</group>
|
||||
<form string="Events" layout="manual">
|
||||
<div class="oe_form_topbar">
|
||||
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
|
||||
<button string="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
|
||||
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" icon="gtk-convert"/>
|
||||
<div class="oe_right">
|
||||
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
|
||||
</div>
|
||||
</div>
|
||||
<sheet string="Event Form" layout="auto">
|
||||
<group col="2">
|
||||
<group col="2">
|
||||
<div class="oe_event_title">
|
||||
<field name="name" nolabel="1"/>
|
||||
</div>
|
||||
<newline/>
|
||||
<group colspan="4" string="vanue">
|
||||
<div class="oe_sub1"> Venue : </div> <separator orientation="vertical"/>
|
||||
<field name="location_id" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<div class="oe_mapbox"> </div><newline/>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="70px" class="oe_td_border">
|
||||
Where
|
||||
</td>
|
||||
<td width="150px">
|
||||
<field name="address_id" nolabel="1"/>
|
||||
</td>
|
||||
<td width="auto">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="oe_td_date_border">Start: </td><td><field name="date_begin" nolabel="1"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="oe_td_date_border">End</td><td><field name="date_end" nolabel="1"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Event">
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
<field name="registration_ids" colspan="4" nolabel="1" groups="event.group_event_manager,event.group_event_user">
|
||||
<field name="registration_ids" colspan="4" nolabel="1" groups="event.group_event_manager">
|
||||
<tree string="Registration" editable="top">
|
||||
<field name="name" />
|
||||
<field name="email" />
|
||||
@@ -98,13 +169,7 @@
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
<field name="state" select="1" widget="statusbar" statusbar_visible="draft,confirm,done"/>
|
||||
<group col="4" colspan="2">
|
||||
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
|
||||
<button string="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
|
||||
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
|
||||
</page>
|
||||
<page string="Speakers" groups="base.group_extended">
|
||||
<field name="main_speaker_id" domain="[('speaker','=',True)]"/>
|
||||
@@ -112,7 +177,7 @@
|
||||
<separator string="Other Speakers" colspan="4"/>
|
||||
<field name="speaker_ids" domain="[('speaker','=',True)]" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Extra Info">
|
||||
<page string="Extra Info" groups="event.group_event_manager">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Registrations" colspan="2"/>
|
||||
<field name="register_min"/>
|
||||
@@ -129,6 +194,7 @@
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -64,6 +64,7 @@ div.oe_fold_column{
|
||||
-webkit-font-smoothing: antialiased;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.oe_event_button_unsubscribe {
|
||||
display: inline-block;
|
||||
border: 1px solid #AAA;
|
||||
@@ -116,7 +117,31 @@ div.oe_fold_column{
|
||||
background-color: #DC5F59;
|
||||
}
|
||||
.no_of_seats{
|
||||
width:25px;
|
||||
|
||||
width:25px;
|
||||
}
|
||||
|
||||
.oe_event_title{
|
||||
font-size: 25px;
|
||||
}
|
||||
.oe_sub1
|
||||
{
|
||||
float:left;
|
||||
}
|
||||
.oe_mapbox
|
||||
{
|
||||
width:380px;
|
||||
height:200px;
|
||||
border:1px solid black;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
|
||||
}
|
||||
.oe_td_border
|
||||
{
|
||||
width: 5em;
|
||||
padding: 2px;
|
||||
border-right: 1px solid black;
|
||||
}
|
||||
.oe_td_date_border
|
||||
{
|
||||
border-right:1px solid black;
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
@@ -34,6 +35,15 @@ class product(osv.osv):
|
||||
|
||||
product()
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_inherit = 'sale.order'
|
||||
_columns = {
|
||||
'partner_id': fields.many2one('res.partner', 'Customer', readonly=False, states={'draft': [('readonly', False)]}, required=False, change_default=True, select=True),
|
||||
'partner_invoice_id': fields.many2one('res.partner', 'Invoice Address', readonly=False, required=False, states={'draft': [('readonly', False)]}, help="Invoice address for current sales order."),
|
||||
'partner_shipping_id': fields.many2one('res.partner', 'Shipping Address', readonly=False, required=False, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."),
|
||||
}
|
||||
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
_inherit = 'sale.order.line'
|
||||
_columns = {
|
||||
@@ -70,7 +80,6 @@ class sale_order_line(osv.osv):
|
||||
def button_confirm(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
create registration with sale order
|
||||
|
||||
'''
|
||||
registration_obj = self.pool.get('event.registration')
|
||||
sale_obj = self.pool.get('sale.order')
|
||||
@@ -92,13 +101,53 @@ class sale_order_line(osv.osv):
|
||||
message = _("The registration %s has been created from the Sale Order %s.") % (registration_id, order_line.order_id.name)
|
||||
registration_obj.log(cr, uid, registration_id, message)
|
||||
return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context)
|
||||
|
||||
|
||||
class event_event(osv.osv):
|
||||
_inherit = 'event.event'
|
||||
_columns = {
|
||||
'event_item_ids': fields.one2many('event.items','event_id', 'Event Items'),
|
||||
}
|
||||
|
||||
'event_item_ids': fields.one2many('event.items','event_id', 'Event Items'),
|
||||
}
|
||||
|
||||
def open_qoutation(self, cr, uid, ids, partner_id, context=None):
|
||||
res = {}
|
||||
event_pool = self.pool.get('event.event')
|
||||
register_pool = self.pool.get('event.registration')
|
||||
sale_order_line_pool = self.pool.get('sale.order.line')
|
||||
sale_order = self.pool.get('sale.order')
|
||||
user = self.pool.get("res.users").browse(cr, uid, uid, context=context)
|
||||
for event_id in self.browse(cr, uid, ids, context=context):
|
||||
prod_pricelist_obj = self.pool.get('product.pricelist')
|
||||
sale_order_lines = []
|
||||
price_list = prod_pricelist_obj.search(cr,uid,[],context=context)[0]
|
||||
new_sale_id = sale_order.create(cr, uid, {
|
||||
'date_order': event_id.date_begin,
|
||||
'pricelist_id': price_list,
|
||||
})
|
||||
if event_id.event_item_ids:
|
||||
for items in event_id.event_item_ids:
|
||||
product = items.product_id.id
|
||||
sale_order_line = sale_order_line_pool.create(cr, uid, {
|
||||
'order_id': new_sale_id,
|
||||
'name': items.product_id.name,
|
||||
'product_uom_qty': items.qty,
|
||||
'product_id': items.product_id.id,
|
||||
'product_uom': items.uom_id.id,
|
||||
'price_unit': items.price,
|
||||
'date_planned': items.sales_end_date,
|
||||
}, context=context)
|
||||
res = {
|
||||
'name': _('Quotation'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sale.order',
|
||||
'res_id': new_sale_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'new',
|
||||
}
|
||||
self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
|
||||
return res
|
||||
|
||||
class event_items(osv.osv):
|
||||
_name = "event.items"
|
||||
_columns = {
|
||||
@@ -110,7 +159,7 @@ class event_items(osv.osv):
|
||||
'event_id': fields.many2one('event.event', 'Event'),
|
||||
'sales_end_date': fields.date('Sales End')
|
||||
}
|
||||
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product, context=None):
|
||||
product_obj = self.pool.get('product.product')
|
||||
data = {}
|
||||
|
||||
@@ -30,49 +30,57 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_event_form_inherit">
|
||||
<field name="name">Events Inherit</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Event Items">
|
||||
<field name="event_item_ids" nolabel="1"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_event_form_inherit">
|
||||
<field name="name">Events Inherit</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@string='vanue']" position="after">
|
||||
<field name="event_item_ids" nolabel="1"/><newline/>
|
||||
<div class="oe_right">
|
||||
<button string="Order Now" name="open_qoutation" help="Order Event" type="object" icon="gtk-ok" attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//group[@string='vanue']" position="attributes">
|
||||
<attribute name="string"></attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_event_items_tree">
|
||||
<field name="name">Event Items Tree</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Event Items">
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="qty"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="discount"/>
|
||||
<field name="sales_end_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_event_items_form">
|
||||
<field name="name">Event Items Form</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Event Items">
|
||||
<field name="product_id" domain="[('event_ok','=',True)]" on_change="onchange_product_id(product_id)"/>
|
||||
<field name="price"/>
|
||||
<field name="qty"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="discount"/>
|
||||
<field name="sales_end_date"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_event_items_tree">
|
||||
<field name="name">Event Items Tree</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Event Items">
|
||||
<field name="product_id"/>
|
||||
<field name="price"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="discount"/>
|
||||
<field name="sales_end_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_event_items_form">
|
||||
<field name="name">Event Items Form</field>
|
||||
<field name="model">event.items</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Event Items">
|
||||
<field name="product_id" domain="[('event_ok','=',True)]" on_change="onchange_product_id(product_id)"/>
|
||||
<field name="price"/>
|
||||
<field name="uom_id"/>
|
||||
<field name="discount"/>
|
||||
<field name="sales_end_date"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</group>
|
||||
<notebook colspan="5">
|
||||
<page string="Sales Order">
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" />
|
||||
<field domain="[('parent_id','=',partner_id)]" name="partner_invoice_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
|
||||
<field domain="[('parent_id','=',partner_id)]" name="partner_shipping_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
|
||||
|
||||
Reference in New Issue
Block a user