[REF] correct some view

bzr revid: mva@openerp.com-20120210160110-edhiqjkxww0vm1j8
This commit is contained in:
MVA 2012-02-10 17:01:10 +01:00
parent 0982e88f2e
commit 266da9940b
5 changed files with 17 additions and 20 deletions

View File

@ -118,6 +118,7 @@ class event_event(osv.osv):
if 'register_prospect' in fields:
res[event.id]['register_prospect'] = number and number[0] or 0.0
return res
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}),
@ -202,6 +203,7 @@ class event_registration(osv.osv):
'partner_id_address': fields.many2one('res.partner.address', 'Partner', states={'done': [('readonly', True)]}),
"contact_id": fields.many2one('res.partner.address', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id
'date_closed': fields.datetime('Closure Date', readonly=True),
'date_open': fields.datetime('Open Date', readonly=True),
'email_from': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('email_from', '=', False),('model','=',_name)]),
'date_deadline': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
@ -226,7 +228,7 @@ class event_registration(osv.osv):
def do_open(self, cr, uid, ids, context=None):
""" Open Registration
"""
res = self.write(cr, uid, ids, {'state': 'open'}, context=context)
res = self.write(cr, uid, ids, {'state': 'open','date_open':time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
self.mail_user(cr, uid, ids)
self.message_append(cr, uid, ids, _('Open'))
return res

View File

@ -176,7 +176,7 @@
<field name="type">calendar</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<calendar color="user_id" date_start="date_begin" date_stop="date_end" string="Event Organization">
<calendar color="type" date_start="date_begin" date_stop="date_end" string="Event Organization">
<field name="name"/>
<field name="type" widget="selection"/>
</calendar>
@ -218,13 +218,6 @@
help="My Events"
domain="[('user_id','=',uid)]"/>
</field>
<field name="section_id" widget="selection" groups="base.group_extended">
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="[('section_id.user_id','=',uid)]"
groups="base.group_extended"
help="My Sales Team(s)"/>
</field>
</group>
<newline/>
<group expand="0" string="Group By...">
@ -248,7 +241,7 @@
<field name="res_model">event.event</field>
<field name="view_type">form</field>
<field name="view_mode">calendar,tree,form,graph</field>
<field name="context">{"search_default_draft": "1", "search_default_section_id": section_id}</field>
<field name="context">{"search_default_section_id": section_id}</field>
<field name="search_view_id" ref="view_event_search"/>
<field name="help">Event is the low level object used by meeting and others documents that should be synchronized with mobile devices or calendar applications through caldav. Most of the users should work in the Calendar menu, and not in the list of events.</field>
</record>
@ -323,6 +316,7 @@
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Dates" colspan="2"/>
<field name="date_open"/>
<field name="date_closed"/>
<field name="date" />
<field name="date_deadline" />
@ -430,7 +424,7 @@
<field name="view_type">form</field>
<field name="domain"></field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="context">{"search_default_draft": "1"}</field>
<field name="context">{}</field>
<field name="search_view_id" ref="view_registration_search"/>
</record>

View File

@ -72,6 +72,7 @@ class sale_order_line(osv.osv):
'name':registration.order_id.partner_invoice_id.name,
'partner_id':registration.order_id.partner_id.id,
'contact_id':registration.order_id.partner_invoice_id.id,
'nb_register':registration.product_uom_qty,
'email':registration.order_id.partner_id.email,
'phone':registration.order_id.partner_id.phone,
'street':registration.order_id.partner_invoice_id.street,
@ -81,8 +82,8 @@ class sale_order_line(osv.osv):
'event_id':registration.event.id,
}
self.pool.get('event.registration').create(cr,uid,dic,context=context)
message = ("The sales order '%s' create a registration.") % (registration.order_id.name,)
self.log(cr, uid, registration.event.id, message)
message = ("A registration is create from the %s sale order.") % (registration.order_id.name,)
self.pool.get('event.registration').log(cr, uid, registration.event.id, message)
return super(sale_order_line, self).button_confirm(cr, uid, ids, context)

View File

@ -21,7 +21,7 @@
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='discount']" position="after">
<field name="event" colspan="3" domain="[('type', '=', event_type_id )]" attrs="{'invisible': [('event_ok', '=', False)],'required': [('event_ok', '=', False)]}"/>
<field name="event" colspan="3" domain="[('type', '=', event_type_id )]" attrs="{'invisible': [('event_ok', '=', False)],'required': [('event_ok', '!=', False)]}"/>
<field name="event_type_id" invisible="1"/>
<field name="event_ok" invisible="1"/>
</xpath>

View File

@ -4,11 +4,10 @@
create a product
-
!record {model: product.product, id: event_product}:
name: formation
name: test_formation
type: service
event_ok: True
event_type_id: 1
default_code: EVT
-
create a sale order
-
@ -18,6 +17,10 @@
payment_term: account.account_payment_term
-
create sale order line from the sale order with the product
-
!record {model: event.event,id: event}:
name: test_event
type: 1
-
!record {model: sale.order.line, id: line}:
product_id: event_product
@ -25,6 +28,7 @@
product_uom_qty: 8
order_id: order
name: sale order line
event: event
-
confirm the sale order
-
@ -46,7 +50,3 @@
else:
if registration_ids[0].state == 'draft':
print 'erreur mauvais state'
-
check registration has been created
check the right type the good person state = draft
-