[IMP] Event/Membership: clean code/yml
bzr revid: hmo@tinyerp.com-20100712133056-kywn9u4c0dm3mly6
This commit is contained in:
parent
b14540cdb8
commit
878da4182e
|
@ -53,7 +53,7 @@ class event_event(osv.osv):
|
|||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
""" Copy record of Given id
|
||||
@param id: Id of Event Registration type record.
|
||||
@param id: Id of Event record.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
if not default:
|
||||
|
@ -65,7 +65,13 @@ class event_event(osv.osv):
|
|||
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
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Event IDs
|
||||
@param product_id: Product's id
|
||||
"""
|
||||
if not product_id:
|
||||
return {'value': {'unit_price': False}}
|
||||
else:
|
||||
|
@ -82,6 +88,13 @@ class event_event(osv.osv):
|
|||
return self.write(cr, uid, ids, {'state': 'done'}, context=context)
|
||||
|
||||
def button_confirm(self, cr, uid, ids, context=None):
|
||||
"""This Funtion send reminder who had already confirmed their event registration.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Event IDs
|
||||
@param return: True
|
||||
"""
|
||||
register_pool = self.pool.get('event.registration')
|
||||
for event in self.browse(cr, uid, ids, context=context):
|
||||
if event.mail_auto_confirm:
|
||||
|
@ -95,14 +108,12 @@ class event_event(osv.osv):
|
|||
|
||||
|
||||
def _get_register(self, cr, uid, ids, fields, args, context=None):
|
||||
"""
|
||||
Get Confirm or uncofirm register value.
|
||||
"""Get Confirm or uncofirm register value.
|
||||
@param ids: List of Event registration type's id
|
||||
@param fields: List of function fields(register_current and register_prospect).
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: Dictionary of function fields value.
|
||||
"""
|
||||
|
||||
register_pool = self.pool.get('event.registration')
|
||||
res = {}
|
||||
for event in self.browse(cr, uid, ids, context):
|
||||
|
@ -116,7 +127,7 @@ class event_event(osv.osv):
|
|||
state.append('draft')
|
||||
|
||||
reg_ids = register_pool.search(cr, uid, [
|
||||
('event_id', '=', event.id),
|
||||
('event_id', '=', event.id),
|
||||
('state', 'in', state)])
|
||||
|
||||
if 'register_current' in fields:
|
||||
|
@ -157,7 +168,6 @@ class event_event(osv.osv):
|
|||
register_pool.write(cr, uid, reg_ids, register_values)
|
||||
return res
|
||||
|
||||
|
||||
_columns = {
|
||||
'type': fields.many2one('event.type', 'Type', help="Type of Event like Seminar, Exhibition, Conference, Training."),
|
||||
'register_max': fields.integer('Maximum Registrations', help="Provide Maximun Number of Registrations"),
|
||||
|
@ -183,7 +193,6 @@ class event_event(osv.osv):
|
|||
'country_id': fields.related('address_id', 'country_id',
|
||||
type='many2one', relation='res.country', string='Country'),
|
||||
'language': fields.char('Language',size=64),
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -218,7 +227,7 @@ and users by email"),
|
|||
"badge_partner": fields.char('Badge Partner', size=128),
|
||||
"event_product": fields.char("Product Name", size=128, required=True),
|
||||
"tobe_invoiced": fields.boolean("To be Invoiced"),
|
||||
"invoice_id": fields.many2one("account.invoice", "Invoice"),
|
||||
"invoice_id": fields.many2one("account.invoice", "Invoice", readonly=True),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
|
||||
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
|
||||
|
@ -235,8 +244,8 @@ and users by email"),
|
|||
|
||||
def _make_invoice(self, cr, uid, reg, lines, context=None):
|
||||
""" Create Invoice from Invoice lines
|
||||
@param reg : Object of event.registration
|
||||
@param lines: ids of Invoice lines
|
||||
@param reg : Model of Event Registration
|
||||
@param lines: Ids of Invoice lines
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
@ -325,11 +334,10 @@ and users by email"),
|
|||
return new_invoice_ids
|
||||
|
||||
def check_confirm(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Check confirm event register on given id.
|
||||
"""This Function Open Event Registration and send email to user.
|
||||
@param ids: List of Event registration's IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: Dictionary value which open Confirm registration form.
|
||||
@return: True
|
||||
"""
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
unconfirmed_ids = []
|
||||
|
@ -360,13 +368,17 @@ and users by email"),
|
|||
}
|
||||
return True
|
||||
|
||||
def button_reg_close(self, cr, uid, ids, *args):
|
||||
def button_reg_close(self, cr, uid, ids, *args):
|
||||
"""This Function Close Event Registration.
|
||||
"""
|
||||
registrations = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, registrations, _('Done'))
|
||||
self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
return True
|
||||
|
||||
def button_reg_cancel(self, cr, uid, ids, *args):
|
||||
def button_reg_cancel(self, cr, uid, ids, *args):
|
||||
"""This Function Cancel Event Registration.
|
||||
"""
|
||||
registrations = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, registrations, _('Cancel'))
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
|
@ -375,8 +387,8 @@ and users by email"),
|
|||
def create(self, cr, uid, values, context=None):
|
||||
""" Overrides orm create method.
|
||||
"""
|
||||
event = self.pool.get('event.event').browse(cr, uid, values['event_id'], context=context)
|
||||
|
||||
event_obj = self.pool.get('event.event')
|
||||
event = event_obj.browse(cr, uid, values['event_id'], context=context)
|
||||
values['date_deadline']= event.date_begin
|
||||
values['description']= event.mail_confirm
|
||||
values['currency_id'] = event.currency_id.id
|
||||
|
@ -385,9 +397,12 @@ and users by email"),
|
|||
self._history(cr, uid, registrations, _('Created'))
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
""" Overrides orm write method.
|
||||
"""
|
||||
event_obj = self.pool.get('event.event')
|
||||
if 'event_id' in values:
|
||||
event = self.pool.get('event.event').browse(cr, uid, values['event_id'], context=context)
|
||||
event = event_obj.browse(cr, uid, values['event_id'], context=context)
|
||||
values['date_deadline']= event.date_begin
|
||||
values['description']= event.mail_confirm
|
||||
return super(event_registration, self).write(cr, uid, ids, values, context=context)
|
||||
|
@ -439,6 +454,13 @@ and users by email"),
|
|||
return self.pool.get('account.invoice.line').create(cr, uid, vals)
|
||||
|
||||
def onchange_badge_name(self, cr, uid, ids, badge_name):
|
||||
"""This function returns value of Registration Name based on Partner Badge Name.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Registration IDs
|
||||
@param badge_name: Badge Name
|
||||
"""
|
||||
|
||||
data ={}
|
||||
if not badge_name:
|
||||
|
@ -448,44 +470,77 @@ and users by email"),
|
|||
|
||||
def onchange_contact_id(self, cr, uid, ids, contact, partner):
|
||||
|
||||
"""This function returns value of Badge Name , Badge Title based on Partner contact.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Registration IDs
|
||||
@param contact: Patner Contact IDS
|
||||
@param partner: Partner IDS
|
||||
"""
|
||||
data ={}
|
||||
if not contact:
|
||||
return data
|
||||
|
||||
contact_id = self.pool.get('res.partner.contact').browse(cr, uid, contact)
|
||||
contact_obj = self.pool.get('res.partner.contact')
|
||||
addr_obj = self.pool.get('res.partner.address')
|
||||
job_obj = self.pool.get('res.partner.job')
|
||||
|
||||
contact_id = contact_obj.browse(cr, uid, contact)
|
||||
data['badge_name'] = contact_id.name
|
||||
data['badge_title'] = contact_id.title.name
|
||||
if partner:
|
||||
partner_addresses = self.pool.get('res.partner.address').search(cr, uid, [('partner_id', '=', partner)])
|
||||
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('contact_id', '=', contact), ('address_id', 'in', partner_addresses)])
|
||||
partner_addresses = addr_obj.search(cr, uid, [('partner_id', '=', partner)])
|
||||
job_ids = job_obj.search(cr, uid, [('contact_id', '=', contact), ('address_id', 'in', partner_addresses)])
|
||||
if job_ids:
|
||||
data['email_from'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).email
|
||||
data['email_from'] = job_obj.browse(cr, uid, job_ids[0]).email
|
||||
d = self.onchange_badge_name(cr, uid, ids, data['badge_name'])
|
||||
data.update(d['value'])
|
||||
return {'value': data}
|
||||
|
||||
def onchange_event(self, cr, uid, ids, event_id, partner_invoice_id):
|
||||
"""This function returns value of Product Name, Unit Price based on Event.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Registration IDs
|
||||
@param event_id: Event ID
|
||||
@param partner_invoice_id: Partner Invoice ID
|
||||
"""
|
||||
context={}
|
||||
if not event_id:
|
||||
return {'value': {'unit_price': False, 'event_product': False}}
|
||||
data_event = self.pool.get('event.event').browse(cr, uid, event_id)
|
||||
|
||||
event_obj = self.pool.get('event.event')
|
||||
prod_obj = self.pool.get('product.product')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
|
||||
data_event = event_obj.browse(cr, uid, event_id)
|
||||
context['currency_id'] = data_event.currency_id.id
|
||||
if data_event.user_id.id:
|
||||
return {'value': {'user_id':data_event.user_id.id}}
|
||||
|
||||
if data_event.product_id:
|
||||
if not partner_invoice_id:
|
||||
unit_price=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
|
||||
unit_price=prod_obj.price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
|
||||
return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}}
|
||||
data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id)
|
||||
data_partner = res_obj.browse(cr, uid, partner_invoice_id)
|
||||
context.update({'partner_id': data_partner})
|
||||
unit_price = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
|
||||
unit_price = prod_obj._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
|
||||
return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}}
|
||||
|
||||
return {'value': {'unit_price': False, 'event_product': False}}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False):
|
||||
"""This function returns value of Patner Invoice id, Unit Price, badget title based on partner and Event.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Registration IDs
|
||||
@param event_id: Event ID
|
||||
@param partner_invoice_id: Partner Invoice ID
|
||||
"""
|
||||
job_obj = self.pool.get('res.partner.job')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
|
||||
data={}
|
||||
data['badge_partner'] = data['contact_id'] = data['partner_invoice_id'] = data['email_from'] = data['badge_title'] = data['badge_name'] = False
|
||||
|
@ -496,35 +551,46 @@ and users by email"),
|
|||
d = self.onchange_partner_invoice_id(cr, uid, ids, event_id, part)
|
||||
# this updates the dictionary
|
||||
data.update(d['value'])
|
||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part])
|
||||
addr = res_obj.address_get(cr, uid, [part])
|
||||
if addr:
|
||||
if addr.has_key('default'):
|
||||
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id', '=', addr['default'])])
|
||||
job_ids = job_obj.search(cr, uid, [('address_id', '=', addr['default'])])
|
||||
if job_ids:
|
||||
data['contact_id'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).contact_id.id
|
||||
data['contact_id'] = job_obj.browse(cr, uid, job_ids[0]).contact_id.id
|
||||
d = self.onchange_contact_id(cr, uid, ids, data['contact_id'], part)
|
||||
data.update(d['value'])
|
||||
partner_data = self.pool.get('res.partner').browse(cr, uid, part)
|
||||
partner_data = res_obj.browse(cr, uid, part)
|
||||
data['badge_partner'] = partner_data.name
|
||||
|
||||
return {'value': data}
|
||||
|
||||
def onchange_partner_invoice_id(self, cr, uid, ids, event_id, partner_invoice_id):
|
||||
|
||||
"""This function returns value of Product unit Price based on Invoiced partner.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Registration IDs
|
||||
@param event_id: Event ID
|
||||
@param partner_invoice_id: Partner Invoice ID
|
||||
"""
|
||||
data={}
|
||||
context={}
|
||||
event_obj = self.pool.get('event.event')
|
||||
prod_obj = self.pool.get('product.product')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
|
||||
data['unit_price']=False
|
||||
if not event_id:
|
||||
return {'value': data}
|
||||
data_event = self.pool.get('event.event').browse(cr, uid, event_id)
|
||||
|
||||
data_event = event_obj.browse(cr, uid, event_id)
|
||||
if data_event.product_id:
|
||||
data['event_product']=data_event.product_id.name
|
||||
if not partner_invoice_id:
|
||||
data['unit_price']=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
|
||||
data['unit_price']=prod_obj.price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
|
||||
return {'value': data}
|
||||
data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id)
|
||||
data_partner = res_obj.browse(cr, uid, partner_invoice_id)
|
||||
context.update({'partner_id': data_partner})
|
||||
data['unit_price'] = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
|
||||
data['unit_price'] = prod_obj._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
|
||||
return {'value': data}
|
||||
return {'value': data}
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<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" />
|
||||
|
||||
<!-- EVENTS -->
|
||||
<!--<menuitem name="Events Organisation" id="menu_event_main" icon="terp-calendar" />-->
|
||||
|
||||
<!-- EVENTS/CONFIGURATION/TYPE OF EVENTS -->
|
||||
<record model="ir.ui.view" id="view_event_type_form">
|
||||
|
@ -36,7 +36,6 @@
|
|||
<menuitem name="Configuration" id="menu_event_config" parent="menu_marketing_event_main" 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 -->
|
||||
|
||||
<record model="ir.ui.view" id="view_event_form">
|
||||
|
@ -69,8 +68,7 @@
|
|||
<field name="active"/>
|
||||
<field name="register_min"/>
|
||||
<field name="register_max"/>
|
||||
<separator string="Notes" colspan="4"/>
|
||||
<!--field name="note" colspan="4" nolabel="1"/-->
|
||||
<newline/>
|
||||
<field name="state" select="1"/>
|
||||
<group col="4" colspan="2">
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
|
||||
|
@ -113,7 +111,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- event.event tree view -->
|
||||
<!-- Event tree view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_event_tree">
|
||||
<field name="name">event.event.tree</field>
|
||||
|
@ -134,6 +132,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Events Calendar View -->
|
||||
|
||||
<record id="view_event_calendar" model="ir.ui.view">
|
||||
<field name="name">event.event.calendar</field>
|
||||
<field name="model">event.event</field>
|
||||
|
@ -142,12 +142,12 @@
|
|||
<field name="arch" type="xml">
|
||||
<calendar color="user_id" date_start="date_begin" string="Event Organization">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="type" widget="selection"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Event Graph view -->
|
||||
|
||||
<record model="ir.ui.view" id="view_event_graph">
|
||||
<field name="name">Event Graph</field>
|
||||
|
@ -162,6 +162,8 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Event Search View -->
|
||||
|
||||
<record model="ir.ui.view" id="view_event_search">
|
||||
<field name="name">Events</field>
|
||||
<field name="model">event.event</field>
|
||||
|
@ -169,8 +171,8 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Events">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-document-new" string="Draft" name="draft" domain="[('state','=','draft')]" help="Draft Events"/>
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed Events"/>
|
||||
<filter icon="terp-check" string="Current" name="draft" domain="[('state','in',('draft', 'confirm'))]" help="Current Events"/>
|
||||
<filter icon="terp-camera_test" string="Open" domain="[('state','=','confirm')]" help="Open Events"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Event" select="1"/>
|
||||
<field name="state" select="1"/>
|
||||
|
@ -294,15 +296,17 @@
|
|||
</page>
|
||||
<page string="Emails" groups="base.group_extended">
|
||||
<group colspan="4">
|
||||
<field colspan="4" name="email_cc" string="CC"/>
|
||||
<field colspan="4" name="email_cc" string="CC" widget="char" size="512"/>
|
||||
</group>
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
|
||||
<form string="Communication history">
|
||||
<group col="6" colspan="4">
|
||||
<field name="date"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_from"/>
|
||||
</group>
|
||||
<group col="4" colspan="4">
|
||||
<field name="email_from"/>
|
||||
<field name="date"/>
|
||||
<field name="email_to" widget="char" size="512"/>
|
||||
<field name="email_cc" widget="char" size="512"/>
|
||||
<field name="name" colspan="4" widget="char" size="512"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<field name="description" colspan="4" nolabel="1"/>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
property_account_receivable: account.a_recv
|
||||
|
||||
- |
|
||||
we create it with a "Conference on OpenERP Offshore Business" event and provide "Beginning date", "Ending Date", "Product" as Concert Ticket.
|
||||
we create it with a "Conference on OpenERP Offshore Business" event and provide "Beginning date", "Ending Date" and "Product" as Concert Ticket.
|
||||
-
|
||||
!record {model: event.event, id: event_event_conference0}:
|
||||
code: C/004
|
||||
|
@ -64,9 +64,9 @@
|
|||
state: draft
|
||||
type: 'event_type_conference0'
|
||||
reply_to: 'info@customer.com'
|
||||
|
||||
|
||||
- |
|
||||
we set the limit of registrations to this event using "Minimum Registrations" 2 and "Maximum Registrations" 10
|
||||
we set the limit of registrations to this event using "Minimum Registrations" 2 and "Maximum Registrations" 10.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
self.write(cr, uid, [ref('event_event_conference0')], {'register_max': 10, 'register_min': 2})
|
||||
|
@ -96,7 +96,6 @@
|
|||
!record {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
badge_name: Jacot
|
||||
badge_partner: Mark Johnson
|
||||
badge_title: M.
|
||||
contact_id: base_contact.res_partner_contact_jacot0
|
||||
date_deadline: '2010-06-07 13:39:00'
|
||||
event_id: event.event_event_conference0
|
||||
|
@ -110,11 +109,13 @@
|
|||
if not then confirmation will fail because its greater then the Maximum registration.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
from tools.translate import _
|
||||
obj_register = self.pool.get('event.registration')
|
||||
event_id1 = self.browse(cr, uid, [ref('event_event_conference0')])[0]
|
||||
event_id1 = self.browse(cr, uid, ref('event_event_conference0'))
|
||||
register_ids = obj_register.search(cr, uid, [('event_id', '=', event_id1.id)])
|
||||
register_id = obj_register.browse(cr, uid, register_ids)[0]
|
||||
assert register_id.nb_register <= event_id1.register_max
|
||||
assert register_id.nb_register <= event_id1.register_max, _('NO. of Registration for this event is More than Maximum Registration Defined !')
|
||||
|
||||
|
||||
- |
|
||||
And Confirm that Registration by click on "Confirm Registration" button of Registraion form.
|
||||
|
@ -150,7 +151,6 @@
|
|||
!record {model: event.registration, id: event_registration_registrationpassot0}:
|
||||
badge_name: Passot
|
||||
badge_partner: Mediapole SPRL
|
||||
badge_title: M.
|
||||
contact_id: base_contact.res_partner_contact_passot0
|
||||
date_deadline: '2010-06-07 13:39:00'
|
||||
email_from: info@mediapole.net
|
||||
|
@ -170,10 +170,10 @@
|
|||
I Check that the total number of confirmed is 2 and unconfirmed registrations 1.
|
||||
-
|
||||
!python {model: event.event}: |
|
||||
obj_event = self.browse(cr, uid, [ref('event_event_conference0')])[0]
|
||||
assert obj_event.register_current == 2
|
||||
assert obj_event.register_prospect == 1
|
||||
|
||||
from tools.translate import _
|
||||
obj_event = self.browse(cr, uid, ref('event_event_conference0'))
|
||||
assert obj_event.register_current == 2, "Number of Confirmed Registration for this event is %s"%(obj_event.register_current)
|
||||
assert obj_event.register_prospect == 1, "Number of Unconfirmed Registration for this event is %s" %(obj_event.register_prospect)
|
||||
- |
|
||||
This event is finished by click on "Event Done" button of this event form.
|
||||
-
|
||||
|
@ -186,8 +186,7 @@
|
|||
!assert {model: event.registration, id: event_registration_registrationjacot0}:
|
||||
- state == 'open'
|
||||
- |
|
||||
Now, I will invoice the participant who have address using "Make Invoices". This wizard will also give the number of invoices are created and rejected.
|
||||
Create invoice will be linked to Invoice Field available on Payments tab of registrations
|
||||
Now, I will invoice the participant who have address using "Make Invoices".Create invoice will be linked to Invoice Field available on Payments tab of registrations.
|
||||
|
||||
-
|
||||
!record {model: event.make.invoice, id: event_make_invoice_0}:
|
||||
|
@ -201,16 +200,6 @@
|
|||
I check that Invoice for this partner is created or not.
|
||||
-
|
||||
!python {model: event.registration}: |
|
||||
obj_event_reg = self.pool.get('event.registration')
|
||||
obj_lines = self.pool.get('account.invoice.line')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
data_event_reg = obj_event_reg.browse(cr, uid, [ref('event_registration_registrationzen0')], context=context)[0]
|
||||
invoice_ids = inv_obj.search(cr, uid, [('partner_id', '=', data_event_reg.partner_invoice_id.id)])
|
||||
|
||||
if invoice_ids:
|
||||
invoice_id = inv_obj.browse(cr, uid, invoice_ids)[0]
|
||||
line_ids = obj_lines.search(cr, uid, [('product_id', '=', data_event_reg.event_id.product_id.id), ('invoice_id', '=', invoice_id.id), ('price_unit', '=', data_event_reg.unit_price)])
|
||||
line_id = obj_lines.browse(cr, uid, line_ids)[0]
|
||||
assert line_id.product_id == data_event_reg.event_id.product_id
|
||||
assert data_event_reg.partner_id == invoice_id.partner_id
|
||||
assert invoice_id.address_invoice_id == data_event_reg.partner_address_id
|
||||
from tools.translate import _
|
||||
data_event_reg = self.browse(cr, uid, ref('event_registration_registrationzen0'), context=context)
|
||||
assert data_event_reg.invoice_id, _("Invoices has not been generated for this partner")
|
||||
|
|
|
@ -47,23 +47,29 @@ class partner_event_registration(osv.osv_memory):
|
|||
}
|
||||
|
||||
def open_registration(self, cr, uid, ids, context=None):
|
||||
"""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')
|
||||
event_obj = self.pool.get('event.event')
|
||||
reg_obj = self.pool.get('event.registration')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
record_ids = context and context.get('active_ids', []) or []
|
||||
addr = res_obj.address_get(cr, uid, record_ids)
|
||||
contact_id = False
|
||||
email = False
|
||||
if addr.has_key('default'):
|
||||
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id', '=', addr['default'])])
|
||||
job_ids = job_obj.search(cr, uid, [('address_id', '=', addr['default'])])
|
||||
if job_ids:
|
||||
contact = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0])
|
||||
contact = job_obj.browse(cr, uid, job_ids[0])
|
||||
if contact:
|
||||
contact_id = contact.contact_id.id
|
||||
email = contact.email
|
||||
|
||||
event_obj = self.pool.get('event.event')
|
||||
reg_obj = self.pool.get('event.registration')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
result = mod_obj._get_id(cr, uid, 'event', 'view_registration_search')
|
||||
res = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
|
||||
|
@ -123,10 +129,11 @@ class partner_event_registration(osv.osv_memory):
|
|||
return res
|
||||
|
||||
def onchange_event_id(self, cr, uid, ids, event_id, context={}):
|
||||
res = {}
|
||||
res = {}
|
||||
event_obj = self.pool.get('event.event')
|
||||
|
||||
if event_id:
|
||||
obj_event = self.pool.get('event.event')
|
||||
event = obj_event.browse(cr, uid, event_id)
|
||||
event = event_obj.browse(cr, uid, event_id)
|
||||
res['value'] = {
|
||||
'event_type': event.type and event.type.id or False,
|
||||
'start_date': event.date_begin,
|
||||
|
|
|
@ -140,7 +140,13 @@ class membership_line(osv.osv):
|
|||
'''Member line'''
|
||||
|
||||
def _check_membership_date(self, cr, uid, ids, context=None):
|
||||
'''Check if membership product is not in the past'''
|
||||
"""Check if membership product is not in the past
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Membership Line IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
|
||||
cr.execute('''
|
||||
SELECT MIN(ml.date_to - ai.date_invoice)
|
||||
|
@ -158,7 +164,15 @@ class membership_line(osv.osv):
|
|||
return True
|
||||
|
||||
def _state(self, cr, uid, ids, name, args, context=None):
|
||||
'''Compute the state lines'''
|
||||
"""Compute the state lines
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Membership Line IDs
|
||||
@param name: Field Name
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param return: Dictionary of state Value
|
||||
"""
|
||||
res = {}
|
||||
for line in self.browse(cr, uid, ids):
|
||||
cr.execute('''
|
||||
|
@ -221,35 +235,47 @@ class Partner(osv.osv):
|
|||
_inherit = 'res.partner'
|
||||
|
||||
def _get_partner_id(self, cr, uid, ids, context=None):
|
||||
|
||||
data_inv = self.pool.get('membership.membership_line').browse(cr, uid, ids, context)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
data_inv = member_line_obj.browse(cr, uid, ids, context)
|
||||
list_partner = []
|
||||
for data in data_inv:
|
||||
list_partner.append(data.partner.id)
|
||||
ids2 = list_partner
|
||||
while ids2:
|
||||
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
|
||||
ids2 = res_obj.search(cr, uid, [('associate_member','in',ids2)], context=context)
|
||||
list_partner += ids2
|
||||
return list_partner
|
||||
|
||||
def _get_invoice_partner(self, cr, uid, ids, context=None):
|
||||
data_inv = self.pool.get('account.invoice').browse(cr, uid, ids, context)
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
res_obj = self.pool.get('res.partner')
|
||||
data_inv = inv_obj.browse(cr, uid, ids, context)
|
||||
list_partner = []
|
||||
for data in data_inv:
|
||||
list_partner.append(data.partner_id.id)
|
||||
ids2 = list_partner
|
||||
while ids2:
|
||||
ids2 = self.pool.get('res.partner').search(cr, uid, [('associate_member','in',ids2)], context=context)
|
||||
ids2 = res_obj.search(cr, uid, [('associate_member','in',ids2)], context=context)
|
||||
list_partner += ids2
|
||||
return list_partner
|
||||
|
||||
def _membership_state(self, cr, uid, ids, name, args, context=None):
|
||||
"""This Function return Membership State For Given Partner.
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Partner IDs
|
||||
@param name: Field Name
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param return: Dictionary of Membership state Value
|
||||
"""
|
||||
res = {}
|
||||
for id in ids:
|
||||
res[id] = 'none'
|
||||
today = time.strftime('%Y-%m-%d')
|
||||
for id in ids:
|
||||
partner_data = self.browse(cr,uid,id)
|
||||
partner_data = self.browse(cr, uid, id)
|
||||
if partner_data.membership_cancel and today > partner_data.membership_cancel:
|
||||
res[id] = 'canceled'
|
||||
continue
|
||||
|
@ -302,7 +328,7 @@ class Partner(osv.osv):
|
|||
|
||||
def _membership_date(self, cr, uid, ids, name, args, context=None):
|
||||
|
||||
'''Return date of membership'''
|
||||
"""Return date of membership"""
|
||||
|
||||
name = name[0]
|
||||
res = {}
|
||||
|
@ -404,6 +430,8 @@ class Partner(osv.osv):
|
|||
}
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
"""Check Recursive for Associated Members.
|
||||
"""
|
||||
level = 100
|
||||
while len(ids):
|
||||
cr.execute('select distinct associate_member from res_partner where id IN %s',(tuple(ids),))
|
||||
|
@ -438,9 +466,11 @@ product_template()
|
|||
class Product(osv.osv):
|
||||
|
||||
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
model_obj = self.pool.get('ir.model.data')
|
||||
|
||||
if ('product' in context) and (context['product']=='membership_product'):
|
||||
model_data_ids_form = self.pool.get('ir.model.data').search(cr,user,[('model','=','ir.ui.view'),('name','in',['membership_products_form','membership_products_tree'])])
|
||||
resource_id_form = self.pool.get('ir.model.data').read(cr, user, model_data_ids_form, fields=['res_id','name'])
|
||||
model_data_ids_form = model_obj.search(cr,user,[('model','=','ir.ui.view'),('name','in',['membership_products_form','membership_products_tree'])])
|
||||
resource_id_form = model_obj.read(cr, user, model_data_ids_form, fields=['res_id','name'])
|
||||
dict_model={}
|
||||
for i in resource_id_form:
|
||||
dict_model[i['name']]=i['res_id']
|
||||
|
@ -488,6 +518,8 @@ class account_invoice_line(osv.osv):
|
|||
_inherit='account.invoice.line'
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
"""Overrides orm write method
|
||||
"""
|
||||
if not context:
|
||||
context={}
|
||||
res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context)
|
||||
|
@ -513,6 +545,8 @@ class account_invoice_line(osv.osv):
|
|||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
"""Remove Membership Line Record for Account Invoice Line
|
||||
"""
|
||||
if not context:
|
||||
context={}
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
|
@ -522,10 +556,13 @@ class account_invoice_line(osv.osv):
|
|||
return super(account_invoice_line, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
"""Overrides orm create method
|
||||
"""
|
||||
result = super(account_invoice_line, self).create(cr, uid, vals, context)
|
||||
line = self.browse(cr, uid, result)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
if line.invoice_id.type == 'out_invoice':
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
|
||||
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
|
||||
if line.product_id and line.product_id.membership and not ml_ids:
|
||||
# Product line is a membership product
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<field name="membership_start" position="after">
|
||||
<newline/>
|
||||
<group expand="1" string="Group By" colspan="10" col="8">
|
||||
<group expand="0" string="Group By" colspan="10" col="8">
|
||||
<filter string="Associate Member" name = "associate" icon="terp-personal" domain="[]" context="{'group_by':'associate_member'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'membership_state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
@ -169,7 +169,7 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="act_window_id" ref="action_membership_members"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Members" parent="menu_member" id="menu_members" sequence="2" action="action_membership_members"/>
|
||||
|
||||
<!-- PARTNERS -->
|
||||
|
|
|
@ -46,21 +46,9 @@
|
|||
-
|
||||
!record {model: membership.invoice, id: membership_invoice_0}:
|
||||
product_id: membership.product_product_membershipproduct0
|
||||
- |
|
||||
I check that address is defined or not for this Member.
|
||||
-
|
||||
!python {model: membership.invoice}: |
|
||||
partner_ids = [ref('res_partner_markjohnson0')]
|
||||
addre_obj = self.pool.get('res.partner.address')
|
||||
ids = addre_obj.search(cr, uid, [('partner_id', '=', partner_ids)])
|
||||
|
||||
addre_id = addre_obj.browse(cr, uid, ids)[0]
|
||||
assert addre_id.partner_id
|
||||
assert addre_id.id
|
||||
assert addre_id.type
|
||||
|
||||
- |
|
||||
I click on "Confirm" button of this wizard.
|
||||
I click on "Confirm" button of this wizard. and also check that address is defined or not for this partner in this function.
|
||||
-
|
||||
!python {model: membership.invoice}: |
|
||||
self.membership_invoice(cr, uid, [ref("membership_invoice_0")], {"active_ids": [ref("membership.res_partner_markjohnson0")]})
|
||||
|
@ -69,21 +57,20 @@
|
|||
I check that Invoice is created for this members.
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
|
||||
from tools.translate import _
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
product_obj = self.pool.get('product.product')
|
||||
invoice_line_obj = self.pool.get(('account.invoice.line'))
|
||||
invoice_line_obj = self.pool.get('account.invoice.line')
|
||||
|
||||
partner_id = self.browse(cr, uid, [ref('res_partner_markjohnson0')])[0]
|
||||
ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner_id.id), ('account_id', '=', partner_id.property_account_receivable.id)])
|
||||
invoice_id = invoice_obj.browse(cr, uid, ids)[0]
|
||||
|
||||
product = product_obj.browse(cr, uid, [ref('product_product_membershipproduct0')], context=context)[0]
|
||||
partner_id = self.browse(cr, uid, ref('res_partner_markjohnson0'))
|
||||
inv_ids = invoice_obj.search(cr, uid, [('partner_id', '=', partner_id.id), ('account_id', '=', partner_id.property_account_receivable.id)])
|
||||
invoice_id = invoice_obj.browse(cr, uid, inv_ids)[0]
|
||||
product = product_obj.browse(cr, uid, ref('product_product_membershipproduct0'), context=context)
|
||||
line_ids = invoice_line_obj.search(cr, uid, [('product_id', '=', product.id), ('invoice_id', '=', invoice_id.id)])
|
||||
line_id = invoice_line_obj.browse(cr, uid, line_ids)[0]
|
||||
|
||||
assert line_id.product_id.id == product.id
|
||||
assert invoice_id.partner_id.id == partner_id.id
|
||||
|
||||
assert line_ids, _('Invoices has not been generated for this Member!')
|
||||
|
||||
- |
|
||||
I check that the "Current membership state" will remain same untill opening the invoice.
|
||||
|
@ -96,17 +83,17 @@
|
|||
So, I check that invoice is in draft state then the "membership state" of a member is "Waiting member".
|
||||
-
|
||||
!python {model: membership.membership_line}: |
|
||||
partner_id = self.pool.get('res.partner').browse(cr, uid, [ref('res_partner_markjohnson0')])[0]
|
||||
ids = self.search(cr, uid, [('partner', '=', partner_id.id)])
|
||||
current_id = self.browse(cr, uid, ids)[0]
|
||||
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
inv_obj = self.pool.get('account.invoice')
|
||||
|
||||
ids = inv_obj.search(cr, uid, [('partner_id', '=', partner_id.id), ('account_id', '=', partner_id.property_account_receivable.id)])
|
||||
inv_id = inv_obj.browse(cr, uid, ids)[0]
|
||||
partner_id = partner_obj.browse(cr, uid, ref('res_partner_markjohnson0'))
|
||||
member_ids = self.search(cr, uid, [('partner', '=', partner_id.id)])
|
||||
current_id = self.browse(cr, uid, member_ids)[0]
|
||||
|
||||
inv_ids = inv_obj.search(cr, uid, [('partner_id', '=', partner_id.id), ('account_id', '=', partner_id.property_account_receivable.id)])
|
||||
inv_id = inv_obj.browse(cr, uid, inv_ids)[0]
|
||||
if inv_id.state == 'draft':
|
||||
assert current_id == 'waiting'
|
||||
assert current_id.state == 'waiting'
|
||||
- |
|
||||
When the invoice is in open state it become Invoiced Member, When the invoice is in paid state the same "Current membership state" changed to Paid Member.
|
||||
Now, If we cancel the invoice "Current membership state" changed to Cancel Member.
|
||||
|
|
|
@ -25,56 +25,48 @@ from tools.translate import _
|
|||
import tools
|
||||
|
||||
class membership_invoice(osv.osv_memory):
|
||||
"""Membership Invoice"""
|
||||
|
||||
_name = "membership.invoice"
|
||||
_description = "Membership Invoice From Partner"
|
||||
_columns ={
|
||||
_description = "Membership Invoice"
|
||||
_columns = {
|
||||
'product_id': fields.many2one('product.product','Membership Product', required=True),
|
||||
}
|
||||
}
|
||||
|
||||
def membership_invoice(self, cr, uid, ids, context={}):
|
||||
def membership_invoice(self, cr, uid, ids, context=None):
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
product_obj = self.pool.get('product.product')
|
||||
invoice_line_obj = self.pool.get(('account.invoice.line'))
|
||||
invoice_tax_obj = self.pool.get(('account.invoice.tax'))
|
||||
partner_ids = context['active_ids']
|
||||
for data in self.read(cr, uid, ids, context=context):
|
||||
product_id = data['product_id']
|
||||
cr.execute('''
|
||||
SELECT partner_id, id, type
|
||||
FROM res_partner_address
|
||||
WHERE partner_id IN %s''',(tuple(partner_ids),))
|
||||
fetchal = cr.fetchall()
|
||||
if not fetchal:
|
||||
raise osv.except_osv(_('Error !'), _('No Address defined for this partner'))
|
||||
partner_address_ids = {}
|
||||
for x in range(len(fetchal)):
|
||||
pid = fetchal[x][0]
|
||||
id = fetchal[x][1]
|
||||
type = fetchal[x][2]
|
||||
if partner_address_ids.has_key(pid) and partner_address_ids[pid]['type'] == 'invoice':
|
||||
continue
|
||||
partner_address_ids[pid] = {'id': id, 'type': type}
|
||||
|
||||
invoice_list= []
|
||||
product = product_obj.read(cr, uid, product_id, ['uom_id'], context=context)
|
||||
|
||||
for partner_id in partner_ids:
|
||||
account_id = partner_obj.read(cr, uid, partner_id, ['property_account_receivable'], context=context)['property_account_receivable'][0]
|
||||
read_fpos = partner_obj.read(cr, uid, partner_id, ['property_account_position'], context=context)
|
||||
fpos_id = read_fpos['property_account_position'] and read_fpos['property_account_position'][0]
|
||||
invoice_line_obj = self.pool.get('account.invoice.line')
|
||||
invoice_tax_obj = self.pool.get('account.invoice.tax')
|
||||
if not context:
|
||||
context={}
|
||||
partner_ids = context.get('active_ids', [])
|
||||
invoice_list = []
|
||||
for partner in partner_obj.browse(cr, uid, partner_ids, context=context):
|
||||
account_id = partner.property_account_receivable and partner.property_account_receivable.id or False
|
||||
fpos_id = partner.property_account_position and partner.property_account_position.id or False
|
||||
addr = partner_obj.address_get(cr, uid, [partner.id], ['invoice'])
|
||||
if not addr.get('invoice', False):
|
||||
continue
|
||||
for data in self.browse(cr, uid, ids, context=context):
|
||||
product_id = data.product_id and data.product_id.id or False
|
||||
product_uom_id = data.product_id and data.product_id.uom_id.id
|
||||
quantity = 1
|
||||
line_value = {
|
||||
'product_id' : product_id,
|
||||
}
|
||||
quantity = 1
|
||||
line_dict = invoice_line_obj.product_id_change(cr, uid, {}, product_id, product['uom_id'][0], quantity, '', 'out_invoice', partner_id, fpos_id, context=context)
|
||||
}
|
||||
|
||||
line_dict = invoice_line_obj.product_id_change(cr, uid, {},
|
||||
product_id, product_uom_id, quantity, '', 'out_invoice', partner.id, fpos_id, context=context)
|
||||
line_value.update(line_dict['value'])
|
||||
if line_value['invoice_line_tax_id']:
|
||||
if line_value.get('invoice_line_tax_id', False):
|
||||
tax_tab = [(6, 0, line_value['invoice_line_tax_id'])]
|
||||
line_value['invoice_line_tax_id'] = tax_tab
|
||||
|
||||
invoice_id = invoice_obj.create(cr, uid, {
|
||||
'partner_id' : partner_id,
|
||||
'address_invoice_id': partner_address_ids[partner_id]['id'],
|
||||
'partner_id' : partner.id,
|
||||
'address_invoice_id': addr.get('invoice', False),
|
||||
'account_id': account_id,
|
||||
'fiscal_position': fpos_id or False
|
||||
}
|
||||
|
@ -86,16 +78,17 @@ class membership_invoice(osv.osv_memory):
|
|||
if line_value['invoice_line_tax_id']:
|
||||
tax_value = invoice_tax_obj.compute(cr, uid, invoice_id).values()
|
||||
for tax in tax_value:
|
||||
invoice_tax_obj.create(cr, uid, tax, context=context)
|
||||
invoice_tax_obj.create(cr, uid, tax, context=context)
|
||||
|
||||
|
||||
return {
|
||||
'domain': [('id', 'in', invoice_list)],
|
||||
'name': 'Membership Invoice',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
return {
|
||||
'domain': [('id', 'in', invoice_list)],
|
||||
'name': 'Membership Invoice',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
membership_invoice()
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Membership Invoice">
|
||||
<group colspan="4" >
|
||||
<field name="product_id" context="{'product':membership_product}" domain="[('membership','=',True)]"/>
|
||||
<field name="product_id" context="{'product':membership_product}" domain="[('membership','=',True)]" widget="selection"/>
|
||||
</group>
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-close" special="cancel" string="Close"/>
|
||||
<button icon="gtk-ok" string="Confirm" name="membership_invoice" type="object"/>
|
||||
<button icon="gtk-apply" string="Confirm" name="membership_invoice" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -39,4 +39,4 @@
|
|||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue