[IMP, MOVE, REN] event: 1) Moved event/test/test_event.yml to event/test/process/event_confirm2done.yml

2) Removed all demo data which is used in yml
3) Created process from events register, confirm to done
4) updated __openerp__.py

bzr revid: ron@tinyerp.com-20111114094127-n3l4xwca8d1m2guc
This commit is contained in:
ron@tinyerp.com 2011-11-14 15:11:27 +05:30
parent 46322eb7e1
commit 7ef465010b
3 changed files with 22 additions and 170 deletions

View File

@ -54,7 +54,7 @@ Note that:
'res_partner_view.xml',
],
'demo_xml': ['event_demo.xml'],
'test': ['test/test_event.yml',
'test': ['test/process/event_confirm2done.yml',
'test/process/register2invoice.yml'],
'installable': True,
'active': False,

View File

@ -61,6 +61,8 @@
<field eval="time.strftime('%Y-%m-01 23:05:15')" name="date_end"/>
<field name="product_id" ref="event_product_0"/>
<field name="unit_price">68.00</field>
<field name="mail_auto_registr">True</field>
<field name="mail_auto_confirm">True</field>
<field name="user_id" ref="base.user_root"/>
<field name="register_max">500</field>
<field name="type" ref="event_type_1"/>

View File

@ -1,172 +1,22 @@
- |
In order to test the "Event Organisation" in Association system.
- |
I want to organize one conference event on "OpenERP Business".
- |
I'm creating new product "Conference Ticket" to specify registration Cost of conference.
-
!record {model: product.product, id: product_product_ticketforconcert0}:
categ_id: product.cat1
list_price: 68.0
name: Conference Ticket
- |
I'm creating Event type "Conference".
-
!record {model: event.type, id: event_type_conference0}:
name: Conferences
- |
I'm creating one Event "Conference on OpenERP Business" which will last from 1st of this month to 10th of this month.
-
!record {model: event.event, id: event_event_conference0}:
date_begin: !eval time.strftime('%Y-%m-01')
date_end: !eval time.strftime('%Y-%m-10')
name: Conference on OpenERP Business.
product_id: 'product_product_ticketforconcert0'
type: 'event_type_conference0'
reply_to: 'info@customer.com'
- |
Check that the new conference event is "Draft" or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'draft', "Event should be in draft by default when first time created"
- |
Need Minimum 10 Registrations to confirm/start this Conference Event and does not allowed more than 100 Registrations.
- |
So I set Minimum and Maximum Registrations limit.
-
!python {model: event.event}: |
self.write(cr, uid, [ref('event_event_conference0')], {'register_max': 100, 'register_min': 10})
- |
I'm doing to confirm that conference event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_event_conference0")])
- |
But this conference event need minimum 10 Confirmed Registrations. so Check that Event is not "confirmed".
-
!assert {model: event.event, id: event_event_conference0}:
- state != 'confirm', "Event should not confirmed if minimum registrations does not reached"
- |
"Mark Johnson" want to subscribe/join into "Conference on OpenERP Business" with 10 tickets.
- |
I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_markjohnson0}:
address:
- city: Bruxelles
country_id: base.be
job_ids:
- contact_id: base_contact.res_partner_contact_jacot0
function: CTO
name: base.res_partner_maxtor
sequence_partner: 0.0
state: current
street: Rue des Palais 51, bte 33
type: default
zip: '1000'
email: 'info@mycustomer.com'
name: Mark Johnson
- |
I'm creating Registration for "Mark Johnson" on "Conference on OpenERP Business" with 10 tickets.
-
!record {model: event.registration, id: event_registration_registrationjacot0}:
contact_id: base_contact.res_partner_contact_jacot0
event_id: event.event_event_conference0
partner_id: event.res_partner_markjohnson0
partner_invoice_id: event.res_partner_markjohnson0
event_product: Conference Ticket
unit_price: 68.0
nb_register: 10
- |
I'm going to Open that Registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationjacot0")])
- |
Check that Registration is in "Open" state or not.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- state == 'open', "Registration should be open here."
- |
I'm again trying to confirm that conference event.
-
!python {model: event.event}: |
self.button_confirm(cr, uid, [ref("event_event_conference0")])
- |
Now Minimum requirement of Registration is fulfil. so Check that Event is "confirmed" or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'confirm', "Event should be confirmed here."
- |
I'm creating invoice of Registration of "Mark Johnson" on "Conference on OpenERP Business".
I want to organize one conference event on "OpenERP Business", Customer subscribe/join
into "Conference on OpenERP Business" with 6 tickets, first I confim this event.
-
!python {model: event.registration}: |
self.action_invoice_create(cr, uid, [ref("event_registration_registrationjacot0")])
- |
Check Invoice of Registration of "Mark Johnson" is created or not.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- invoice_id != False, "Invoice should be generated"
- |
Check Registration of "Mark Johnson" is closed or not after invoice generated.
-
!assert {model: event.registration, id: event_registration_registrationjacot0}:
- state != 'done', "Registration should be closed after invoice generated"
- |
Now "Mark Johnson" want to another registration on "Conference on OpenERP Business" with 120 tickets.
- |
I'm creating new registration for "Mark Johnson" with 100 tickets.
-
!record {model: event.registration, id: event_registration_registrationzen0}:
event_id: event.event_event_conference0
partner_id: event.res_partner_markjohnson0
partner_invoice_id: event.res_partner_markjohnson0
event_product: Conference Ticket
unit_price: 68.0
nb_register: 100
- |
I'm going to open "Mark Johnson" registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
- |
But conference event does not allow more than 100 Registrations. so Check that registration is not in "open" state.
-
!assert {model: event.registration, id: event_registration_registrationzen0}:
- state == 'draft', "Registration should be in draft by default."
- |
Now I'm modifying number of tickets of "Mark Johnson"'s registration with 90 tickets.
-
!python {model: event.registration}: |
self.write(cr, uid, [ref("event_registration_registrationzen0")], {'nb_register': 90})
- |
I'm again try to open "Mark Johnson" registration.
-
!python {model: event.registration}: |
self.check_confirm(cr, uid, [ref("event_registration_registrationzen0")])
- |
Check that registration "open" or not.
-
!assert {model: event.registration, id: event_registration_registrationzen0}:
- state == 'open', "Registration should be open here."
- |
I'm closing "Conference on OpenERP Business" Conference event
-
!python {model: event.event}: |
self.button_done(cr, uid, [ref("event_event_conference0")])
- |
Check that conference is in "close" state or not.
-
!assert {model: event.event, id: event_event_conference0}:
- state == 'done', "Registration should be Closed here."
self.button_confirm(cr, uid, [ref("event_0")])
-
I Check that Event is "confirmed", and Its automatically sending mail to registered
partner which joined to this event.
-
!assert {model: event.event, id: event_0}:
- state == 'confirm', "Event should be confirmed."
-
After completed event, I close this event.
-
!python {model: event.event}: |
self.button_done(cr, uid, [ref("event_0")])
-
Check that conference is in "close" state.
-
!assert {model: event.event, id: event_0}:
- state == 'done', "Registration should be Closed."